@@ -365,9 +365,10 @@ func Test_GroupDataPoints(t *testing.T) {
365
365
d := s .DataPoints ().AppendEmpty ()
366
366
d .SetTimestamp (pcommon .NewTimestampFromTime (time.Time {}))
367
367
d .Attributes ().PutStr ("attr1" , "val1" )
368
- d .SetCount (8 )
368
+ d .SetCount (9 )
369
369
d .SetZeroCount (2 )
370
370
d .Positive ().BucketCounts ().Append (0 , 1 , 2 , 3 )
371
+ d .Negative ().BucketCounts ().Append (0 , 1 )
371
372
return m
372
373
},
373
374
want : AggGroups {
@@ -485,10 +486,11 @@ func Test_MergeDataPoints(t *testing.T) {
485
486
s := m .SetEmptyExponentialHistogram ()
486
487
d := s .DataPoints ().AppendEmpty ()
487
488
d .Attributes ().PutStr ("attr1" , "val1" )
488
- d .SetCount (12 )
489
+ d .SetCount (16 )
489
490
d .SetSum (0 )
490
491
d .SetZeroCount (3 )
491
492
d .Positive ().BucketCounts ().Append (0 , 2 , 4 , 3 )
493
+ d .Negative ().BucketCounts ().Append (0 , 2 , 2 )
492
494
return m
493
495
},
494
496
in : func () pmetric.Metric {
@@ -551,9 +553,10 @@ func testDataExpHistogram() pmetric.ExponentialHistogramDataPointSlice {
551
553
data := pmetric .NewExponentialHistogramDataPointSlice ()
552
554
d := data .AppendEmpty ()
553
555
d .Attributes ().PutStr ("attr1" , "val1" )
554
- d .SetCount (4 )
556
+ d .SetCount (7 )
555
557
d .SetZeroCount (1 )
556
558
d .Positive ().BucketCounts ().Append (0 , 1 , 2 )
559
+ d .Negative ().BucketCounts ().Append (0 , 1 , 2 )
557
560
return data
558
561
}
559
562
@@ -562,18 +565,22 @@ func testDataExpHistogramDouble() pmetric.ExponentialHistogramDataPointSlice {
562
565
563
566
dWant := dataWant .AppendEmpty ()
564
567
dWant .Attributes ().PutStr ("attr1" , "val1" )
565
- dWant .SetCount (4 )
568
+ dWant .SetCount (7 )
566
569
dWant .SetZeroCount (1 )
567
570
dWant .Positive ().BucketCounts ().Append (0 , 1 , 2 )
571
+ dWant .Negative ().BucketCounts ().Append (0 , 1 , 2 )
568
572
569
573
dWant2 := dataWant .AppendEmpty ()
570
574
dWant2 .SetTimestamp (pcommon .NewTimestampFromTime (time.Time {}))
571
575
dWant2 .Attributes ().PutStr ("attr1" , "val1" )
572
- dWant2 .SetCount (8 )
576
+ dWant2 .SetCount (9 )
573
577
dWant2 .SetZeroCount (2 )
574
578
// Use a larger number of buckets than above to check that we expand the
575
579
// destination array as needed while merging.
576
580
dWant2 .Positive ().BucketCounts ().Append (0 , 1 , 2 , 3 )
581
+ // Use a smaller number of buckets than above to check that we merge values
582
+ // into the correct, existing buckets.
583
+ dWant2 .Negative ().BucketCounts ().Append (0 , 1 )
577
584
578
585
return dataWant
579
586
}
0 commit comments