@@ -435,8 +435,8 @@ setup:
435
435
---
436
436
" Downsample no metric index " :
437
437
- skip :
438
- version : " - 8.4 .99"
439
- reason : " rollup renamed to downsample in 8.5 .0"
438
+ version : " - 8.7 .99"
439
+ reason : " Downsample of time series index without metric allowed from version 8.8 .0"
440
440
441
441
- do :
442
442
indices.create :
@@ -458,6 +458,30 @@ setup:
458
458
metricset :
459
459
type : keyword
460
460
time_series_dimension : true
461
+ label :
462
+ type : integer
463
+
464
+ - do :
465
+ bulk :
466
+ refresh : true
467
+ index : no-metric-index
468
+ body :
469
+ - ' {"index": {}}'
470
+ - ' {"@timestamp": "2021-04-28T18:50:04.467Z", "metricset": "pod", "label": 10, "unmapped": 10 }'
471
+ - ' {"index": {}}'
472
+ - ' {"@timestamp": "2021-04-28T18:50:24.467Z", "metricset": "pod", "label": 20, "unmapped": 20 }'
473
+ - ' {"index": {}}'
474
+ - ' {"@timestamp": "2021-04-28T20:50:44.467Z", "metricset": "pod", "label": 30, "unmapped": 30 }'
475
+ - ' {"index": {}}'
476
+ - ' {"@timestamp": "2021-04-28T20:51:04.467Z", "metricset": "pod", "label": 40, "unmapped": 40 }'
477
+ - ' {"index": {}}'
478
+ - ' {"@timestamp": "2021-04-28T18:50:03.142Z", "metricset": "pod", "label": 100, "unmapped": 100 }'
479
+ - ' {"index": {}}'
480
+ - ' {"@timestamp": "2021-04-28T18:50:23.142Z", "metricset": "pod", "label": 200, "unampped": 200 }'
481
+ - ' {"index": {}}'
482
+ - ' {"@timestamp": "2021-04-28T19:50:53.142Z", "metricset": "pod", "label": 300, "unmapped": 300 }'
483
+ - ' {"index": {}}'
484
+ - ' {"@timestamp": "2021-04-28T19:51:03.142Z", "metricset": "pod", "label": 400, "unmapped": 400 }'
461
485
462
486
- do :
463
487
indices.put_settings :
@@ -466,15 +490,128 @@ setup:
466
490
index.blocks.write : true
467
491
468
492
- do :
469
- catch : /Index \[no-metric-index\] does not contain any metric fields;/
470
493
indices.downsample :
471
494
index : no-metric-index
472
- target_index : rollup-test
495
+ target_index : rollup-test-no-metric
473
496
body : >
474
497
{
475
498
"fixed_interval": "1h"
476
499
}
477
500
501
+ - is_true : acknowledged
502
+
503
+ - do :
504
+ search :
505
+ index : rollup-test-no-metric
506
+ body :
507
+ sort : [ "_tsid", "@timestamp" ]
508
+
509
+ - length : { hits.hits: 3 }
510
+
511
+ - match : { hits.hits.0._source._doc_count: 4 }
512
+ - match : { hits.hits.0._source.metricset: pod }
513
+ - match : { hits.hits.0._source.label: 20 }
514
+ - match : { hits.hits.0._source.unmapped: 20 }
515
+ - match : { hits.hits.0._source.@timestamp: 2021-04-28T18:00:00.000Z }
516
+
517
+ - match : { hits.hits.1._source._doc_count: 2 }
518
+ - match : { hits.hits.1._source.metricset: pod }
519
+ - match : { hits.hits.1._source.label: 400 }
520
+ - match : { hits.hits.1._source.unmapped: 400 }
521
+ - match : { hits.hits.1._source.@timestamp: 2021-04-28T19:00:00.000Z }
522
+
523
+ - match : { hits.hits.2._source._doc_count: 2 }
524
+ - match : { hits.hits.2._source.metricset: pod }
525
+ - match : { hits.hits.2._source.label: 40 }
526
+ - match : { hits.hits.2._source.unmapped: 40 }
527
+ - match : { hits.hits.2._source.@timestamp: 2021-04-28T20:00:00.000Z }
528
+
529
+ ---
530
+ " Downsample no metric no label index " :
531
+ - skip :
532
+ version : " - 8.7.99"
533
+ reason : " Downsample of time series index without metric allowed from version 8.8.0"
534
+
535
+ - do :
536
+ indices.create :
537
+ index : no-metric-no-label-index
538
+ body :
539
+ settings :
540
+ number_of_shards : 1
541
+ number_of_replicas : 0
542
+ index :
543
+ mode : time_series
544
+ routing_path : [metricset]
545
+ time_series :
546
+ start_time : 2021-04-28T00:00:00Z
547
+ end_time : 2021-04-29T00:00:00Z
548
+ mappings :
549
+ properties :
550
+ " @timestamp " :
551
+ type : date
552
+ metricset :
553
+ type : keyword
554
+ time_series_dimension : true
555
+
556
+ - do :
557
+ bulk :
558
+ refresh : true
559
+ index : no-metric-no-label-index
560
+ body :
561
+ - ' {"index": {}}'
562
+ - ' {"@timestamp": "2021-04-28T18:50:04.467Z", "metricset": "pod" }'
563
+ - ' {"index": {}}'
564
+ - ' {"@timestamp": "2021-04-28T18:50:24.467Z", "metricset": "pod" }'
565
+ - ' {"index": {}}'
566
+ - ' {"@timestamp": "2021-04-28T20:50:44.467Z", "metricset": "pod" }'
567
+ - ' {"index": {}}'
568
+ - ' {"@timestamp": "2021-04-28T20:51:04.467Z", "metricset": "pod" }'
569
+ - ' {"index": {}}'
570
+ - ' {"@timestamp": "2021-04-28T18:50:03.142Z", "metricset": "pod" }'
571
+ - ' {"index": {}}'
572
+ - ' {"@timestamp": "2021-04-28T18:50:23.142Z", "metricset": "pod" }'
573
+ - ' {"index": {}}'
574
+ - ' {"@timestamp": "2021-04-28T19:50:53.142Z", "metricset": "pod" }'
575
+ - ' {"index": {}}'
576
+ - ' {"@timestamp": "2021-04-28T19:51:03.142Z", "metricset": "pod" }'
577
+
578
+ - do :
579
+ indices.put_settings :
580
+ index : no-metric-no-label-index
581
+ body :
582
+ index.blocks.write : true
583
+
584
+ - do :
585
+ indices.downsample :
586
+ index : no-metric-no-label-index
587
+ target_index : rollup-test-no-metric-no-label
588
+ body : >
589
+ {
590
+ "fixed_interval": "1h"
591
+ }
592
+
593
+ - is_true : acknowledged
594
+
595
+ - do :
596
+ search :
597
+ index : rollup-test-no-metric-no-label
598
+ body :
599
+ sort : [ "_tsid", "@timestamp" ]
600
+
601
+ - length : { hits.hits: 3 }
602
+
603
+ - match : { hits.hits.0._source._doc_count: 4 }
604
+ - match : { hits.hits.0._source.metricset: pod }
605
+ - match : { hits.hits.0._source.@timestamp: 2021-04-28T18:00:00.000Z }
606
+
607
+ - match : { hits.hits.1._source._doc_count: 2 }
608
+ - match : { hits.hits.1._source.metricset: pod }
609
+ - match : { hits.hits.1._source.@timestamp: 2021-04-28T19:00:00.000Z }
610
+
611
+ - match : { hits.hits.2._source._doc_count: 2 }
612
+ - match : { hits.hits.2._source.metricset: pod }
613
+ - match : { hits.hits.2._source.@timestamp: 2021-04-28T20:00:00.000Z }
614
+
478
615
---
479
616
" Downsample a downsampled index " :
480
617
- skip :
0 commit comments