Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

true
Excerpt

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:

Page Properties
hiddentrue
Page Properties
hiddentrue
Scroll ignore
scroll-viewportfalse
scroll-pdffalse
scroll-officefalse
scroll-chmtrue
scroll-docbooktrue
scroll-eclipsehelptrue
scroll-epubtrue
scroll-htmltrue


falsetruefalsetruetruetruetruefalse



textEclipse






Page Properties
hiddentrue


Code Block
languagetext
themeEclipse
{ 
   "$schema": "http://json-schema.org/draft-04/schema#", 
   "title": "KpiMgmt Metric Schema", 
   "type": "object", 
   "minProperties": 1, 
   "additionalProperties": { 
     "$ref": "#/definitions/aggregation" 
   }, 
   "definitions": { 
     "aggregation": { 
       "type": "object", 
       "properties": { 
         "fun": { 
           "enum": [  
             "avg", 
             "sum", 
             "min",
			 "max"
           ] 
         }, 
         "expr": { 
           "type": "object", 
           "minProperties": 1, 
           "additionalProperties": { 
             "$ref": "model_expression_schema.json" 
           } 
         } 
       }, 
       "additionalProperties": false, 
       "required": [ 
         "fun", 
         "expr" 
       ] 
     } 
   } 
 } 




PropertyDescription
fun

fun must contain a string that identifies one of the following aggregation functions:

  • avg - This function yields the average result of the expression.
  • min - This function yields the minimum result of the expression.
  • max - This function yields the maximum result of the expression.
  • sum - This function yields the sum of results from expression.
expr

expr must contain an arithmetic or relational expression (or combination thereof) based on the fields in the KDR input and/or constant values.

Syntax: "<KDR.type>" : "<expression>" 

The functions and operators that you can use in expressions are described below.

Conditional functions:

  • isSet(<field>) - Returns 1 if the field is set to a value, otherwise 0
  • isNotSet(<field>) - Returns 1 if the field is not set to a value, otherwise 0

Operators:

  • + - Addition
  • - - Subtraction/negation
  • * - Multiplication
  • / - Division

Relational operators:

  • = - Equal
  • != - Not equal
  • > - Greater than
  • < - Less than

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.

Info
titleExample. Expressions

Arithmetic expression:

Code Block
languagetext
themeEclipse
"expr": { 
          "kdr_record_type_a": "field2-field1", 
          "kdr_record_type_b": "field3" 
         }

Expression using conditional function: 

Code Block
languagetext
themeEclipse
"expr": { 
          "kdr_record_type_a": "isSet(field1)" 
         }

Relational expression: 

Code Block
languagetext
themeEclipse
"expr": { 
          "kdr_record_type_a": "field2<(field1+10)" 
         }


In 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.



Info
titleExample - JSON Representation


Code Block
languagetext
themeEclipse
"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" 
        } 
      }     
  }
Page Properties
hidden




Scroll ignore
scroll-viewportfalse
scroll-pdftrue
scroll-officefalse
scroll-chmtrue
scroll-docbooktrue
scroll-eclipsehelptrue
scroll-epubtrue
scroll-htmlfalse


Next: