Create formula definitions in the CME formula API file
After the CME Formula API file is created, you must write the formula block for the file in ECMAScript.
The formula block section contains formula definitions that produce individual performance metrics or are grouped logically to monitor events and produce change of status metrics. Each formula or series of formulas instructs the CME to perform calculations that are based on the specified metrics or subelement properties. These calculations, in turn, return critical performance and status information concerning objects that reside in an inventory.
The general format for a formula block section is shown in the
following examples:
//**********************************************
//This is the definition for formula one:
//**********************************************
formulas.defineFormula
({
name: "full-path~formula_name",
arguments: {
input_1: “full-path~metric_name”,
input_2: “full-path~metric_name”,
input_n: “full-path~property”},
window: PV.window-type,
reset:
function
calculate:
function
calculateIntermediate:
function
});
.
.
.
//**********************************************
//This is the definition for formula n:
//**********************************************
formulas.defineFormula
({
name: "full-path~formula_name",
arguments: {
input_1: “full-path~metric_name”,
input_2: “full-path~property_name”,
input_n: “full-path~metric_name”},
window: PV.window-type,
genericID: id,
reset:
function
calculate:
function
calculateIntermediate:
function
});
A formula block consists of the following components: