Table of Contents
Beginning with Roku OS 9.1, you can measure the performance of your channel to verify that it meets Roku's performance benchmark certification requirements. The firmware records key channel performance metrics such as channel launch time, channel change time, channel exit time, and video start time via signal beacons. Signal beacons are markers for the start and stop points of user-initiated actions. To measure channel launch time, for example, beacons are fired when a user presses OK to select a channel from the Roku home screen (marking the start point) and when the selected channel is fully rendered (the stop point). The elapsed time between the start and stop points is recorded and can be viewed using the BrightScript console. You can then use the feedback from the console to update your application, if needed, to meet the certification requirements.
For your channel to pass certification, the channel launch and video start times must meet the specified certification performance requirements.
Measuring channel and EPG launch times
The Roku firmware can measure and record seven channel performance metrics: channel launch, app compile, Electronic Program Guide (EPG) launch, video start, live start, channel change, and channel exit. For most of these metrics, the firmware automatically fires the beacons for the start and stop points (referred to as "initiate" and "complete" beacons, respectively).
Your application, however, needs to fire a beacon (AppLaunchComplete) when the channel home page is fully rendered (or when video playback starts after handling a deep link, and the channel can respond to commands sent via the remote control). This is required because a channel must finish launching within the amount of time specified in the certification performance requirements.
Additionally, if your channel contains an EPG, the application must also fire beacons when the user initiates a keypress to display the EPG (EPGLaunchInitiate) and when the EPG is fully rendered and navigable (EPGLaunchComplete).
To fire the AppLaunchComplete, EPGLaunchIntitiate, and EPGLaunchComplete beacons within your application, call the signalBeacon() function on any node as demonstrated in the following examples:
For your channel to pass certification, your application must fire the AppLaunchComplete beacon to measure channel launch time. The firmware, however, automatically fires the video start beacons (VODStartInitiate and VODStartComplete); therefore, there is no additional implementation required in your application to measure video start times.
Viewing channel performance metrics
You can use the BrightScript console (port 8085) to view a log with your channel's performance metrics. When a beacon is fired, the console immediately outputs statistics related to the initiate or complete beacon. When you exit your channel, the console displays a report summarizing the statistics for the just-concluded session, which are described as follows:
A timestamp for the beacon based on milliseconds elapsed since the initiate beacon for the channel launch was recorded.
Milliseconds between the initiate and complete beacons.
|Memory Points |
(MiP, KiP, or p)
Memory points provide a relative measurement for your channel's memory performance that can be used for trend analysis. You can monitor the amount of memory points reported for any complete beacon to see if it goes up or down across builds of your application.
Memory points are measured in mebipoints (MiP), kibipoints (KiP), or points (p). This is similar to how units of information are expressed as mebibytes (MiB), kibibytes (Kib), and bytes.
The maximum amount of memory points your app used over a 5-second interval (using this interval prevents temporary spikes being recorded as the maximum). The timebase and duration denote the period when the maximum usage occurred.
Channel performance metrics reference
For each channel performance metric, the following table lists how they are measured and when their initiate and complete beacons are fired.
|Metric||Measurement||Initiate Beacon||Complete Beacon|
|Start Point||Stop Point|
|Channel Launch||The user presses the OK button to launch a channel from the home screen.||The channel is fully rendered and operational on its initial UI screen, or it reaches user-operable video playback.||AppLaunchInitiate. The last keypress before the beacon was signaled. If there was no prior keypress, the start beacon signal time.|
AppLaunchComplete. The first render pass completes after the stop beacon has been signaled via the
Your application must fire this beacon to pass certification.
|App Compile||The channel compilation starts.||The channel compilation finishes.||AppComplieInitate: The channel compilation starts after the channel is launched.||AppComplieComplete: The channel compilation finishes.|
|EPG Launch||The user initiates a keypress to bring up the EPG.||The EPG is fully rendered and navigable.|
EPGLaunchInitiate: The last keypress before the start beacon was signaled. If there was no prior keypress, the start beacon signal time.
Your application must fire this beacon if your channel includes an EPG.
EPGLaunchComplete: The first render pass completes after the stop beacon has been signaled via the
Your application must fire this beacon if your channel includes an EPG.
|Video Start||The user initiates a keypress to play a video.||Video playback has started and is visible to the user.|
VODStartInitiate: The last keypress that occurred between play events. If there was no prior keypress, the start beacon signal time.
|VODStartComplete: The first render pass completes after the stop beacon has been signaled (when the video node receives the "firstFramePresented" event from the Media Player).|
|Live Start||After bringing up the EPG, the user initiates a keypress to play a video.||Video playback has started and is visible to the user.|
LiveStartInitiate: The last keypress that occurred between play events. If there was no prior keypress, the start beacon signal time.
|LiveStartComplete: The first render pass completes after the stop beacon has been signaled (when the video node receives the "firstFramePresented" event from the Media Player).|
|Channel Change||The user initiates a keypress to change the channel.||The new video playback has started and is visible to the user.|
LiveChannelChangeInitiate: The time of the last keypress that occurred between play events, which must both be live streams as reported by the media player session object when the firstFramePresented event is received. In addition, the previous keypress must have happened before the video player was destroyed for a live channel change event to have occurred.
|LiveChannelChangeCompleted: The first render pass completes after the stop beacon has been signaled (when the video node receives the "firstFramePresented" event from the Media Player upon a live channel change occurring).|
|Channel Exit||The user presses the Home button to exit a channel.||The channel has exited and the home screen is fully rendered and operational.||AppExitInitiated: The home key handler engages app shutdown.|
AppExitComplete: The first render pass completes after the stop beacon has been signaled (when the firmware completes application exit) and the Home screen is displayed.