mirror of
https://github.com/prometheus/prometheus
synced 2025-05-01 07:38:26 +00:00
PromQL: Adds tests for delta
with histograms (#15674)
PromQL: Adds tests for delta with histograms Signed-off-by: Neeraj Gartia <neerajgartia211002@gmail.com> -------- Signed-off-by: Neeraj Gartia <neerajgartia211002@gmail.com>
This commit is contained in:
parent
0e99ca3e8c
commit
8d5236f927
14
promql/promqltest/testdata/functions.test
vendored
14
promql/promqltest/testdata/functions.test
vendored
@ -234,11 +234,25 @@ clear
|
||||
load 5m
|
||||
http_requests{path="/foo"} 0 50 100 150 200
|
||||
http_requests{path="/bar"} 200 150 100 50 0
|
||||
http_requests_gauge{path="/foo"} {{schema:0 sum:0 count:0 buckets:[0 0 0] counter_reset_hint:gauge}}+{{schema:0 sum:1 count:2 buckets:[1 1 1] counter_reset_hint:gauge}}x5
|
||||
http_requests_counter{path="/foo"} {{schema:0 sum:0 count:0 buckets:[0 0 0]}}+{{schema:0 sum:1 count:2 buckets:[1 1 1]}}x5
|
||||
http_requests_mix{path="/foo"} 0 50 100 {{schema:0 sum:0 count:0 buckets:[0 0 0] counter_reset_hint:gauge}} {{schema:0 sum:1 count:2 buckets:[1 1 1] counter_reset_hint:gauge}}
|
||||
|
||||
eval instant at 20m delta(http_requests[20m])
|
||||
{path="/foo"} 200
|
||||
{path="/bar"} -200
|
||||
|
||||
eval instant at 20m delta(http_requests_gauge[20m])
|
||||
{path="/foo"} {{schema:0 sum:4 count:8 buckets:[4 4 4]}}
|
||||
|
||||
# delta emits warn annotation for non-gauge histogram types.
|
||||
eval_warn instant at 20m delta(http_requests_counter[20m])
|
||||
{path="/foo"} {{schema:0 sum:4 count:8 buckets:[4 4 4]}}
|
||||
|
||||
# delta emits warn annotation for mix of histogram and floats.
|
||||
eval_warn instant at 20m delta(http_requests_mix[20m])
|
||||
#empty
|
||||
|
||||
clear
|
||||
|
||||
# Tests for idelta().
|
||||
|
Loading…
Reference in New Issue
Block a user