Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 1.76 KB

01.range_expressions.md

File metadata and controls

31 lines (25 loc) · 1.76 KB

Range expressions

In many cases thresholds for metrics mark a certain range of values where the values is considered to be good or bad if it is inside or outside. While for significant number of metrics a upper (e.g. load on unixoid systems) or lower (e.g. effective throughput, free space in memory or storage) border might suffice, for some it does not, for example a temperature value from a temperature sensor should be within certain range (let's say 10℃ and 45℃).

Regarding input parameters this might be handled with with options like --critical-upper-temperature and --critical-lower-temperature, this presents a problem with the performance data, if only scalar values could be used. To resolve this situation the Range expression format was introduced, with the following definition:

[@][start:][end] where:

  1. start <= end
  2. If start == 0, then it can be omitted.
  3. If end is omitted, it has the "value" of positive infinity.
  4. Negative infinity can be specified with ~.
  5. If the prefix @ is NOT given, the value exceeds the threshold if it is OUTSIDE of the range between start and end (including the endpoints).
  6. If the prefix @ IS given, the value exceeds the threshold if it is INSIDE the range between start and end (including the endpoints).
  7. Contrary to the short definition above, an empty Range expression is not a valid one, at least either start or end must be provided.

Examples

Range definition Exceeds threshold if x...
10 < 0 or > 10, (outside the range of {0 .. 10})
10: < 10, (outside {10 .. ∞})
~:10 > 10, (outside the range of {-∞ .. 10})
10:20 < 10 or > 20, (outside the range of {10 .. 20})
@10:20 ≥ 10 and ≤ 20, (inside the range of {10 .. 20})