mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
adds tests for sum_over_time and avg_over_time
Signed-off-by: Neeraj Gartia <neerajgartia211002@gmail.com>
This commit is contained in:
parent
6ede900506
commit
21afc0beb4
19
promql/promqltest/testdata/functions.test
vendored
19
promql/promqltest/testdata/functions.test
vendored
|
@ -810,6 +810,8 @@ load 10s
|
||||||
metric9 -9.988465674311579e+307 -9.988465674311579e+307 -9.988465674311579e+307
|
metric9 -9.988465674311579e+307 -9.988465674311579e+307 -9.988465674311579e+307
|
||||||
metric10 -9.988465674311579e+307 9.988465674311579e+307
|
metric10 -9.988465674311579e+307 9.988465674311579e+307
|
||||||
metric11 1 2 3 NaN NaN
|
metric11 1 2 3 NaN NaN
|
||||||
|
metric12 1 2 3 {{schema:0 sum:1 count:1}} {{schema:0 sum:3 count:3}}
|
||||||
|
metric13 {{schema:0 sum:1 count:1}}x5
|
||||||
|
|
||||||
eval instant at 55s avg_over_time(metric[1m])
|
eval instant at 55s avg_over_time(metric[1m])
|
||||||
{} 3
|
{} 3
|
||||||
|
@ -916,6 +918,23 @@ eval instant at 1m avg_over_time(metric11[1m])
|
||||||
eval instant at 1m sum_over_time(metric11[1m])/count_over_time(metric11[1m])
|
eval instant at 1m sum_over_time(metric11[1m])/count_over_time(metric11[1m])
|
||||||
{} NaN
|
{} NaN
|
||||||
|
|
||||||
|
# Tests for samples with mix of floats and histograms.
|
||||||
|
eval_warn instant at 1m sum_over_time(metric12[1m])
|
||||||
|
# no result.
|
||||||
|
|
||||||
|
eval_warn instant at 1m avg_over_time(metric12[1m])
|
||||||
|
# no result.
|
||||||
|
|
||||||
|
# Tests for samples with only histograms.
|
||||||
|
eval instant at 1m sum_over_time(metric13[1m])
|
||||||
|
{} {{schema:0 sum:5 count:5}}
|
||||||
|
|
||||||
|
eval instant at 1m avg_over_time(metric13[1m])
|
||||||
|
{} {{schema:0 sum:1 count:1}}
|
||||||
|
|
||||||
|
eval instant at 1m sum_over_time(metric13[1m])/count_over_time(metric13[1m])
|
||||||
|
{} {{schema:0 sum:1 count:1}}
|
||||||
|
|
||||||
# Test if very big intermediate values cause loss of detail.
|
# Test if very big intermediate values cause loss of detail.
|
||||||
clear
|
clear
|
||||||
load 10s
|
load 10s
|
||||||
|
|
Loading…
Reference in a new issue