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.
This tutorial details the available variables by type and, when applicable, how to use them.
Global Variables
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
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
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
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 | % | Percentage 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 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
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.MOS$, $VOIP.DMOS$)">\
<param name="config" value="default">\
</applet>';
Route Variables
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$ |
| 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 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$ |
Array Variable Examples
Hop Numbers: An array of the hop numbers. The first hop of the route is noted as 0.
var hop_numbers = [0,1,2,3,4,5,6,7,8,9,10,11]
IP Addresses: 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: An array of average response time for each hop. There are, by default, 7 pings to each hop.
var avg_responses = [0,1,'-',4,2,2,14,22,36,62,68,61]
Packet Loss: 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: An array of the geographical location of each hop, if available.
var loc = ['-','-','-','-','-','-','-','-','-','-','miami-fl','miami-fl']
Network Names: An array of the network name of each hop, if available.
var networks = ['-','-','-','-','-','-','-','-','-','-','Cogent Communications','PSINet Inc']
Capacity Variables
Variables related to capacity tests, like download and upload capacity.
| Name | Units | Description | Variable |
|---|---|---|---|
| Downstream Capacity | Kbps | The download capacity result | $CAPACITY.DCAPACITY$ |
| Upstream Capacity | Kbps | The upload capacity result | $CAPACITY.UCAPACITY$ |
| 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
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
Variables related to firewall tests, like ports open and closed.
| Name | Units | Description | Variable |
|---|---|---|---|
| Firewall Record ID | - | A delimited 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
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>';
Array Variable Examples
Ports: An array of the ports/port groups tested.
var ports = [80, 110, 465, 20000]
Protocol: An array of the protocols for the ports/port groups tested.
var protocol = ['TCP', 'UDP', 'UDP', 'UDP']
Port Status: 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]
Record IDs: A vertical bar delimited string of the record IDs for each port/port group tested.
var port_recordids = '455|456|457|458'

