Skip to content

Commit

Permalink
Add alt input for cumulative test
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Dec 7, 2023
1 parent 245ec4b commit 4f0ea03
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions sdk/metric/internal/aggregate/exponential_histogram_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,35 @@ func testCumulativeExpoHist[N int64 | float64]() func(t *testing.T) {
},
},
},
{
input: []arg[N]{
{ctx, 2, alice},
{ctx, 3, alice},
{ctx, 8, alice},
},
expect: output{
n: 1,
agg: metricdata.ExponentialHistogram[N]{
Temporality: metricdata.CumulativeTemporality,
DataPoints: []metricdata.ExponentialHistogramDataPoint[N]{
{
Attributes: fltrAlice,
StartTime: staticTime,
Time: staticTime,
Count: 9,
Min: metricdata.NewExtrema[N](1),
Max: metricdata.NewExtrema[N](16),
Sum: 44,
Scale: -1,
PositiveBucket: metricdata.ExponentialBucket{
Offset: -1,
Counts: []uint64{1, 6, 2},
},
},
},
},
},
},
{
input: []arg[N]{},
expect: output{
Expand All @@ -868,14 +897,14 @@ func testCumulativeExpoHist[N int64 | float64]() func(t *testing.T) {
Attributes: fltrAlice,
StartTime: staticTime,
Time: staticTime,
Count: 6,
Count: 9,
Min: metricdata.NewExtrema[N](1),
Max: metricdata.NewExtrema[N](16),
Sum: 31,
Sum: 44,
Scale: -1,
PositiveBucket: metricdata.ExponentialBucket{
Offset: -1,
Counts: []uint64{1, 4, 1},
Counts: []uint64{1, 6, 2},
},
},
},
Expand Down

0 comments on commit 4f0ea03

Please sign in to comment.