forked from prometheus/prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request prometheus#14305 from charleskorn/charleskorn/conv…
…ert-range-query-tests promql: Convert more test cases to test scripting language
- Loading branch information
Showing
3 changed files
with
81 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# sum_over_time with all values | ||
load 30s | ||
bar 0 1 10 100 1000 | ||
|
||
eval range from 0 to 2m step 1m sum_over_time(bar[30s]) | ||
{} 0 11 1100 | ||
|
||
clear | ||
|
||
# sum_over_time with trailing values | ||
load 30s | ||
bar 0 1 10 100 1000 0 0 0 0 | ||
|
||
eval range from 0 to 2m step 1m sum_over_time(bar[30s]) | ||
{} 0 11 1100 | ||
|
||
clear | ||
|
||
# sum_over_time with all values long | ||
load 30s | ||
bar 0 1 10 100 1000 10000 100000 1000000 10000000 | ||
|
||
eval range from 0 to 4m step 1m sum_over_time(bar[30s]) | ||
{} 0 11 1100 110000 11000000 | ||
|
||
clear | ||
|
||
# sum_over_time with all values random | ||
load 30s | ||
bar 5 17 42 2 7 905 51 | ||
|
||
eval range from 0 to 3m step 1m sum_over_time(bar[30s]) | ||
{} 5 59 9 956 | ||
|
||
clear | ||
|
||
# metric query | ||
load 30s | ||
metric 1+1x4 | ||
|
||
eval range from 0 to 2m step 1m metric | ||
metric 1 3 5 | ||
|
||
clear | ||
|
||
# metric query with trailing values | ||
load 30s | ||
metric 1+1x8 | ||
|
||
eval range from 0 to 2m step 1m metric | ||
metric 1 3 5 | ||
|
||
clear | ||
|
||
# short-circuit | ||
load 30s | ||
foo{job="1"} 1+1x4 | ||
bar{job="2"} 1+1x4 | ||
|
||
eval range from 0 to 2m step 1m foo > 2 or bar | ||
foo{job="1"} _ 3 5 | ||
bar{job="2"} 1 3 5 | ||
|
||
clear | ||
|
||
# Drop metric name | ||
load 30s | ||
requests{job="1", __address__="bar"} 100 | ||
|
||
eval range from 0 to 2m step 1m requests * 2 | ||
{job="1", __address__="bar"} 200 200 200 | ||
|
||
clear |