Skip to content

Commit b222625

Browse files
author
Julien Pivotto
authored
Merge pull request prometheus#11706 from dannystaple/patch-1
Docs [unit-testing]: Add an explanation to the expanding notation
2 parents ccea61c + f3f800e commit b222625

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

docs/configuration/unit_testing_rules.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,17 @@ series: <string>
7777
# This uses expanding notation.
7878
# Expanding notation:
7979
# 'a+bxc' becomes 'a a+b a+(2*b) a+(3*b) … a+(c*b)'
80+
# Read this as series starts at a, then c further samples incrementing by b.
8081
# 'a-bxc' becomes 'a a-b a-(2*b) a-(3*b) … a-(c*b)'
82+
# Read this as series starts at a, then c further samples decrementing by b (or incrementing by negative b).
8183
# There are special values to indicate missing and stale samples:
8284
# '_' represents a missing sample from scrape
8385
# 'stale' indicates a stale sample
8486
# Examples:
85-
# 1. '-2+4x3' becomes '-2 2 6 10'
86-
# 2. ' 1-2x4' becomes '1 -1 -3 -5 -7'
87-
# 3. ' 1 _x3 stale' becomes '1 _ _ _ stale'
87+
# 1. '-2+4x3' becomes '-2 2 6 10' - series starts at -2, then 3 further samples incrementing by 4.
88+
# 2. ' 1-2x4' becomes '1 -1 -3 -5 -7' - series starts at 1, then 4 further samples decrementing by 2.
89+
# 3. ' 1x4' becomes '1 1 1 1 1' - shorthand for '1+0x4', series starts at 1, then 4 further samples incrementing by 0.
90+
# 4. ' 1 _x3 stale' becomes '1 _ _ _ stale' - the missing sample cannot increment, so 3 missing samples are produced by the '_x3' expression.
8891
values: <string>
8992
```
9093

0 commit comments

Comments
 (0)