Skip to content

Commit 2d2b22a

Browse files
committed
Add explanatory comments
1 parent 8b718e0 commit 2d2b22a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/aggregator/DoubleBase2ExponentialHistogramAggregator.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ protected boolean isDoubleType() {
267267

268268
@Override
269269
public void recordLong(long value, Attributes attributes, Context context) {
270+
// Since there is no LongExplicitBucketHistogramAggregator and we need to support measurements
271+
// from LongHistogram, we redirect calls from #recordLong to #recordDouble. Without this, the
272+
// base AggregatorHandle implementation of #recordLong throws.
270273
super.recordDouble((double) value, attributes, context);
271274
}
272275

sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/internal/aggregator/DoubleExplicitBucketHistogramAggregator.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ static final class Handle extends AggregatorHandle<HistogramPointData> {
132132

133133
@Override
134134
public void recordLong(long value, Attributes attributes, Context context) {
135+
// Since there is no LongExplicitBucketHistogramAggregator and we need to support measurements
136+
// from LongHistogram, we redirect calls from #recordLong to #recordDouble. Without this, the
137+
// base AggregatorHandle implementation of #recordLong throws.
135138
super.recordDouble((double) value, attributes, context);
136139
}
137140

0 commit comments

Comments
 (0)