1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
Feature: Test tester
Scenario: "Simple query works"
Given the following series:
| metrics | values |
| node_network_receive_bytes{instance="127.0.0.1", device="eth1"} | 10 100 |
| node_network_receive_bytes{instance="127.0.0.1", device="eth2"} | 10 100 |
| node_network_transmit_bytes{instance="127.0.0.1", device="eth1"} | 10 100 |
| node_network_transmit_bytes{instance="127.0.0.1", device="eth2"} | 10 100 |
| node_network_transmit_bytes{instance="192.168.100.2", device="bond0"} | 20 200 |
| node_network_transmit_bytes{instance="192.168.100.1", device="bond0"} | 20 200 |
| bonding_slaves{instance="127.0.0.1", master="bond0"} | 2 |
Then query `node_network_transmit_bytes{instance="127.0.0.1"} > 0` produces:
| metrics | values |
| node_network_transmit_bytes{instance="127.0.0.1", device="eth1"} | 100 |
| node_network_transmit_bytes{instance="127.0.0.1", device="eth2"} | 100 |
Scenario: "Query with evaluation time"
Given the following series:
| metrics | values |
| node_network_receive_bytes{instance="127.0.0.1", device="eth1"} | 10 100 |
| node_network_receive_bytes{instance="127.0.0.1", device="eth2"} | 10 100 |
| node_network_transmit_bytes{instance="127.0.0.1", device="eth1"} | 10 100 |
| node_network_transmit_bytes{instance="127.0.0.1", device="eth2"} | 10 100 |
| node_network_transmit_bytes{instance="192.168.100.2", device="bond0"} | 20 200 |
| node_network_transmit_bytes{instance="192.168.100.1", device="bond0"} | 20 200 |
| bonding_slaves{instance="127.0.0.1", master="bond0"} | 2 |
When evaluation time is `0m`
Then query `node_network_transmit_bytes{instance="127.0.0.1"} > 0` produces:
| metrics | values |
| node_network_transmit_bytes{instance="127.0.0.1", device="eth1"} | 10 |
| node_network_transmit_bytes{instance="127.0.0.1", device="eth2"} | 10 |
Scenario: "Query with evaluation time and variable value"
Given the following series:
| metrics | values |
| node_network_receive_bytes{instance="127.0.0.1", device="eth1"} | 10 100 |
| node_network_receive_bytes{instance="127.0.0.1", device="eth2"} | 10 100 |
| node_network_transmit_bytes{instance="127.0.0.1", device="eth1"} | 10 100 |
| node_network_transmit_bytes{instance="127.0.0.1", device="eth2"} | 10 100 |
| node_network_transmit_bytes{instance="192.168.100.2", device="bond0"} | 20 200 |
| node_network_transmit_bytes{instance="192.168.100.1", device="bond0"} | 20 200 |
| bonding_slaves{instance="127.0.0.1", master="bond0"} | 2 |
When evaluation time is `0m`
And variable `osd_hosts` is `127.0.0.1`
Then query `node_network_transmit_bytes{instance="$osd_hosts"} > 0` produces:
| metrics | values |
| node_network_transmit_bytes{instance="127.0.0.1", device="eth1"} | 10 |
| node_network_transmit_bytes{instance="127.0.0.1", device="eth2"} | 10 |
Scenario: "Query with interval time"
Given the following series:
| metrics | values |
| node_network_receive_bytes{instance="127.0.0.1", device="eth1"} | 10 100 200 |
| node_network_receive_bytes{instance="127.0.0.1", device="eth2"} | 10 100 200 |
| node_network_transmit_bytes{instance="127.0.0.1", device="eth1"} | 10 100 200 |
| node_network_transmit_bytes{instance="127.0.0.1", device="eth2"} | 10 100 200 |
| node_network_transmit_bytes{instance="192.168.100.2", device="bond0"} | 20 200 300 |
| node_network_transmit_bytes{instance="192.168.100.1", device="bond0"} | 20 200 300 |
| bonding_slaves{instance="127.0.0.1", master="bond0"} | 2 |
When evaluation time is `2h`
And evaluation interval is `1h`
And interval is `1h`
And variable `osd_hosts` is `127.0.0.1`
Then query `node_network_transmit_bytes{instance="$osd_hosts"} > 0` produces:
| metrics | values |
| node_network_transmit_bytes{instance="127.0.0.1", device="eth1"} | 200 |
| node_network_transmit_bytes{instance="127.0.0.1", device="eth2"} | 200 |
|