-
Notifications
You must be signed in to change notification settings - Fork 557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MQE: Add support for resets function #9859
Changes from 8 commits
00d38f0
36c7e36
15e534e
745d7dd
6a32ae6
8d1f02a
03fc64b
08264fe
ee95dfc
647feb3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -460,3 +460,68 @@ load 6m | |
|
||
eval range from 0 to 96m step 6m round(series, scalar(toNearest)) | ||
{a="b"} -5 2.7 0.5 20 10 3.25 0 1000.01 0 -1000000 NaN NaN NaN NaN _ _ 10 | ||
|
||
clear | ||
|
||
# Testing resets | ||
load 1m | ||
simple_metric_all_same_no_reset{num="0"} 0 0 0 0 0 0 0 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nit] It might be clearer to change these series to use labels like these:
This would make the cases clearer given we can use full English phrases. Then the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refactored the test in 647feb3 |
||
simple_metric_all_same_no_reset{num="3"} 3 3 3 3 3 3 3 3 | ||
simple_metric_no_reset{foo="bar"} 0 1 2 3 _ 5 6 _ | ||
simple_metric_has_reset{foo="bar"} 0 1 2 3 2 1 0 _ | ||
some_inf_and_nan_metric{foo="bar"} Inf 1 2 3 NaN Inf Inf NaN 100 10 8 7 7 6 | ||
hist_metric_no_reset{foo="bar"} {{schema:3 sum:0 count:0 buckets:[1 2 1]}} {{schema:3 sum:0 count:0 buckets:[1 2 1]}} | ||
hist_metric_has_reset_count_decrease{foo="bar"} {{schema:3 sum:0 count:2 buckets:[1 2 1]}} {{schema:3 sum:0 count:1 buckets:[1 2 1]}} | ||
hist_metric_has_reset_bucket_decrease{foo="bar"} {{schema:3 sum:0 count:2 buckets:[1 2 1]}} {{schema:3 sum:0 count:1 buckets:[1 2 1]}} {{schema:3 sum:0 count:1 buckets:[1 0 1]}} | ||
hist_metric_no_reset_for_sum_decrease{foo="bar"} {{schema:3 sum:3 count:2 buckets:[1 2 1]}} {{schema:3 sum:0 count:2 buckets:[1 2 1]}} | ||
hist_metric_has_reset_with_schema_increase{foo="bar"} {{schema:3 sum:0 count:2 buckets:[1 2 1]}} {{schema:4 sum:0 count:2 buckets:[1 2 1]}} | ||
hist_metric_mix_float{foo="bar"} 9 1 2 3 _ _ {{schema:3 sum:4 count:4 buckets:[1 2 1]}} {{schema:3 sum:5 count:3 buckets:[2 5 4]}} | ||
nhcb_metric_no_reset{foo="bar"} {{schema:-53 sum:1 count:5 custom_values:[5 10] buckets:[1 4]}} {{schema:-53 sum:1 count:5 custom_values:[5 10] buckets:[1 4]}} {{schema:-53 sum:1 count:5 custom_values:[5 10] buckets:[1 4]}} | ||
nhcb_metric_has_reset{foo="bar"} {{schema:-53 sum:1 count:5 custom_values:[5 10] buckets:[1 4]}} {{schema:-53 sum:15 count:2 custom_values:[5 10] buckets:[0 2]}} {{schema:-53 sum:3 count:15 custom_values:[5 10] buckets:[7 8]}} {{schema:-53 sum:3 count:15 custom_values:[5 10] buckets:[0 0]}} | ||
mixed_all_has_reset{foo="bar"} 0 1 2 3 2 1 0 _ {{schema:3 sum:0 count:2 buckets:[1 2 1]}} {{schema:3 sum:0 count:1 buckets:[1 2 1]}} {{schema:3 sum:0 count:1 buckets:[1 0 1]}} {{schema:-53 sum:1 count:5 custom_values:[5 10] buckets:[1 4]}} {{schema:-53 sum:15 count:2 custom_values:[5 10] buckets:[0 2]}} {{schema:-53 sum:3 count:15 custom_values:[5 10] buckets:[7 8]}} {{schema:-53 sum:3 count:15 custom_values:[5 10] buckets:[0 0]}} | ||
|
||
eval range from 0 to 8m step 1m resets(simple_metric_all_same_no_reset{num="0"}[3m]) | ||
{num="0"} 0 0 0 0 0 0 0 0 0 | ||
|
||
eval range from 0 to 8m step 1m resets(simple_metric_all_same_no_reset{num="3"}[3m]) | ||
{num="3"} 0 0 0 0 0 0 0 0 0 | ||
|
||
eval range from 0 to 8m step 1m resets(simple_metric_all_same_no_reset[3m]) | ||
{num="0"} 0 0 0 0 0 0 0 0 0 | ||
{num="3"} 0 0 0 0 0 0 0 0 0 | ||
|
||
eval range from 0 to 8m step 1m resets(simple_metric_no_reset[3m]) | ||
{foo="bar"} 0 0 0 0 0 0 0 0 0 | ||
|
||
eval range from 0 to 8m step 1m resets(simple_metric_has_reset[3m]) | ||
{foo="bar"} 0 0 0 0 1 2 3 2 1 | ||
|
||
eval range from 0 to 15m step 1m resets(some_inf_and_nan_metric[3m]) | ||
{foo="bar"} 0 1 1 1 0 0 0 0 0 1 2 3 2 2 1 1 | ||
|
||
eval range from 0 to 8m step 1m resets(hist_metric_no_reset[3m]) | ||
{foo="bar"} 0 0 0 0 0 | ||
|
||
eval range from 0 to 8m step 1m resets(hist_metric_has_reset_count_decrease[3m]) | ||
{foo="bar"} 0 1 1 1 0 | ||
|
||
eval range from 0 to 8m step 1m resets(hist_metric_has_reset_bucket_decrease[3m]) | ||
{foo="bar"} 0 1 2 2 1 0 | ||
|
||
eval range from 0 to 8m step 1m resets(hist_metric_no_reset_for_sum_decrease[3m]) | ||
{foo="bar"} 0 0 0 0 0 | ||
|
||
eval range from 0 to 8m step 1m resets(hist_metric_has_reset_with_schema_increase[3m]) | ||
{foo="bar"} 0 1 1 1 0 | ||
|
||
eval range from 0 to 8m step 1m resets(hist_metric_mix_float[3m]) | ||
{foo="bar"} 0 1 1 1 0 0 0 1 1 | ||
|
||
eval range from 0 to 8m step 1m resets(nhcb_metric_no_reset[3m]) | ||
{foo="bar"} 0 0 0 0 0 0 | ||
|
||
eval range from 0 to 8m step 1m resets(nhcb_metric_has_reset[3m]) | ||
{foo="bar"} 0 1 1 2 1 1 0 | ||
|
||
eval range from 0 to 20m step 1m resets(mixed_all_has_reset[3m]) | ||
{foo="bar"} 0 0 0 0 1 2 3 2 1 1 2 3 3 2 2 1 1 0 |
lamida marked this conversation as resolved.
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] The head slice will always be populated if there are any points, so we could drop the
len(xTail)
checks.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied from
xOverTime
function 😆 . Such as. So this means, we can drop tail check there too, right? Maybe we can do it in another PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, we can drop it there too, and I'm happy for you to do that in another PR.