PromQL: Adds tests for delta with histograms ()

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:
Neeraj Gartia 2024-12-20 04:22:26 +05:30 committed by GitHub
parent 0e99ca3e8c
commit 8d5236f927
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -234,11 +234,25 @@ clear
load 5m load 5m
http_requests{path="/foo"} 0 50 100 150 200 http_requests{path="/foo"} 0 50 100 150 200
http_requests{path="/bar"} 200 150 100 50 0 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]) eval instant at 20m delta(http_requests[20m])
{path="/foo"} 200 {path="/foo"} 200
{path="/bar"} -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 clear
# Tests for idelta(). # Tests for idelta().