Test result variables

You are here
Test result variables

Overview

The data stored in the MCS database from tests being run can be used in various ways. The mechanism for referencing the data is what we call a dollar ($) variable. It allows the user to extract test results for use in things like emails and a web page.

The tutorial will detail the available variables by type and, when applicable, how to use them.

Global - Variables like date, session ID, and connection type
Name Units Description Variable
IP The IP address of the client $IP$
Time The date/time as a GMT String n/a
Date/Time The date/time that adheres to the SQL DATETIME standard. $DATETIME$
Session ID The session ID is a custom identifier used to help identify results $SID$
Record ID Record ID # for an individual test (not unique) $MSSID$
Connection Type The type of connection the test was run on (WiFi/Ethernet) $CONNTYPE$
Proxy State If a proxy was detected or not $PROXY$

Variable Example

To use the variables above a new param tag has to be added to the m_applet_params variable in the HTML of the test page. An example of this can be seen below.

The value of the param tag is simply a JavaScript variable call. Create this method and the variables will be passed to it on test completion.

var m_applet_params = '<applet width="600" height="400">\
	<param name="testspecid" value="-2">\
	<param name="js" value="processResults($IP$,$DATETIME$,$SID$,$DETAILLINK$,$MSSID$,$CONNTYPE$,$PROXY$)">\
	<param name="config" value="default">\
	</applet>';
Speed - Variables related to throughput tests, like download and upload speed
Name Units Description Variable
Download Speed bps Download Speed $SPEED.DSPEED$
Upload Speed bps Upload Speed $SPEED.USPEED$
Download QoS % Download Quality of Service $SPEED.QOS$
Upload QoS % Upload Quality of Service $SPEED.UQOS$
RTT Min ms Minimum Round Trip Time $SPEED.RTT$
RTT Max ms Maximum Round Trip Time $SPEED.MAXRTT$
RTT Avg ms Average Round Trip Time $SPEED.AVGRTT$
RTT Consistency % Consistency, as a percentage, of the round trip times $SPEED.RTTCONSISTENCY$
Max Pause ms Maximum Pause $SPEED.MAXPAUSE$
Avg Pause ms Average Pause $SPEED.AVGPAUSE$
Bandwidth bps Bandwidth $SPEED.BANDWIDTH$
Route Speed bps Route Speed $SPEED.ROUTESPEED$
Forced Idle % Forced Idle $SPEED.FORCEDIDLE$
Route Concurrency Route Concurrency $SPEED.ROUTECONC$
Download Test Type Download Test Type $SPEED.DTESTTYPE$
Upload Test Type Upload Test Type $SPEED.UTESTTYPE$

Variable Example

To use the variables above a new param tag has to be added to the m_applet_params variable in the HTML of the test page. An example of this can be seen below.

The value of the param tag is simply a JavaScript variable call. Create this method and the variables will be passed to it on test completion.

var m_applet_params = '<applet width="600" height="400">\
	<param name="testspecid" value="-2">\
	<param name="js" value="processResults($SPEED.DSPEED$, $SPEED.USPEED$, $SPEED.QOS$, $SPEED.UQOS$, $SPEED.RTT$, $SPEED.MAXRTT$, $SPEED.AVGRTT$, $SPEED.RTTCONSISTENCY$, $SPEED.MAXPAUSE$, $SPEED.AVGPAUSE$, $SPEED.BANDWIDTH$, $SPEED.ROUTESPEED$, $SPEED.FORCEDIDLE$, $SPEED.ROUTECONC$, $SPEED.DTESTTYPE$, $SPEED.UTESTTYPE$)">\
	<param name="config" value="default">\
	</applet>';
VoIP - Variables related to VoIP tests, like jitter and packet loss
Name Units Description Variable
Up Jitter ms Jitter result for the upstream $VOIP.JITTER$
Up Loss % Packet loss for the upstream $VOIP.PACKETLOSS$
Down Jitter ms Jitter for the downstream $VOIP.DJITTER$
Down Loss % Packet loss for the downstream $VOIP.DPACKETLOSS$
Discards % Prcentage of packets discarded by protocol $VOIP.DISCARDS$
Order % Ordering percentage (metric showing how well ordered the packets were) $VOIP.ORDER$
RTT Minimum ms Minimum RTT (Round trip time) $VOIP.RTTMIN$
RTT Average ms Average RTT (Round trip time) $VOIP.RTTAVG$
RTT Maximum ms Maximum RTT (Round trip time) $VOIP.RTTMAX$
RTT Consistency % RTT (Round trip time) consistency $VOIP.RTTCONSISTENCY$
SIP Register ms Time taken to perform SIP REGISTER $VOIP.REGISTER$
SIP Invite ms Time taken to perform SIP INVITE $VOIP.INVITE$
SIP Bye ms Time taken to perform SIP BYE $VOIP.BYE$
SIP ALG String SIP Application Layer Gateway detected $VOIP.SIPALGFW$
Up Distribution Loss % Upstream distribution loss $VOIP.UPDISTLOSS$
Down Distribution Loss % Upstream distribution loss $VOIP.DOWNDISTLOSS$
Up Max Jitter ms Maximum recorded jitter during the upstream $VOIP.MAXJITTER$
Down Max Jitter ms Maximum recorded jitter during the downstream $VOIP.DMAXJITTER$
Up MOS - MOS score for the upstream $VOIP.MOS$
Down MOS - MOS score for the downstream $VOIP.DMOS$
Lines - Number of lines simulated for the test $VOIP.LINES$

Variable Example

To use the variables above a new param tag has to be added to the m_applet_params variable in the HTML of the test page. An example of this can be seen below.

The value of the param tag is simply a JavaScript variable call. Create this method and the variables will be passed to it on test completion.

var m_applet_params = '<applet width="600" height="400">\
	<param name="testspecid" value="-1">\
	<param name="js" value="processResults($VOIP.JITTER$, $VOIP.PACKETLOSS$, $VOIP.DJITTER$, $VOIP.DPACKETLOSS$, $VOIP.DISCARDS$, $VOIP.ORDER$, $VOIP.RTTMIN$, $VOIP.RTTAVG$,	$VOIP.RTTMAX$,	$VOIP.RTTCONSISTENCY$, $VOIP.REGISTER$, $VOIP.INVITE$, $VOIP.BYE$, $VOIP.SIPALGFW$, $VOIP.UPDISTLOSS$, $VOIP.DOWNDISTLOSS$, $VOIP.MAXJITTER$, $VOIP.DMAXJITTER$, $VOIP.MOS$, $VOIP.DMOS$)">\
	<param name="config" value="default">\
	</applet>';
Route - Variables related to route tests, like hops and ISP
Name Units Description Variable
Hop Numbers
(client to server)
- An array of the route hop numbers $ROUTE.HOPNUMARRAY$
Hop Numbers
(server to client)
- An array of the route hop numbers $ROUTE.SHOPNUMARRAY$
IPs
(client to server)
- An array of the route IP addresses $ROUTE.IPARRAY$
IPs
(server to client)
- An array of the route IP addresses $ROUTE.SIPARRAY$
Average Response
(client to server)
ms An array of the average response times for each hop $ROUTE.MSARRAY$
Average Response
(server to client)
ms An array of the average response times for each hop $ROUTE.SMSARRAY$
Maximum Response
(client to server)
ms An array of the maximum response times for each hop $ROUTE.MSMAXARRAY$
Maximum Response
(server to client)
ms An array of the maximum response times for each hop $ROUTE.SMSMAXARRAY$
Minimum Response
(client to server)
ms An array of the minimum response times for each hop $ROUTE.MSMINARRAY$
Minimum Response
(server to client)
ms An array of the minimum response times for each hop $ROUTE.SMSMINARRAY$
Packet Loss
(client to server)
% An array of the packet loss percentage for each hop $ROUTE.LOSSARRAY$
Packet Loss
(server to client)
% An array of the packet loss percentage for each hop $ROUTE.SLOSSARRAY$
Locations
(client to server)
String An array of the location, if known, for each hop $ROUTE.LOCATIONARRAY$
Locations
(server to client)
String An array of the location, if known, for each hop $ROUTE.SLOCATIONARRAY$
Network names
(client to server)
String An array of the network names for each hop $ROUTE.NETWORKARRAY$
Network names
(server to client)
String An array of the network names for each hop $ROUTE.SNETWORKARRAY$
DSCP
(client to server)
An array of the DSCP values for each hop $ROUTE.DSCPARRAY$
DSCP
(server to client)
An array of the DSCP values for each hop $ROUTE.SDSCPARRAY$
Max Route Response
(client to server)
ms Maximum response time for the route $ROUTE.MAXMS$
Max Route Response
(server to client)
ms Maximum response time for the route $ROUTE.SMAXMS$
Target Packet Loss
(client to server)
% Packet loss to target $ROUTE.ENDLOSS$
Target Packet Loss
(server to client)
% Packet loss to target $ROUTE.SENDLOSS$
Target Average Response
(client to server)
ms Average response time to target $ROUTE.ENDMS$
Target Average Response
(server to client)
ms Average response time to target $ROUTE.SENDMS$
Target IP
(client to server)
The target IP address $ROUTE.TOIP$
Target IP
(server to client)
The target IP address $ROUTE.STOIP$
Hops to target
(client to server)
Total number of hops in route $ROUTE.HOPCOUNT$
Hops to target
(server to client)
Total number of hops in route $ROUTE.SHOPCOUNT$
Source IP
(client to server)
The IP address the route originated from $ROUTE.FROMIP$
Source IP
(server to client)
The IP address the route originated from $ROUTE.SFROMIP$

Variable Example

To use the variables above a new param tag has to be added to the m_applet_params variable in the HTML of the test page. An example of this can be seen below.

The value of the param tag is simply a JavaScript variable call. Create this method and the variables will be passed to it on test completion.

var m_applet_params = '<applet width="600" height="400">\
	<param name="testspecid" value="-3">\
	<param name="js" value="processResults($ROUTE.HOPNUMARRAY$, $ROUTE.SHOPNUMARRAY$, $ROUTE.IPARRAY$, $ROUTE.SIPARRAY$, $ROUTE.MSARRAY$, $ROUTE.SMSARRAY$, $ROUTE.MSMAXARRAY$, $ROUTE.SMSMAXARRAY$, $ROUTE.MSMINARRAY$, $ROUTE.SMSMINARRAY$, $ROUTE.LOSSARRAY$, $ROUTE.SLOSSARRAY$, $ROUTE.LOCATIONARRAY$, $ROUTE.SLOCATIONARRAY$, $ROUTE.NETWORKARRAY$, $ROUTE.SNETWORKARRAY$, $ROUTE.DSCPARRAY$, $ROUTE.SDSCPARRAY$, $ROUTE.MAXMS$, $ROUTE.SMAXMS$, $ROUTE.ENDLOSS$, $ROUTE.SENDLOSS$, $ROUTE.ENDMS$, $ROUTE.SENDMS$, $ROUTE.TOIP$, $ROUTE.STOIP$, $ROUTE.HOPCOUNT$, $ROUTE.SHOPCOUNT$, $ROUTE.FROMIP$, $ROUTE.SFROMIP$)">\
	<param name="config" value="default">\
	</applet>';

Examples of the array variables

Hop Numbers. This is an array of the hop numbers. The first hop of the route is noted as 0. An example of a hop numbers array is below:

var hop_numbers = [0,1,2,3,4,5,6,7,8,9,10,11]

IP addresses. This is an array of the IP addresses uncovered for each hop of the route.

var ip_addresses = ['192.168.1.254', '162.195.124.1', '---', '12.242.115.3', '154.54.13.149', '154.54.27.117', '154.54.44.85', '154.54.42.66', '154.54.29.221', '154.54.82.242', '66.28.4.22', '38.108.44.211']

Average responses. This is an array average response time for each hop. There are, by default, 7 pings to each hop. Each of these pings has a response time (ms). This is the average of those 7.

var avg_responses = [0,1,'-',4,2,2,14,22,36,62,68,61]

Maximum responses. This is an array maximum response time for each hop. There are, by default, 7 pings to each hop. Each of these pings has a response time (ms). This the max of those 7.

var max_responses = [0,2,'-',5,2,2,14,22,37,63,74,61]

Minimum responses. This is an array average response time for each hop. There are, by default, 7 pings to each hop. Each of these pings has a response time (ms). This is the minimum of those 7.

var min_responses = [0,1,'-',3,2,2,13,21,36,62,66,61]

Packet loss. This is an array of the packet loss, as a percentage, for each hop of the route.

var packet_loss = [14,0,100,0,0,0,0,0,0,0,0,0]

Locations. This is an array of the geographical location of each hop, if available.

var loc = ['-','-','-','-','-','-','-','-','-','-','miami-fl','miami-fl']

Network Names. This is an array of the network name of each hop, if available.

var loc = ['-','-','-','-','-','-','-','-','-','-','Cogent Communications','PSINet Inc']

DSCP. This is an array of the DSCP values of each hop, if available.

var dscp = ['-','-1','72','72','72','72','72','72','72','72','72','72']
Capacity - Variables related to capacity tests, like download and upload capacity
Name Units Description Variable
Downstream Capacity bits The download capacity result $CAPACITY.DCAPACITY$ (Kbps)
Upstream Capacity bits The upload capacity result $CAPACITY.UCAPACITY$ (Kbps)
Downstream Packets bits The packet rate achieved for the download result $CAPACITY.DPACKETS$
Upstream Packets bits The packet rate achieved for the upload result $CAPACITY.UPACKETS$
Packet Size Bytes The packet size used for the test $CAPACITY.PACKETSIZE$
Consistency of Service % The consistency of service percentage $CAPACITY.QOS$

Variable Example

To use the variables above a new param tag has to be added to the m_applet_params variable in the HTML of the test page. An example of this can be seen below.

The value of the param tag is simply a JavaScript variable call. Create this method and the variables will be passed to it on test completion.

var m_applet_params = '<applet width="600" height="400">\
	<param name="testspecid" value="-7">\
	<param name="js" value="testcomplete($CAPACITY.DCAPACITY$, $CAPACITY.UCAPACITY$, $CAPACITY.QOS$, $CAPACITY.DPACKETS$, $CAPACITY.UPACKETS$, $CAPACITY.PACKETSIZE$)">\
	<param name="config" value="default">\
	</applet>';
Firewall - Variables related to firewall tests, like ports open and closed
Name Units Description Variable
Firewall Record Id - A delimitted string of the record IDs for each port/port group. $FIREWALL.MSSIDS$
Total ports - An integer that represents the total number of ports tested. $FIREWALL.PORTTOTAL$
Ports tested - An array of the port/port groups that were tested. $FIREWALL.PORT$
Port state - An array of the state of each port tested (0 closed, 1 open) $FIREWALL.STATUS$
Port protocol - An array of the protocol for the tested ports (UDP, TCP) $FIREWALL.PROTOCOL$

JavaScript Example

To use the JavaScript variables above a new param tag has to be added to the m_applet_params variable in the HTML of the test page. An example of this can be seen below.

The value of the param tag is simply a JavaScript variable call. Create this method and the variables will be passed to it on test completion.

Note that the MSSIDS call is made from js-firewall, not js.

var m_applet_params = '<applet width="600" height="400">\
	<param name="testspecid" value="-3">\
   <param name="js-firewall" value="jsfw($FIREWALL.MSSIDS$)">\
	<param name="js" value="processResults($FIREWALL.PORTTOTAL$,$FIREWALL.PORT$,$FIREWALL.STATUS$,$FIREWALL.PROTOCOL$)">\
	<param name="config" value="default">\
	</applet>';

Examples of the array variables.

Ports. This is an array of the ports/port groups tested.

var ports = [80, 110, 465, 20000]

Protocol. This is an array of the protocols for the ports/port groups tested.

var protocol = ['TCP', 'UDP', 'UDP', 'UDP']

Port Status. This is an array of the results for the port/port groups tested. 0 for closed and 1 for open.

var port_status = [1, 1, 1, 0]

Records IDs. This is a vertical bar delimited string of the records ids for each port/port group tested.

var port_recordids = '455|456|457|458'