-
Notifications
You must be signed in to change notification settings - Fork 550
/
Copy pathaggregators.test
632 lines (518 loc) · 22.7 KB
/
aggregators.test
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
# SPDX-License-Identifier: AGPL-3.0-only
# Provenance-includes-location: https://github.com/prometheus/prometheus/tree/main/promql/testdata/aggregators.test
# Provenance-includes-license: Apache-2.0
# Provenance-includes-copyright: The Prometheus Authors
load 5m
http_requests{job="api-server", instance="0", group="production"} 0+10x10
http_requests{job="api-server", instance="1", group="production"} 0+20x10
http_requests{job="api-server", instance="0", group="canary"} 0+30x10
http_requests{job="api-server", instance="1", group="canary"} 0+40x10
http_requests{job="app-server", instance="0", group="production"} 0+50x10
http_requests{job="app-server", instance="1", group="production"} 0+60x10
http_requests{job="app-server", instance="0", group="canary"} 0+70x10
http_requests{job="app-server", instance="1", group="canary"} 0+80x10
load 5m
foo{job="api-server", instance="0", region="europe"} 0+90x10
foo{job="api-server"} 0+100x10
# Simple sum.
eval instant at 50m SUM BY (group) (http_requests{job="api-server"})
{group="canary"} 700
{group="production"} 300
eval instant at 50m SUM BY (group) (((http_requests{job="api-server"})))
{group="canary"} 700
{group="production"} 300
# Test alternative "by"-clause order.
eval instant at 50m sum by (group) (http_requests{job="api-server"})
{group="canary"} 700
{group="production"} 300
# Simple average.
# Unsupported by streaming engine.
# eval instant at 50m avg by (group) (http_requests{job="api-server"})
# {group="canary"} 350
# {group="production"} 150
# Simple count.
# Unsupported by streaming engine.
# eval instant at 50m count by (group) (http_requests{job="api-server"})
# {group="canary"} 2
# {group="production"} 2
# Simple without.
eval instant at 50m sum without (instance) (http_requests{job="api-server"})
{group="canary",job="api-server"} 700
{group="production",job="api-server"} 300
# Empty by.
eval instant at 50m sum by () (http_requests{job="api-server"})
{} 1000
# No by/without.
eval instant at 50m sum(http_requests{job="api-server"})
{} 1000
# Empty without.
eval instant at 50m sum without () (http_requests{job="api-server",group="production"})
{group="production",job="api-server",instance="0"} 100
{group="production",job="api-server",instance="1"} 200
# Without with mismatched and missing labels. Do not do this.
# Unsupported by streaming engine.
# eval instant at 50m sum without (instance) (http_requests{job="api-server"} or foo)
# {group="canary",job="api-server"} 700
# {group="production",job="api-server"} 300
# {region="europe",job="api-server"} 900
# {job="api-server"} 1000
# Lower-cased aggregation operators should work too.
# Unsupported by streaming engine.
# eval instant at 50m sum(http_requests) by (job) + min(http_requests) by (job) + max(http_requests) by (job) + avg(http_requests) by (job)
# {job="app-server"} 4550
# {job="api-server"} 1750
# Test alternative "by"-clause order.
eval instant at 50m sum by (group) (http_requests{job="api-server"})
{group="canary"} 700
{group="production"} 300
# Test both alternative "by"-clause orders in one expression.
# Public health warning: stick to one form within an expression (or even
# in an organization), or risk serious user confusion.
eval instant at 50m sum(sum by (group) (http_requests{job="api-server"})) by (job)
{} 1000
eval instant at 50m SUM(http_requests)
{} 3600
eval instant at 50m SUM(http_requests{instance="0"}) BY(job)
{job="api-server"} 400
{job="app-server"} 1200
eval instant at 50m SUM(http_requests) BY (job)
{job="api-server"} 1000
{job="app-server"} 2600
# Non-existent labels mentioned in BY-clauses shouldn't propagate to output.
eval instant at 50m SUM(http_requests) BY (job, nonexistent)
{job="api-server"} 1000
{job="app-server"} 2600
# Unsupported by streaming engine.
# eval instant at 50m COUNT(http_requests) BY (job)
# {job="api-server"} 4
# {job="app-server"} 4
eval instant at 50m SUM(http_requests) BY (job, group)
{group="canary", job="api-server"} 700
{group="canary", job="app-server"} 1500
{group="production", job="api-server"} 300
{group="production", job="app-server"} 1100
# Unsupported by streaming engine.
# eval instant at 50m AVG(http_requests) BY (job)
# {job="api-server"} 250
# {job="app-server"} 650
# Unsupported by streaming engine.
# eval instant at 50m MIN(http_requests) BY (job)
# {job="api-server"} 100
# {job="app-server"} 500
# Unsupported by streaming engine.
# Unsupported by streaming engine.
# eval instant at 50m MAX(http_requests) BY (job)
# {job="api-server"} 400
# {job="app-server"} 800
# Unsupported by streaming engine.
# eval instant at 50m abs(-1 * http_requests{group="production",job="api-server"})
# {group="production", instance="0", job="api-server"} 100
# {group="production", instance="1", job="api-server"} 200
# Unsupported by streaming engine.
# eval instant at 50m floor(0.004 * http_requests{group="production",job="api-server"})
# {group="production", instance="0", job="api-server"} 0
# {group="production", instance="1", job="api-server"} 0
# Unsupported by streaming engine.
# eval instant at 50m ceil(0.004 * http_requests{group="production",job="api-server"})
# {group="production", instance="0", job="api-server"} 1
# {group="production", instance="1", job="api-server"} 1
# Unsupported by streaming engine.
# eval instant at 50m round(0.004 * http_requests{group="production",job="api-server"})
# {group="production", instance="0", job="api-server"} 0
# {group="production", instance="1", job="api-server"} 1
# Round should correctly handle negative numbers.
# Unsupported by streaming engine.
# eval instant at 50m round(-1 * (0.004 * http_requests{group="production",job="api-server"}))
# {group="production", instance="0", job="api-server"} 0
# {group="production", instance="1", job="api-server"} -1
# Round should round half up.
# Unsupported by streaming engine.
# eval instant at 50m round(0.005 * http_requests{group="production",job="api-server"})
# {group="production", instance="0", job="api-server"} 1
# {group="production", instance="1", job="api-server"} 1
# Unsupported by streaming engine.
# eval instant at 50m round(-1 * (0.005 * http_requests{group="production",job="api-server"}))
# {group="production", instance="0", job="api-server"} 0
# {group="production", instance="1", job="api-server"} -1
# Unsupported by streaming engine.
# eval instant at 50m round(1 + 0.005 * http_requests{group="production",job="api-server"})
# {group="production", instance="0", job="api-server"} 2
# {group="production", instance="1", job="api-server"} 2
# Unsupported by streaming engine.
# eval instant at 50m round(-1 * (1 + 0.005 * http_requests{group="production",job="api-server"}))
# {group="production", instance="0", job="api-server"} -1
# {group="production", instance="1", job="api-server"} -2
# Round should accept the number to round nearest to.
# Unsupported by streaming engine.
# eval instant at 50m round(0.0005 * http_requests{group="production",job="api-server"}, 0.1)
# {group="production", instance="0", job="api-server"} 0.1
# {group="production", instance="1", job="api-server"} 0.1
# Unsupported by streaming engine.
# eval instant at 50m round(2.1 + 0.0005 * http_requests{group="production",job="api-server"}, 0.1)
# {group="production", instance="0", job="api-server"} 2.2
# {group="production", instance="1", job="api-server"} 2.2
# Unsupported by streaming engine.
# eval instant at 50m round(5.2 + 0.0005 * http_requests{group="production",job="api-server"}, 0.1)
# {group="production", instance="0", job="api-server"} 5.3
# {group="production", instance="1", job="api-server"} 5.3
# Round should work correctly with negative numbers and multiple decimal places.
# Unsupported by streaming engine.
# eval instant at 50m round(-1 * (5.2 + 0.0005 * http_requests{group="production",job="api-server"}), 0.1)
# {group="production", instance="0", job="api-server"} -5.2
# {group="production", instance="1", job="api-server"} -5.3
# Round should work correctly with big toNearests.
# Unsupported by streaming engine.
# eval instant at 50m round(0.025 * http_requests{group="production",job="api-server"}, 5)
# {group="production", instance="0", job="api-server"} 5
# {group="production", instance="1", job="api-server"} 5
# Unsupported by streaming engine.
# eval instant at 50m round(0.045 * http_requests{group="production",job="api-server"}, 5)
# {group="production", instance="0", job="api-server"} 5
# {group="production", instance="1", job="api-server"} 10
# Standard deviation and variance.
# Unsupported by streaming engine.
# eval instant at 50m stddev(http_requests)
# {} 229.12878474779
# Unsupported by streaming engine.
# eval instant at 50m stddev by (instance)(http_requests)
# {instance="0"} 223.60679774998
# {instance="1"} 223.60679774998
# Unsupported by streaming engine.
# eval instant at 50m stdvar(http_requests)
# {} 52500
# Unsupported by streaming engine.
# eval instant at 50m stdvar by (instance)(http_requests)
# {instance="0"} 50000
# {instance="1"} 50000
# Float precision test for standard deviation and variance
clear
load 5m
http_requests{job="api-server", instance="0", group="production"} 0+1.33x10
http_requests{job="api-server", instance="1", group="production"} 0+1.33x10
http_requests{job="api-server", instance="0", group="canary"} 0+1.33x10
# Unsupported by streaming engine.
# eval instant at 50m stddev(http_requests)
# {} 0.0
# Unsupported by streaming engine.
# eval instant at 50m stdvar(http_requests)
# {} 0.0
# Regression test for missing separator byte in labelsToGroupingKey.
clear
load 5m
label_grouping_test{a="aa", b="bb"} 0+10x10
label_grouping_test{a="a", b="abb"} 0+20x10
# Unsupported by streaming engine.
# eval instant at 50m sum(label_grouping_test) by (a, b)
# {a="a", b="abb"} 200
# {a="aa", b="bb"} 100
# Tests for min/max.
clear
load 5m
http_requests{job="api-server", instance="0", group="production"} 1
http_requests{job="api-server", instance="1", group="production"} 2
http_requests{job="api-server", instance="0", group="canary"} NaN
http_requests{job="api-server", instance="1", group="canary"} 3
http_requests{job="api-server", instance="2", group="canary"} 4
# Unsupported by streaming engine.
# eval instant at 0m max(http_requests)
# {} 4
# Unsupported by streaming engine.
# eval instant at 0m min(http_requests)
# {} 1
# Unsupported by streaming engine.
# eval instant at 0m max by (group) (http_requests)
# {group="production"} 2
# {group="canary"} 4
# Unsupported by streaming engine.
# eval instant at 0m min by (group) (http_requests)
# {group="production"} 1
# {group="canary"} 3
clear
# Tests for topk/bottomk.
load 5m
http_requests{job="api-server", instance="0", group="production"} 0+10x10
http_requests{job="api-server", instance="1", group="production"} 0+20x10
http_requests{job="api-server", instance="2", group="production"} NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
http_requests{job="api-server", instance="0", group="canary"} 0+30x10
http_requests{job="api-server", instance="1", group="canary"} 0+40x10
http_requests{job="app-server", instance="0", group="production"} 0+50x10
http_requests{job="app-server", instance="1", group="production"} 0+60x10
http_requests{job="app-server", instance="0", group="canary"} 0+70x10
http_requests{job="app-server", instance="1", group="canary"} 0+80x10
foo 3+0x10
# Unsupported by streaming engine.
# eval_ordered instant at 50m topk(3, http_requests)
# http_requests{group="canary", instance="1", job="app-server"} 800
# http_requests{group="canary", instance="0", job="app-server"} 700
# http_requests{group="production", instance="1", job="app-server"} 600
# Unsupported by streaming engine.
# eval_ordered instant at 50m topk((3), (http_requests))
# http_requests{group="canary", instance="1", job="app-server"} 800
# http_requests{group="canary", instance="0", job="app-server"} 700
# http_requests{group="production", instance="1", job="app-server"} 600
# Unsupported by streaming engine.
# eval_ordered instant at 50m topk(5, http_requests{group="canary",job="app-server"})
# http_requests{group="canary", instance="1", job="app-server"} 800
# http_requests{group="canary", instance="0", job="app-server"} 700
# Unsupported by streaming engine.
# eval_ordered instant at 50m bottomk(3, http_requests)
# http_requests{group="production", instance="0", job="api-server"} 100
# http_requests{group="production", instance="1", job="api-server"} 200
# http_requests{group="canary", instance="0", job="api-server"} 300
# Unsupported by streaming engine.
# eval_ordered instant at 50m bottomk(5, http_requests{group="canary",job="app-server"})
# http_requests{group="canary", instance="0", job="app-server"} 700
# http_requests{group="canary", instance="1", job="app-server"} 800
# Unsupported by streaming engine.
# eval instant at 50m topk by (group) (1, http_requests)
# http_requests{group="production", instance="1", job="app-server"} 600
# http_requests{group="canary", instance="1", job="app-server"} 800
# Unsupported by streaming engine.
# eval instant at 50m bottomk by (group) (2, http_requests)
# http_requests{group="canary", instance="0", job="api-server"} 300
# http_requests{group="canary", instance="1", job="api-server"} 400
# http_requests{group="production", instance="0", job="api-server"} 100
# http_requests{group="production", instance="1", job="api-server"} 200
# Unsupported by streaming engine.
# eval_ordered instant at 50m bottomk by (group) (2, http_requests{group="production"})
# http_requests{group="production", instance="0", job="api-server"} 100
# http_requests{group="production", instance="1", job="api-server"} 200
# Test NaN is sorted away from the top/bottom.
# Unsupported by streaming engine.
# eval_ordered instant at 50m topk(3, http_requests{job="api-server",group="production"})
# http_requests{job="api-server", instance="1", group="production"} 200
# http_requests{job="api-server", instance="0", group="production"} 100
# http_requests{job="api-server", instance="2", group="production"} NaN
# Unsupported by streaming engine.
# eval_ordered instant at 50m bottomk(3, http_requests{job="api-server",group="production"})
# http_requests{job="api-server", instance="0", group="production"} 100
# http_requests{job="api-server", instance="1", group="production"} 200
# http_requests{job="api-server", instance="2", group="production"} NaN
# Test topk and bottomk allocate min(k, input_vector) for results vector
# Unsupported by streaming engine.
# eval_ordered instant at 50m bottomk(9999999999, http_requests{job="app-server",group="canary"})
# http_requests{group="canary", instance="0", job="app-server"} 700
# http_requests{group="canary", instance="1", job="app-server"} 800
# Unsupported by streaming engine.
# eval_ordered instant at 50m topk(9999999999, http_requests{job="api-server",group="production"})
# http_requests{job="api-server", instance="1", group="production"} 200
# http_requests{job="api-server", instance="0", group="production"} 100
# http_requests{job="api-server", instance="2", group="production"} NaN
# Bug #5276.
# Unsupported by streaming engine.
# eval_ordered instant at 50m topk(scalar(foo), http_requests)
# http_requests{group="canary", instance="1", job="app-server"} 800
# http_requests{group="canary", instance="0", job="app-server"} 700
# http_requests{group="production", instance="1", job="app-server"} 600
clear
# Tests for count_values.
load 5m
version{job="api-server", instance="0", group="production"} 6
version{job="api-server", instance="1", group="production"} 6
version{job="api-server", instance="2", group="production"} 6
version{job="api-server", instance="0", group="canary"} 8
version{job="api-server", instance="1", group="canary"} 8
version{job="app-server", instance="0", group="production"} 6
version{job="app-server", instance="1", group="production"} 6
version{job="app-server", instance="0", group="canary"} 7
version{job="app-server", instance="1", group="canary"} 7
# Unsupported by streaming engine.
# eval instant at 5m count_values("version", version)
# {version="6"} 5
# {version="7"} 2
# {version="8"} 2
# Unsupported by streaming engine.
# eval instant at 5m count_values(((("version"))), version)
# {version="6"} 5
# {version="7"} 2
# {version="8"} 2
# Unsupported by streaming engine.
# eval instant at 5m count_values without (instance)("version", version)
# {job="api-server", group="production", version="6"} 3
# {job="api-server", group="canary", version="8"} 2
# {job="app-server", group="production", version="6"} 2
# {job="app-server", group="canary", version="7"} 2
# Overwrite label with output. Don't do this.
# Unsupported by streaming engine.
# eval instant at 5m count_values without (instance)("job", version)
# {job="6", group="production"} 5
# {job="8", group="canary"} 2
# {job="7", group="canary"} 2
# Overwrite label with output. Don't do this.
# Unsupported by streaming engine.
# eval instant at 5m count_values by (job, group)("job", version)
# {job="6", group="production"} 5
# {job="8", group="canary"} 2
# {job="7", group="canary"} 2
# Tests for quantile.
clear
load 10s
data{test="two samples",point="a"} 0
data{test="two samples",point="b"} 1
data{test="three samples",point="a"} 0
data{test="three samples",point="b"} 1
data{test="three samples",point="c"} 2
data{test="uneven samples",point="a"} 0
data{test="uneven samples",point="b"} 1
data{test="uneven samples",point="c"} 4
foo .8
# Unsupported by streaming engine.
# eval instant at 1m quantile without(point)(0.8, data)
# {test="two samples"} 0.8
# {test="three samples"} 1.6
# {test="uneven samples"} 2.8
# Bug #5276.
# Unsupported by streaming engine.
# eval instant at 1m quantile without(point)(scalar(foo), data)
# {test="two samples"} 0.8
# {test="three samples"} 1.6
# {test="uneven samples"} 2.8
# Unsupported by streaming engine.
# eval instant at 1m quantile without(point)((scalar(foo)), data)
# {test="two samples"} 0.8
# {test="three samples"} 1.6
# {test="uneven samples"} 2.8
# Unsupported by streaming engine.
# eval_warn instant at 1m quantile without(point)(NaN, data)
# {test="two samples"} NaN
# {test="three samples"} NaN
# {test="uneven samples"} NaN
# Tests for group.
clear
load 10s
data{test="two samples",point="a"} 0
data{test="two samples",point="b"} 1
data{test="three samples",point="a"} 0
data{test="three samples",point="b"} 1
data{test="three samples",point="c"} 2
data{test="uneven samples",point="a"} 0
data{test="uneven samples",point="b"} 1
data{test="uneven samples",point="c"} 4
foo .8
# Unsupported by streaming engine.
# eval instant at 1m group without(point)(data)
# {test="two samples"} 1
# {test="three samples"} 1
# {test="uneven samples"} 1
# Unsupported by streaming engine.
# eval instant at 1m group(foo)
# {} 1
# Tests for avg.
clear
load 10s
data{test="ten",point="a"} 8
data{test="ten",point="b"} 10
data{test="ten",point="c"} 12
data{test="inf",point="a"} 0
data{test="inf",point="b"} Inf
data{test="inf",point="d"} Inf
data{test="inf",point="c"} 0
data{test="-inf",point="a"} -Inf
data{test="-inf",point="b"} -Inf
data{test="-inf",point="c"} 0
data{test="inf2",point="a"} Inf
data{test="inf2",point="b"} 0
data{test="inf2",point="c"} Inf
data{test="-inf2",point="a"} -Inf
data{test="-inf2",point="b"} 0
data{test="-inf2",point="c"} -Inf
data{test="inf3",point="b"} Inf
data{test="inf3",point="d"} Inf
data{test="inf3",point="c"} Inf
data{test="inf3",point="d"} -Inf
data{test="-inf3",point="b"} -Inf
data{test="-inf3",point="d"} -Inf
data{test="-inf3",point="c"} -Inf
data{test="-inf3",point="c"} Inf
data{test="nan",point="a"} -Inf
data{test="nan",point="b"} 0
data{test="nan",point="c"} Inf
data{test="big",point="a"} 9.988465674311579e+307
data{test="big",point="b"} 9.988465674311579e+307
data{test="big",point="c"} 9.988465674311579e+307
data{test="big",point="d"} 9.988465674311579e+307
data{test="-big",point="a"} -9.988465674311579e+307
data{test="-big",point="b"} -9.988465674311579e+307
data{test="-big",point="c"} -9.988465674311579e+307
data{test="-big",point="d"} -9.988465674311579e+307
data{test="bigzero",point="a"} -9.988465674311579e+307
data{test="bigzero",point="b"} -9.988465674311579e+307
data{test="bigzero",point="c"} 9.988465674311579e+307
data{test="bigzero",point="d"} 9.988465674311579e+307
# Unsupported by streaming engine.
# eval instant at 1m avg(data{test="ten"})
# {} 10
# Unsupported by streaming engine.
# eval instant at 1m avg(data{test="inf"})
# {} Inf
# Unsupported by streaming engine.
# eval instant at 1m avg(data{test="inf2"})
# {} Inf
# Unsupported by streaming engine.
# eval instant at 1m avg(data{test="inf3"})
# {} NaN
# Unsupported by streaming engine.
# eval instant at 1m avg(data{test="-inf"})
# {} -Inf
# Unsupported by streaming engine.
# eval instant at 1m avg(data{test="-inf2"})
# {} -Inf
# Unsupported by streaming engine.
# eval instant at 1m avg(data{test="-inf3"})
# {} NaN
# Unsupported by streaming engine.
# eval instant at 1m avg(data{test="nan"})
# {} NaN
# Unsupported by streaming engine.
# eval instant at 1m avg(data{test="big"})
# {} 9.988465674311579e+307
# Unsupported by streaming engine.
# eval instant at 1m avg(data{test="-big"})
# {} -9.988465674311579e+307
# Unsupported by streaming engine.
# eval instant at 1m avg(data{test="bigzero"})
# {} 0
# Test summing extreme values.
clear
load 10s
data{test="ten",point="a"} 2
data{test="ten",point="b"} 8
data{test="ten",point="c"} 1e+100
data{test="ten",point="d"} -1e100
data{test="pos_inf",group="1",point="a"} Inf
data{test="pos_inf",group="1",point="b"} 2
data{test="pos_inf",group="2",point="a"} 2
data{test="pos_inf",group="2",point="b"} Inf
data{test="neg_inf",group="1",point="a"} -Inf
data{test="neg_inf",group="1",point="b"} 2
data{test="neg_inf",group="2",point="a"} 2
data{test="neg_inf",group="2",point="b"} -Inf
data{test="inf_inf",point="a"} Inf
data{test="inf_inf",point="b"} -Inf
data{test="nan",group="1",point="a"} NaN
data{test="nan",group="1",point="b"} 2
data{test="nan",group="2",point="a"} 2
data{test="nan",group="2",point="b"} NaN
# Unsupported by streaming engine.
# eval instant at 1m sum(data{test="ten"})
# {} 10
eval instant at 1m sum by (group) (data{test="pos_inf"})
{group="1"} Inf
{group="2"} Inf
eval instant at 1m sum by (group) (data{test="neg_inf"})
{group="1"} -Inf
{group="2"} -Inf
eval instant at 1m sum(data{test="inf_inf"})
{} NaN
eval instant at 1m sum by (group) (data{test="nan"})
{group="1"} NaN
{group="2"} NaN
clear
# Test that aggregations are deterministic.
# Commented because it is flaky in range mode.
#load 10s
# up{job="prometheus"} 1
# up{job="prometheus2"} 1
#
#eval instant at 1m count(topk(1,max(up) without()) == topk(1,max(up) without()) == topk(1,max(up) without()) == topk(1,max(up) without()) == topk(1,max(up) without()))
# {} 1