On top of the stats API exposed by the SDK, we created a view helper to help you integrate and understand CDN Orchestrator faster. The DebugView will inform you about the different states of the SDK lifecycle and Streamroot metrics.
The view looks like the following:
debugView is really simple.
First, you will need to add the following Streamroot dependency to the
build.gradle file of your app module.
Then, you will need to update your layout to include the following snippet
<io.streamroot.ctl.delivery.client.utils.CTLStatsView android:id="@+id/dcStatsView" android:layout_width="match_parent" android:layout_height="match_parent" />
Back to the Kotlin side, find the corresponding view and attach it to a local declaration.
private lateinit var dcStatsView: CTLStatsView
onCreate(savedInstanceState: Bundle?) method, find the stats view in the associated layout.
dcStatsView = findViewById(R.id.dcStatsView)
Once the view has been setup, it will should be registered to the delivery client as a State Listener. Meaning, It will basically be notified of the current state of the SDK and will be updated at each new statistics, which make it easier for the developer to monitor. We can call then
showStats to make the data visible in the stats view.
What are the Scores?
Each block represents a CDN within a CDN List which can be selected within an Orchestrator Property. This block contains all the relevant information about that CDN and the different parameters measured from it. This information is necessary for the Orchestrator to make an informed decision about when to switch the CDN in order to select the best source for each video segment.
|Download||Total amount of Bytes downloaded.||MB|
|Bandwidth||The estimated bandwidth of the CDN.||Mbps|
|Business Score||Determined by the client based on factors such as cost, reliability, and performance within a certain region. They correspond to what has been defined in the CDN Lists in the Dashboard.||Between 0.01 and 1.0 (equivalent to between 1 and 100 in the Dashboard)|
|Error count||The count of media CDN request errors (manifests and segments).|
|QoS Score||Determined by analyzing the throughput and errors for each CDN in the lists.|
|Global Score||Calculated by multiplying QoS Score and Business Score
Global Score = QoS Score x Business Score