Defining Custom Thresholds
Typically, thresholds for metrics are defined in the threshold file, which can be edited within MCS. However, if you want to create a custom threshold or override an existing one without editing the main file, you can do so using the reserved ppf_custhr object.
The format for each entry is metric name: { warn: value, crit: value, highgood: "y" or "n" }. Values can contain variables or expressions.
var ppf_custhr = {
"act.deff": {
crit: 50,
highgood: "y", // "y" = higher result is better, "n" = lower is better
warn: 75
},
"act.ueff": {
crit: 50,
highgood: "y",
warn: 75
},
"act.dspeed": {
crit: "$$exp.(||a24.act.maxroutespeed||*0.7)$$",
warn: "$$exp.(||a24.act.maxroutespeed||*0.85)$$",
highgood: "y"
}
}
Custom thresholds that override existing metrics will automatically be used when making threshold-related decisions, such as deciding what color to use for a result.
Custom Metrics
The syntax also allows the creation of custom metrics. For example, connection efficiency can be calculated by dividing the throughput result by the max route speed. See PPF Expressions for how to calculate such metrics using functions.
To test a new metric against the custom thresholds, use the ppf_testThresholdResult API call:
ppf_testThresholdResult(metricName, resultValue);
// For example
var thresh = ppf_testThresholdResult("act.deff", 87);
The response is a JSON object with boolean flags:
{
bad: true,
good: false,
okay: false,
notbad: false,
notokay: true,
notgood: true
}
Example: Threshold-Based Colors
The example below uses the threshold result to return a color — green for good, orange for okay, red for bad:
function calcEfficiency(metname, tput, route) {
var efficiencyResult = parseFloat(((tput / route) * 100).toFixed(1));
var tres = ppf_testThresholdResult(metname, efficiencyResult);
return setTholdCol(tres);
}
function setTholdCol(tholdRes) {
if (tholdRes.good) {
return "#08873f"; // green
} else if (tholdRes.okay) {
return "#da711b"; // orange
} else {
return "#fa1f05"; // red
}
}

