The code below adds an additional connected call to the custom metric named “connected-calls”.

.rtcSetMetric("connected-calls", "add", 1)

The code below sets the value of the custom metric “life-universe-everything” to 42.

.rtcSetMetric("live-universe-everything", "set", 42)

rtcSetMetricFromTimer()

Create a metric that will hold the time elapsed from the timer start time. The metric will be placed as part of the aggregated test result report.

During the test, the metric’s value will be calculated and stored per agent.

At the end of the test, the last metric value will be presented in the single agent’s report and an aggregated value, of all agents in the test, will be presented in the summary report page.

For more about times, check the timer commands available in testRTC.

Arguments:

Name Type Description
metric name string The name of the metric to set
timer key string The name of the timer

Code example:

.rtcStartTimer('myTimer')

.rtcGetTimer('myTimer', function(timer) {
	client.rtcInfo('Time: %d', timer)
})

.rtcSetMetricFromTimer('tmetric', 'myTimer') 

The code snippet above would result the following:

  • time=100; .rtcStartTimer(‘myTimer’)
  • time=150; .rtcGetTimer(‘myTimer’, …); timer=50
  • time=180; .rtcSetMetricFromTimer(‘tmetric’, ‘myTimer’) tmetric=80