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