Overview
Data sets define the data you want to use from MCS. This is similar to viewing reports within MCS itself — you define your data by time frame, test type, session ID, and so on.
Below is an example of a single data set definition:
var ppf_datasets = {
data: {
voipqualitydata: {
plugins: ['act', 'voip'],
last: '1',
unit: 'hour',
from: '01 Dec 2019 00:00:00 GMT-08:00',
to: '31 Dec 2019 00:00:00 GMT-08:00',
sid: ['~sid~'],
adv: '[voip:jitter > 5.1]',
by: 10
}
},
cb: location.protocol + "//" + location.host,
thresholds: ['default'],
calendars: ['default']
}
View code with comments
var ppf_datasets = { // ppf_datasets is a reserved name. Required.
data: { // The 'data' key is required, with at least one data set.
voipqualitydata: { // User-defined key, referenced throughout the PPF.
plugins: ['act', 'voip'], // Test types for data
// 'last' and 'unit' define the time frame (e.g. 10 mins, 1 hour, 2 weeks)
last: '1',
unit: 'hour',
// Specific dates can be used INSTEAD of 'last' and 'unit'
from: '01 Dec 2019 00:00:00 GMT-08:00',
to: '31 Dec 2019 00:00:00 GMT-08:00',
sid: ['~sid~'], // Session IDs to filter data
adv: '', // Advanced filters for further filtering
by: 10 // Time interval in minutes for summarization
}
},
cb: location.protocol + "//" + location.host, // Codebase: the MCS database source. Required.
thresholds: ['default'], // Threshold file for analyzing results
calendars: ['default'] // Calendar for report dependencies
}
Required Keys
| Key | Description |
|---|---|
data | Must contain at least one fully formed data definition. See Defining a Data Set below. |
cb | The codebase — the MCS engine from which data will be fetched. By default this is the root MCS URL. |
thresholds | Determines how results are analyzed (good or bad). Widgets such as tables use thresholds to color-code results. |
calendars | Currently only one calendar exists in MCS, so this should always be ['default']. |
Defining a Data Set
| Key | Description |
|---|---|
plugins | Required. An array of plugin names to retrieve data for. For example plugins: ['act','voip','capacity'] retrieves Quality, VoIP, and Capacity data. |
last | Used with unit. Defines how far in the past to get data. For example, last: '1' with unit: 'hour' gets the last full hour. If the time is 3:30 PM, the data range will be 2:00–3:00 PM. |
unit | Used with last. Defines the calendar unit. For example, last: '1' with unit: 'week' on Tue 24th Dec would retrieve Mon 16th Dec – Sun 22nd Dec (the last full week). |
from | Used with to. Accepts a full-format date. Define either from/to or last/unit — not both. |
to | Used with from. Accepts a full-format date. |
by | Summarization interval in minutes. For example, if data is requested for the last hour and by is set to 15, data is shown in four 15-minute buckets. When omitted, data is retrieved as-is. |
sid | An array of session IDs to filter data. For example sid: ['london','new york*'] matches an exact ID of london and any ID starting with new york. |
adv | Advanced filter string for further filtering. See filter usage examples. For example adv: "[voip:jitter>1 and testto:1.1.1.1]". |
Data Set Examples
Example 1 — Basic data set
var ppf_datasets = {
data: {
qLastHour: {
plugins: ['act'],
last: '1',
unit: 'hour',
sid: [],
adv: '',
by: 15
}
},
cb: location.protocol + "//" + location.host,
thresholds: ['default'],
calendars: ['default']
}
Gets Quality data for the last full hour, summarized in 15-minute intervals.
Example 2 — Multiple test types with session ID
var ppf_datasets = {
data: {
voipCap: {
plugins: ['voip', 'capacity'],
last: '1',
unit: 'days',
sid: ['*london*'],
adv: '',
by: 60
}
},
cb: location.protocol + "//" + location.host,
thresholds: ['default'],
calendars: ['default']
}
Gets VoIP and Capacity data for the last full day, summarized in 60-minute intervals. Only data with "london" in the session ID is retrieved.
Example 3 — Multiple data sets
var ppf_datasets = {
data: {
quality: {
plugins: ['act'],
last: '1',
unit: 'days',
sid: [],
adv: '',
by: 60
},
voip: {
plugins: ['voip'],
last: '1',
unit: 'weeks',
sid: [],
adv: '',
by: 1440
}
},
cb: location.protocol + "//" + location.host,
thresholds: ['default'],
calendars: ['default']
}
This example defines two data sets: quality (last full day, 60-minute intervals) and voip (last full week, daily intervals at 1,440 minutes).

