2015-05-26 10:01:34 -07:00
|
|
|
# Testdata for resets() and changes().
|
2015-05-26 08:47:52 -07:00
|
|
|
load 5m
|
|
|
|
http_requests{path="/foo"} 1 2 3 0 1 0 0 1 2 0
|
|
|
|
http_requests{path="/bar"} 1 2 3 4 5 1 2 3 4 5
|
2015-05-26 10:01:34 -07:00
|
|
|
http_requests{path="/biz"} 0 0 0 0 0 1 1 1 1 1
|
2015-05-26 08:47:52 -07:00
|
|
|
|
2015-05-26 10:01:34 -07:00
|
|
|
# Tests for resets().
|
2015-05-26 08:47:52 -07:00
|
|
|
eval instant at 50m resets(http_requests[5m])
|
|
|
|
{path="/foo"} 0
|
|
|
|
{path="/bar"} 0
|
2015-05-26 10:01:34 -07:00
|
|
|
{path="/biz"} 0
|
2015-05-26 08:47:52 -07:00
|
|
|
|
|
|
|
eval instant at 50m resets(http_requests[20m])
|
|
|
|
{path="/foo"} 1
|
|
|
|
{path="/bar"} 0
|
2015-05-26 10:01:34 -07:00
|
|
|
{path="/biz"} 0
|
2015-05-26 08:47:52 -07:00
|
|
|
|
|
|
|
eval instant at 50m resets(http_requests[30m])
|
|
|
|
{path="/foo"} 2
|
|
|
|
{path="/bar"} 1
|
2015-05-26 10:01:34 -07:00
|
|
|
{path="/biz"} 0
|
2015-05-26 08:47:52 -07:00
|
|
|
|
|
|
|
eval instant at 50m resets(http_requests[50m])
|
|
|
|
{path="/foo"} 3
|
|
|
|
{path="/bar"} 1
|
2015-05-26 10:01:34 -07:00
|
|
|
{path="/biz"} 0
|
2015-05-26 08:47:52 -07:00
|
|
|
|
|
|
|
eval instant at 50m resets(nonexistent_metric[50m])
|
2015-05-26 10:01:34 -07:00
|
|
|
|
|
|
|
# Tests for changes().
|
|
|
|
eval instant at 50m changes(http_requests[5m])
|
|
|
|
{path="/foo"} 0
|
|
|
|
{path="/bar"} 0
|
|
|
|
{path="/biz"} 0
|
|
|
|
|
|
|
|
eval instant at 50m changes(http_requests[20m])
|
|
|
|
{path="/foo"} 3
|
|
|
|
{path="/bar"} 3
|
|
|
|
{path="/biz"} 0
|
|
|
|
|
|
|
|
eval instant at 50m changes(http_requests[30m])
|
|
|
|
{path="/foo"} 4
|
|
|
|
{path="/bar"} 5
|
|
|
|
{path="/biz"} 1
|
|
|
|
|
|
|
|
eval instant at 50m changes(http_requests[50m])
|
|
|
|
{path="/foo"} 8
|
|
|
|
{path="/bar"} 9
|
|
|
|
{path="/biz"} 1
|
|
|
|
|
|
|
|
eval instant at 50m changes(nonexistent_metric[50m])
|
2015-05-24 11:48:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
clear
|
|
|
|
|
|
|
|
# Tests for increase().
|
|
|
|
load 5m
|
|
|
|
http_requests{path="/foo"} 0+10x10
|
|
|
|
http_requests{path="/bar"} 0+10x5 0+10x5
|
|
|
|
|
|
|
|
# Tests for increase().
|
|
|
|
eval instant at 50m increase(http_requests[50m])
|
|
|
|
{path="/foo"} 100
|
|
|
|
{path="/bar"} 90
|