Update alarm expression BNF documentation
Change-Id: I78b2530a8aa9eec1a61ff08d8db2bb5dfc71ed8b
This commit is contained in:
@@ -90,52 +90,75 @@ An alarm expression is a boolean equation which if it evaluates to true with the
|
|||||||
|
|
||||||
At the highest level, you have an expression, which is made up of one or more subexpressions, joined by boolean logic. Parenthesis can be used for separators. In a BNF style format where items enclosed in [] are optional:
|
At the highest level, you have an expression, which is made up of one or more subexpressions, joined by boolean logic. Parenthesis can be used for separators. In a BNF style format where items enclosed in [] are optional:
|
||||||
|
|
||||||
```
|
````
|
||||||
expression
|
<expression>
|
||||||
: subexpression
|
::= <and_expression> <or_logical_operator> <expression>
|
||||||
| '(' expression ')'
|
| <and_expression>
|
||||||
| subexpression logical_operator expression
|
|
||||||
```
|
<and_expression>
|
||||||
|
::= <sub_expression> <and_logical_operator> <and_expression>
|
||||||
|
| <sub_expression>
|
||||||
|
|
||||||
|
````
|
||||||
|
Each subexpression is made up of several parts with a couple of options:
|
||||||
|
|
||||||
|
````
|
||||||
|
<sub_expression>
|
||||||
|
::= <metric> <relational_operator> <threshold_value>
|
||||||
|
| <function> '(' <metric> [',' period] ')' <relational_operator> threshold_value ['times' periods]
|
||||||
|
| '(' expression ')'
|
||||||
|
|
||||||
|
````
|
||||||
|
Period must an interger multiple of 60. The default period is 60 seconds.
|
||||||
|
|
||||||
The logical_operators are: `and` (also `&&`), `or` (also `||`).
|
The logical_operators are: `and` (also `&&`), `or` (also `||`).
|
||||||
|
|
||||||
```
|
````
|
||||||
logical_operator
|
<and_logical_operator> ::= 'and' | '&&'
|
||||||
: 'and' | '&&'
|
<or_logical_operator> ::= 'or' | '||'
|
||||||
| 'or' | '||'
|
|
||||||
````
|
````
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Each subexpression is made up of several parts with a couple of options:
|
|
||||||
|
|
||||||
```
|
|
||||||
subexpression
|
|
||||||
: metric relational_operator threshold_value
|
|
||||||
| function '(' metric [',' period] ')' relational_operator threshold_value ['times' periods]
|
|
||||||
```
|
|
||||||
A metric can be a metric name only or a metric name followed by a list of dimensions. The dimensions further qualify the metric name.
|
A metric can be a metric name only or a metric name followed by a list of dimensions. The dimensions further qualify the metric name.
|
||||||
|
|
||||||
```
|
|
||||||
metric
|
|
||||||
: metric_name
|
|
||||||
| metric_name '{' dimension_list '}
|
|
||||||
```
|
|
||||||
````
|
````
|
||||||
dimension_list
|
<metric>
|
||||||
: dimension
|
::= metric_name
|
||||||
| dimension ',' dimension_list
|
| metric_name '{' <dimension_list> '}'
|
||||||
````
|
|
||||||
````
|
|
||||||
dimension
|
|
||||||
: dimension_name '=' dimension_value
|
|
||||||
|
|
||||||
````
|
````
|
||||||
|
|
||||||
|
Any number of dimensions can follow the metric name.
|
||||||
|
|
||||||
|
````
|
||||||
|
<dimension_list>
|
||||||
|
::= <dimension>
|
||||||
|
| <dimension> ',' <dimension_list>
|
||||||
|
|
||||||
|
````
|
||||||
|
|
||||||
|
A dimension is simply a key-value pair.
|
||||||
|
|
||||||
|
````
|
||||||
|
<dimension>
|
||||||
|
::= dimension_name '=' dimension_value
|
||||||
|
|
||||||
|
````
|
||||||
|
|
||||||
The relational_operators are: `lt` (also `<`), `gt` (also `>`), `lte` (also `<=`), `gte` (also `>=`).
|
The relational_operators are: `lt` (also `<`), `gt` (also `>`), `lte` (also `<=`), `gte` (also `>=`).
|
||||||
|
|
||||||
|
|
||||||
|
````
|
||||||
|
<relational_operator>
|
||||||
|
::= 'lt' | '<' | 'gt' | '>' | 'lte' | '<=' | 'gte' | '>='
|
||||||
|
|
||||||
|
````
|
||||||
|
The list of available statistical functions include the following.
|
||||||
|
|
||||||
```
|
```
|
||||||
relational_operator
|
<function>
|
||||||
: 'min' | 'max' | 'sum' | 'count' | 'avg'
|
::= 'min' | 'max' | 'sum' | 'count' | 'avg'
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Threshold values are always in the same units as the metric that they are being compared to.
|
Threshold values are always in the same units as the metric that they are being compared to.
|
||||||
|
Reference in New Issue
Block a user