From 300d6e43901e0fbca1b618ea64b5978217e54b10 Mon Sep 17 00:00:00 2001 From: Danny Staple Date: Tue, 13 Dec 2022 11:11:13 +0000 Subject: [PATCH 1/5] Add an explanation to the expanding notation After some team discussion, we found this to be a useful was to explain the samples. Signed-off-by: Danny Staple --- docs/configuration/unit_testing_rules.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/configuration/unit_testing_rules.md b/docs/configuration/unit_testing_rules.md index d99255f01..1f69dd32d 100644 --- a/docs/configuration/unit_testing_rules.md +++ b/docs/configuration/unit_testing_rules.md @@ -77,13 +77,15 @@ series: # This uses expanding notation. # Expanding notation: # 'a+bxc' becomes 'a a+b a+(2*b) a+(3*b) … a+(c*b)' +# Read this as series starts at a, then c further samples incrementing by b. # 'a-bxc' becomes 'a a-b a-(2*b) a-(3*b) … a-(c*b)' +# Read this as series starts at a, then c further samples decrementing by b (or incrementing by negative b). # There are special values to indicate missing and stale samples: # '_' represents a missing sample from scrape # 'stale' indicates a stale sample # Examples: -# 1. '-2+4x3' becomes '-2 2 6 10' -# 2. ' 1-2x4' becomes '1 -1 -3 -5 -7' +# 1. '-2+4x3' becomes '-2 2 6 10' - series starts at -2, then 3 further samples incrementing by 4. +# 2. ' 1-2x4' becomes '1 -1 -3 -5 -7' - series starts at 1, then 4 further samples decrementing by 2. # 3. ' 1 _x3 stale' becomes '1 _ _ _ stale' values: ``` From b614fdd8a7f453f9d81342f2f515681ec227707a Mon Sep 17 00:00:00 2001 From: Danny Staple Date: Tue, 13 Dec 2022 15:52:40 +0000 Subject: [PATCH 2/5] Update unit_testing_rules.md Update the shorthand, and note the different behaviour between missing samples and numbers. Signed-off-by: Danny Staple --- docs/configuration/unit_testing_rules.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/configuration/unit_testing_rules.md b/docs/configuration/unit_testing_rules.md index 1f69dd32d..44a61fb30 100644 --- a/docs/configuration/unit_testing_rules.md +++ b/docs/configuration/unit_testing_rules.md @@ -86,7 +86,8 @@ series: # Examples: # 1. '-2+4x3' becomes '-2 2 6 10' - series starts at -2, then 3 further samples incrementing by 4. # 2. ' 1-2x4' becomes '1 -1 -3 -5 -7' - series starts at 1, then 4 further samples decrementing by 2. -# 3. ' 1 _x3 stale' becomes '1 _ _ _ stale' +# 3. ' 1x4' become '1 1 1 1' - shorthand for '1+0x4', series starts at 1, then 3 further samples incrementing by 0. +# 4. ' 1 _x3 stale' becomes '1 _ _ _ stale' - the missing sample cannot increment, so only 3 samples are produced by the '_x3' expression. values: ``` From 87b9f1d24a6e89dd7d43dc57f97c2a1246d9d818 Mon Sep 17 00:00:00 2001 From: Danny Staple Date: Wed, 14 Dec 2022 12:20:28 +0000 Subject: [PATCH 3/5] Fix typo I introduced in unit testing rules. Signed-off-by: Danny Staple --- docs/configuration/unit_testing_rules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration/unit_testing_rules.md b/docs/configuration/unit_testing_rules.md index 44a61fb30..d992678cd 100644 --- a/docs/configuration/unit_testing_rules.md +++ b/docs/configuration/unit_testing_rules.md @@ -86,7 +86,7 @@ series: # Examples: # 1. '-2+4x3' becomes '-2 2 6 10' - series starts at -2, then 3 further samples incrementing by 4. # 2. ' 1-2x4' becomes '1 -1 -3 -5 -7' - series starts at 1, then 4 further samples decrementing by 2. -# 3. ' 1x4' become '1 1 1 1' - shorthand for '1+0x4', series starts at 1, then 3 further samples incrementing by 0. +# 3. ' 1x4' becomes '1 1 1 1' - shorthand for '1+0x4', series starts at 1, then 3 further samples incrementing by 0. # 4. ' 1 _x3 stale' becomes '1 _ _ _ stale' - the missing sample cannot increment, so only 3 samples are produced by the '_x3' expression. values: ``` From 7269a6e21a3718cd73bb975a75600086734bd16c Mon Sep 17 00:00:00 2001 From: Danny Staple Date: Wed, 14 Dec 2022 12:21:34 +0000 Subject: [PATCH 4/5] Fix the output example (based on empirical unit testing) Signed-off-by: Danny Staple --- docs/configuration/unit_testing_rules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration/unit_testing_rules.md b/docs/configuration/unit_testing_rules.md index d992678cd..6d0725f19 100644 --- a/docs/configuration/unit_testing_rules.md +++ b/docs/configuration/unit_testing_rules.md @@ -86,7 +86,7 @@ series: # Examples: # 1. '-2+4x3' becomes '-2 2 6 10' - series starts at -2, then 3 further samples incrementing by 4. # 2. ' 1-2x4' becomes '1 -1 -3 -5 -7' - series starts at 1, then 4 further samples decrementing by 2. -# 3. ' 1x4' becomes '1 1 1 1' - shorthand for '1+0x4', series starts at 1, then 3 further samples incrementing by 0. +# 3. ' 1x4' becomes '1 1 1 1 1' - shorthand for '1+0x4', series starts at 1, then 4 further samples incrementing by 0. # 4. ' 1 _x3 stale' becomes '1 _ _ _ stale' - the missing sample cannot increment, so only 3 samples are produced by the '_x3' expression. values: ``` From f3f800ea6f8e601cba27bd265dfe3f4955d7a911 Mon Sep 17 00:00:00 2001 From: Danny Staple Date: Thu, 15 Dec 2022 16:22:40 +0000 Subject: [PATCH 5/5] Terminology amendment Signed-off-by: Danny Staple --- docs/configuration/unit_testing_rules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration/unit_testing_rules.md b/docs/configuration/unit_testing_rules.md index 6d0725f19..efd168b35 100644 --- a/docs/configuration/unit_testing_rules.md +++ b/docs/configuration/unit_testing_rules.md @@ -87,7 +87,7 @@ series: # 1. '-2+4x3' becomes '-2 2 6 10' - series starts at -2, then 3 further samples incrementing by 4. # 2. ' 1-2x4' becomes '1 -1 -3 -5 -7' - series starts at 1, then 4 further samples decrementing by 2. # 3. ' 1x4' becomes '1 1 1 1 1' - shorthand for '1+0x4', series starts at 1, then 4 further samples incrementing by 0. -# 4. ' 1 _x3 stale' becomes '1 _ _ _ stale' - the missing sample cannot increment, so only 3 samples are produced by the '_x3' expression. +# 4. ' 1 _x3 stale' becomes '1 _ _ _ stale' - the missing sample cannot increment, so 3 missing samples are produced by the '_x3' expression. values: ```