How to set up measurement of timing information

This guide explains Phenix’s recommendations for gathering timing information for the purpose of optimizing video experiences. Following this methodology will allow for clear conversations and data comparisons (apples to apples) to enable quicker resolutions to issues and a faster path toward optimized experiences.

Instructions

Phenix recommends using the Performance API built into modern browsers. Specifically, the performance.measure(name) function is used in several places to mark specific points in the video delivery process.

  1. Add performance.measure() calls at key measurement points

  2. Gather the resulting data as JSON or CSV (JSON/HTTP POST example shown below)

Key Measurement Points

Place calls to performance.measure with an appropriate text identifier in at least these places:

A) First line of your JavaScript.

performance.measure("firstLineOfJS");

B) Just before the joinChannel call is made.

performance.measure("joinChannel"); channel.joinChannel(joinChannelOptions, function joinChannelCallback(error, response) {

C) First thing in the joinChannelCallback.

channel.joinChannel(joinChannelOptions, function joinChannelCallback(error, response) { performance.measure("joinChannelCallback");

D) First thing in the subscriberCallback

E) Set a callback on the videoElement.ontimeupdate

Gathering Results

After your player experience is completely loaded and in a steady state gather the information from the performance.measure() calls and send them to a backend for recording.

Once gathered on a backend the data can be shared in JSON or CSV format.

Example:

 A web page that shows an example of these measurements, including Time To First Frame (TTFF), can be found here.

©2020-2021 Phenix Real Time Solutions, Inc.