mobile menu
Information

PPF Data Sets

You are here
PPF Data Sets

PPF Data Sets

Data sets simply define the data you want to use from MCS. This is similar to viewing reports within MCS itself in that you define your data by time frame, test type, session ID etc.

Below is an example of how a single data set should be defined.

Click to view code with comments.

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']
}
            

Required Keys

Key Value
data The value of the data key should contain at least one fully formed data definition, as shown above. The definition required for a data entry is explained below.
cb The codebase is the MCS engine that the data will be fetched from. By default this is defined as the root MCS. Publishing security and licensing will determine if data can be fetched successfully.
thresholds Thresholds determine how results are analyzed. In other words if the result of a test should be considered good or bad. Widgets, such as tables, use these thresholds to color code results.
calendars Currently there is only one calendar in MCS, so the value of this should always be [‘default’] for now.

Defining a Data Set

Key Value
plugins Required. The value should be an array of plugins, by name, that data should be retrieved for. For example plugins: ['act','voip','capacity'] would get data for Quality, VoIP and Capacity.
last Defined in conjunction with unit (see below). Last defines how far in the past to get data. For example last 1 hour would get data for the last FULL hour. So, if the time is 3:30pm and last hour is requested the data time frame will be 2-3pm.
unit Definted in conjunction with last (see above). Unit defines the calendar unit for getting data. For example last 1 week would get the last FULL week of data. So, if it was Tue 24th December and last 1 week was requested the data retrieved would be from Mon 16th Dec - Sun 22nd Dec. The last FULL week.
from Defined in conjunction with to (see below). From accepts a full format date. Note: Define either from/to OR last/unit. Both are not required.
to Defined in conjunction with from (see above). To accepts a full format date.
by By defines the summarization of the data. The format is an integer in minutes. So, if data was requested for last 1 hour and by was set to 15 the data would be shown in 4, 15 minutes buckets. When by is not defined the data is retrieved as is.
sid All data that gets submitted to MCS has a session ID, whether it's been automatically set or not. Data can be further narrowed down by utilizing the sid key. The format is an array. For example sid: ['london','new york*'] would only get data that matched a session id of london and any session id that started with new york.
adv Further advanced filters can be used if required. A list of usage examples can be found here. The format is a string. For example adv: "[voip:jitter›1 and testto:1.1.1.1]" would get data where the test to IP was 1.1.1.1 and the Jitter result was above 1ms.

Data Set examples

Below are some examples of data sets and what the output would be.

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']
}
            

This example will get Quality data for the last full hour by an aggregate of 15 minutes.

Example 2

Multiple test types and a 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']
}
            

This example will get VoIP and Capacity data for the last full day by an aggregate of 60 minutes. A Sessionn ID has also been specified, so, data will only be retrieved that contains the word london in the Session ID.

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 has two data sets defined. One is named quality and one is named voip.