metric(5.0)
The metric objects represent values that are extracted from KDR UDRs and aggregated according to the tree structure in the model. Expressions are applied on the various fields in the UDRs to calculate a value, e g a sum, average, or min/max value.
The following JSON schema describes the data format of the metric object type:
Property | Description |
|---|---|
fun |
|
expr |
Syntax: The functions and operators that you can use in expressions are described below. Conditional functions:
Operators:
Relational operators:
A relational expression or sub-expression evaluates to 1 if it is true, or 0 if it is false. You can use parentheses to modify the order of the operations, i e apply precedence rules. Example. Expressions Arithmetic expression: "expr": {
"kdr_record_type_a": "field2-field1",
"kdr_record_type_b": "field3"
}Expression using conditional function: "expr": {
"kdr_record_type_a": "isSet(field1)"
}Relational expression: "expr": {
"kdr_record_type_a": "field2<(field1+10)"
}In the case of division by zero, the value of the output of the expression will be positive infinity, negative infinity, or NaN (Not a Number) as defined in the JVM specification.
|
Example - JSON Representation
"metric": {
"TotalNumber": {
"fun": "sum",
"expr": {
"kdr_record_type_a": "isSet(field1)"
}
},
"TotalSuccessful": {
"fun": "sum",
"expr": {
"kdr_record_type_a": "field1=200"
}
},
"AvgDuration": {
"fun": "avg",
"expr": {
"kdr_record_type_a": "field2-field1",
"kdr_record_type_b": "field3"
}
}
}