Support & information center


Calculate the time it takes for a media related metric value to reach a certain threshold from an event and store that time in a custom metric.


keystringThe name of the metric to set.
event namestringThe name of the event to start the timer from. Events are created using rtcEvent().
criteriastringThe criteria threshold where the timer should be stopped. Similar to rtcSetTestExpectation().
aggregatestringThe type of aggregation to use for this custom metric across agents in the same test run:   “sum” – Sum the metric’s value across all agents “avg” – Calculate the average of this metric’s value across all agents.

Supported criteria

The following criteria are supported:

  • [video|audio].[in|out].bitrate – expressed in Kbits
  • video.[in|out].fps – expressed in integer values

Code examples

  .rtcSetMetricFromThresholdTime("timeTo1Mbps", "CallStart", "video.out.bitrate > 1000", "avg");Code language: JavaScript (javascript)

The example checks the time it took the probe to reach 1 Mbps of outgoing video bitrate, placing it in a custom metric called timeTo1Mbps and aggregating it as average across probes in the test.

Was this article helpful?

Related Articles