Skip to content

Commit 7957c41

Browse files
committed
tests for rate function in csv. first commit
1 parent 3ccb52d commit 7957c41

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
rate_of_long_no_grouping
2+
TS k8s
3+
| STATS rate_bytes_in=avg(rate(network.total_bytes_in)) BY time_bucket = bucket(@timestamp,1minute)
4+
| SORT rate_bytes_in DESC, time_bucket DESC | LIMIT 10;
5+
6+
rate_bytes_in:double | time_bucket:datetime
7+
null | 2024-05-10T00:01:00.000Z
8+
28.80297619047619 | 2024-05-10T00:15:00.000Z
9+
25.422222222222224 | 2024-05-10T00:04:00.000Z
10+
24.28946078431372 | 2024-05-10T00:19:00.000Z
11+
24.05555555555555 | 2024-05-10T00:10:00.000Z
12+
22.546794871794873 | 2024-05-10T00:13:00.000Z
13+
21.039819662685943 | 2024-05-10T00:17:00.000Z
14+
20.420667304320105 | 2024-05-10T00:18:00.000Z
15+
19.745833333333334 | 2024-05-10T00:00:00.000Z
16+
19.4 | 2024-05-10T00:14:00.000Z
17+
;
18+
19+
rate_of_long_grouping
20+
TS k8s
21+
| STATS rate_bytes_in=avg(rate(network.total_bytes_in)) BY cluster, time_bucket = bucket(@timestamp,5minute)
22+
| SORT rate_bytes_in DESC, time_bucket, cluster | LIMIT 10;
23+
24+
rate_bytes_in:double | cluster:keyword | time_bucket:datetime
25+
15.025267167998313 | qa | 2024-05-10T00:15:00.000Z
26+
13.638384356589611 | qa | 2024-05-10T00:05:00.000Z
27+
11.761724575728252 | prod | 2024-05-10T00:15:00.000Z
28+
7.453275209904956 | qa | 2024-05-10T00:10:00.000Z
29+
7.307225056633641 | staging | 2024-05-10T00:05:00.000Z
30+
7.203958127639015 | prod | 2024-05-10T00:10:00.000Z
31+
6.34494062999877 | staging | 2024-05-10T00:10:00.000Z
32+
5.700488689624205 | prod | 2024-05-10T00:20:00.000Z
33+
5.4539153439153445 | prod | 2024-05-10T00:00:00.000Z
34+
5.241187469367376 | staging | 2024-05-10T00:00:00.000Z
35+
36+
;
37+
38+
rate_of_double_no_grouping
39+
TS k8s
40+
| STATS rate_cost=sum(rate(network.total_cost)) BY time_bucket = bucket(@timestamp,1minute)
41+
| SORT rate_cost DESC, time_bucket | LIMIT 10;
42+
43+
rate_cost:double | time_bucket:datetime
44+
null | 2024-05-10T00:01:00.000Z
45+
1.7945690883190881 | 2024-05-10T00:09:00.000Z
46+
1.0657479136112855 | 2024-05-10T00:17:00.000Z
47+
0.7229258685181391 | 2024-05-10T00:18:00.000Z
48+
0.696875 | 2024-05-10T00:13:00.000Z
49+
0.6763888888888887 | 2024-05-10T00:08:00.000Z
50+
0.6425595238095237 | 2024-05-10T00:06:00.000Z
51+
0.5818946678321678 | 2024-05-10T00:20:00.000Z
52+
0.5125 | 2024-05-10T00:11:00.000Z
53+
0.500297619047619 | 2024-05-10T00:15:00.000Z
54+
55+
;
56+
57+
rate_with_filtering
58+
TS k8s | WHERE pod == "one"
59+
| STATS rate_bytes_in = sum(rate(network.total_bytes_in)) BY cluster, time_bucket = bucket(@timestamp, 10minute)
60+
| SORT time_bucket, cluster | LIMIT 10;
61+
62+
rate_bytes_in:double | cluster:keyword | time_bucket:datetime
63+
4.0314581958195825 | prod | 2024-05-10T00:00:00.000Z
64+
9.955833333333333 | qa | 2024-05-10T00:00:00.000Z
65+
4.242445473251029 | staging | 2024-05-10T00:00:00.000Z
66+
11.188380281690138 | prod | 2024-05-10T00:10:00.000Z
67+
12.222592592592592 | qa | 2024-05-10T00:10:00.000Z
68+
3.050371490280777 | staging | 2024-05-10T00:10:00.000Z
69+
2.210158359293873 | prod | 2024-05-10T00:20:00.000Z
70+
0.8955555555555565 | qa | 2024-05-10T00:20:00.000Z
71+
0.595 | staging | 2024-05-10T00:20:00.000Z
72+
73+
;
74+
75+
eval_on_rate
76+
TS k8s
77+
| STATS rate_bytes = avg(rate(network.total_bytes_in)) BY cluster, time_bucket = bucket(@timestamp, 10minute)
78+
| EVAL rate_kb = rate_bytes / 1024.0
79+
| LIMIT 10 | SORT time_bucket, cluster ;
80+
81+
rate_bytes:double | cluster:keyword | time_bucket:datetime | rate_kb:double
82+
4.489054151267086 | prod | 2024-05-10T00:00:00.000Z | 0.004383841944596764
83+
9.933630806480615 | qa | 2024-05-10T00:00:00.000Z | 0.009700811334453725
84+
6.2165285757677635 | staging | 2024-05-10T00:00:00.000Z | 0.0060708286872732066
85+
9.435761829894686 | prod | 2024-05-10T00:10:00.000Z | 0.009214611162006529
86+
11.21976172297114 | qa | 2024-05-10T00:10:00.000Z | 0.010956798557589005
87+
5.861581261551023 | staging | 2024-05-10T00:10:00.000Z | 0.005724200450733421
88+
2.8502443448121024 | prod | 2024-05-10T00:20:00.000Z | 0.0027834417429805688
89+
1.4602777777777782 | qa | 2024-05-10T00:20:00.000Z | 0.0014260525173611116
90+
1.1196474788041055 | staging | 2024-05-10T00:20:00.000Z | 0.0010934057410196343
91+
92+
93+
;
94+
95+
rate_of_aggregate_metric
96+
TS k8s-downsampled
97+
| STATS rate_bytes = sum(rate(network.total_bytes_in)),
98+
max_bytes = max(rate(network.total_bytes_in)),
99+
min_bytes = min(rate(network.total_bytes_in)),
100+
avg_bytes = avg(rate(network.total_bytes_in)) BY time_bucket = bucket(@timestamp, 30minute)
101+
| SORT time_bucket | LIMIT 10;
102+
103+
rate_bytes:double | max_bytes:double | min_bytes:double | avg_bytes:double | time_bucket:datetime
104+
0.7751851851851852 | 0.17694444444444443 | 0.025925925925925936 | 0.08613168724279835 | 2024-05-09T23:30:00.000Z
105+
106+
;

0 commit comments

Comments
 (0)