Skip to content

Commit 1a88cca

Browse files
committed
Adding more corner cases for rate csv tests
foxip
1 parent 6985093 commit 1a88cca

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/resources/k8s-timeseries-rate.csv-spec

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,99 @@ sum_bytes:double | max_bytes:double | min_bytes:double | avg_bytes:doubl
110110
0.7751851851851852 | 0.17694444444444443 | 0.025925925925925936 | 0.08613168724279835 | 2024-05-09T23:30:00.000Z
111111

112112
;
113+
114+
rate_of_expression
115+
required_capability: metrics_command
116+
TS k8s
117+
| STATS rate_bytes_in=avg(rate(network.total_bytes_in) + 10) BY time_bucket = bucket(@timestamp,1minute)
118+
| SORT rate_bytes_in DESC, time_bucket DESC | LIMIT 10;
119+
120+
rate_bytes_in:double | time_bucket:datetime
121+
null | 2024-05-10T00:01:00.000Z
122+
38.80297619047619 | 2024-05-10T00:15:00.000Z
123+
35.422222222222224 | 2024-05-10T00:04:00.000Z
124+
34.28946078431372 | 2024-05-10T00:19:00.000Z
125+
34.05555555555555 | 2024-05-10T00:10:00.000Z
126+
32.54679487179487 | 2024-05-10T00:13:00.000Z
127+
31.039819662685943 | 2024-05-10T00:17:00.000Z
128+
30.4206673043201 | 2024-05-10T00:18:00.000Z
129+
29.745833333333334 | 2024-05-10T00:00:00.000Z
130+
29.4 | 2024-05-10T00:14:00.000Z
131+
;
132+
133+
rate_combined_avg
134+
required_capability: metrics_command
135+
TS k8s
136+
| STATS avg_rate_bytes = avg(rate(network.total_bytes_in)), avg_rate_cost = avg(rate(network.total_cost)) BY cluster, time_bucket = bucket(@timestamp, 10minute)
137+
| EVAL ratio = avg_rate_bytes / avg_rate_cost
138+
| SORT time_bucket, cluster | LIMIT 10;
139+
140+
avg_rate_bytes:double | avg_rate_cost:double | cluster:keyword | time_bucket:datetime | ratio:double
141+
4.489054151267086 | 0.08727848310006986 | prod | 2024-05-10T00:00:00.000Z | 51.43368665241494
142+
9.933630806480615 | 0.1480786773651426 | qa | 2024-05-10T00:00:00.000Z | 67.08346524453067
143+
6.2165285757677635 | 0.08125606293033183 | staging | 2024-05-10T00:00:00.000Z | 76.50541204657867
144+
9.435761829894686 | 0.09789990135274192 | prod | 2024-05-10T00:10:00.000Z | 96.38172970059296
145+
11.21976172297114 | 0.13555566451825743 | qa | 2024-05-10T00:10:00.000Z | 82.76866749054221
146+
5.861581261551023 | 0.06909345577029162 | staging | 2024-05-10T00:10:00.000Z | 84.8355491298403
147+
2.8502443448121024 | 0.03328125 | prod | 2024-05-10T00:20:00.000Z | 85.6411446328519
148+
1.4602777777777782 | 0.03146701388888888 | qa | 2024-05-10T00:20:00.000Z | 46.4066206896552
149+
1.1196474788041055 | 0.026953703703703702 | staging | 2024-05-10T00:20:00.000Z | 41.53965225381086
150+
;
151+
152+
rate_combined_sum
153+
required_capability: metrics_command
154+
TS k8s
155+
| STATS sum_rate_bytes = sum(rate(network.total_bytes_in)), sum_rate_cost = sum(rate(network.total_cost)) BY cluster, time_bucket = bucket(@timestamp, 10minute)
156+
| EVAL ratio = sum_rate_bytes / sum_rate_cost
157+
| SORT time_bucket, cluster | LIMIT 10;
158+
159+
sum_rate_bytes:double | sum_rate_cost:double | cluster:keyword | time_bucket:datetime | ratio:double
160+
13.46716245380126 | 0.2618354493002096 | prod | 2024-05-10T00:00:00.000Z | 51.43368665241495
161+
29.800892419441844 | 0.44423603209542784 | qa | 2024-05-10T00:00:00.000Z | 67.08346524453067
162+
18.64958572730329 | 0.2437681887909955 | staging | 2024-05-10T00:00:00.000Z | 76.50541204657867
163+
28.307285489684055 | 0.29369970405822576 | prod | 2024-05-10T00:10:00.000Z | 96.38172970059294
164+
33.65928516891342 | 0.4066669935547723 | qa | 2024-05-10T00:10:00.000Z | 82.76866749054221
165+
17.584743784653067 | 0.20728036731087485 | staging | 2024-05-10T00:10:00.000Z | 84.8355491298403
166+
5.700488689624205 | 0.0665625 | prod | 2024-05-10T00:20:00.000Z | 85.6411446328519
167+
2.9205555555555565 | 0.06293402777777776 | qa | 2024-05-10T00:20:00.000Z | 46.4066206896552
168+
3.358942436412317 | 0.0808611111111111 | staging | 2024-05-10T00:20:00.000Z | 41.53965225381086
169+
;
170+
171+
rate_of_ratio
172+
required_capability: metrics_command
173+
TS k8s
174+
| STATS rate_of_ratio = sum(rate(network.total_cost) / rate(network.total_bytes_in)) BY cluster, time_bucket = bucket(@timestamp, 10minute)
175+
| SORT time_bucket, cluster | LIMIT 10;
176+
177+
rate_of_ratio:double | cluster:keyword | time_bucket:datetime
178+
0.05729672905133547 | prod | 2024-05-10T00:00:00.000Z
179+
0.04435305398953446 | qa | 2024-05-10T00:00:00.000Z
180+
0.041268397742417876 | staging | 2024-05-10T00:00:00.000Z
181+
0.030827104158756384 | prod | 2024-05-10T00:10:00.000Z
182+
0.03694112891727294 | qa | 2024-05-10T00:10:00.000Z
183+
0.03371556294613671 | staging | 2024-05-10T00:10:00.000Z
184+
0.02425073340627254 | prod | 2024-05-10T00:20:00.000Z
185+
0.05616345770915657 | qa | 2024-05-10T00:20:00.000Z
186+
0.06756155922294359 | staging | 2024-05-10T00:20:00.000Z
187+
;
188+
189+
rate_of_long_grouping_1min_nulls
190+
required_capability: metrics_command
191+
TS k8s
192+
| STATS rate_bytes_in=avg(rate(network.total_bytes_in)) BY cluster, time_bucket = bucket(@timestamp,2minute)
193+
| SORT rate_bytes_in NULLS FIRST, time_bucket, cluster | LIMIT 10;
194+
195+
rate_bytes_in:double | cluster:keyword | time_bucket:datetime
196+
null | qa | 2024-05-10T00:00:00.000Z
197+
null | staging | 2024-05-10T00:00:00.000Z
198+
null | prod | 2024-05-10T00:06:00.000Z
199+
null | prod | 2024-05-10T00:10:00.000Z
200+
null | staging | 2024-05-10T00:10:00.000Z
201+
null | qa | 2024-05-10T00:22:00.000Z
202+
0.0371323529411787 | staging | 2024-05-10T00:22:00.000Z
203+
0.42291666666666666 | qa | 2024-05-10T00:12:00.000Z
204+
2.27097222222222 | qa | 2024-05-10T00:20:00.000Z
205+
4.084868421052632 | staging | 2024-05-10T00:14:00.000Z
206+
207+
;
208+

0 commit comments

Comments
 (0)