mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-24 21:24:05 -08:00
PromQL: Test negative offset in PromQL tests
Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
parent
b39f2739e5
commit
c2b80d8643
|
@ -613,6 +613,7 @@ func (t *Test) clear() {
|
|||
Timeout: 100 * time.Second,
|
||||
NoStepSubqueryIntervalFn: func(int64) int64 { return durationMilliseconds(1 * time.Minute) },
|
||||
EnableAtModifier: true,
|
||||
EnableNegativeOffset: true,
|
||||
}
|
||||
|
||||
t.queryEngine = NewEngine(opts)
|
||||
|
|
8
promql/testdata/at_modifier.test
vendored
8
promql/testdata/at_modifier.test
vendored
|
@ -18,6 +18,14 @@ eval instant at 10s metric offset 50s @ 100
|
|||
metric{job="1"} 5
|
||||
metric{job="2"} 10
|
||||
|
||||
eval instant at 10s metric @ 0 offset -50s
|
||||
metric{job="1"} 5
|
||||
metric{job="2"} 10
|
||||
|
||||
eval instant at 10s metric offset -50s @ 0
|
||||
metric{job="1"} 5
|
||||
metric{job="2"} 10
|
||||
|
||||
eval instant at 10s -metric @ 100
|
||||
{job="1"} -10
|
||||
{job="2"} -20
|
||||
|
|
6
promql/testdata/selectors.test
vendored
6
promql/testdata/selectors.test
vendored
|
@ -29,6 +29,12 @@ eval instant at 18000s rate(http_requests{instance!="3"}[1m] offset 10000s)
|
|||
{job="api-server", instance="0", group="canary"} 3
|
||||
{job="api-server", instance="1", group="canary"} 4
|
||||
|
||||
eval instant at 4000s rate(http_requests{instance!="3"}[1m] offset -4000s)
|
||||
{job="api-server", instance="0", group="production"} 1
|
||||
{job="api-server", instance="1", group="production"} 2
|
||||
{job="api-server", instance="0", group="canary"} 3
|
||||
{job="api-server", instance="1", group="canary"} 4
|
||||
|
||||
eval instant at 18000s rate(http_requests[40s]) - rate(http_requests[1m] offset 10000s)
|
||||
{job="api-server", instance="0", group="production"} 2
|
||||
{job="api-server", instance="1", group="production"} 1
|
||||
|
|
Loading…
Reference in a new issue