Skip to content

Commit

Permalink
Validate bucket counts
Browse files Browse the repository at this point in the history
  • Loading branch information
alanwest committed Nov 24, 2021
1 parent c551930 commit 67e022a
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,19 @@ public void TestHistogramToOltpMetric(string name, string description, string un
Assert.Equal(doubleValue, dataPoint.Sum);
}

int bucketIndex;
for (bucketIndex = 0; bucketIndex < dataPoint.ExplicitBounds.Count; ++bucketIndex)
{
if (dataPoint.Sum <= dataPoint.ExplicitBounds[bucketIndex])
{
break;
}

Assert.Equal(0UL, dataPoint.BucketCounts[bucketIndex]);
}

Assert.Equal(1UL, dataPoint.BucketCounts[bucketIndex]);

if (attributes.Length > 0)
{
OtlpTestHelpers.AssertOtlpAttributes(attributes, dataPoint.Attributes);
Expand Down

0 comments on commit 67e022a

Please sign in to comment.