@@ -42,7 +42,7 @@ internal sealed class AggregatorStore
4242 private readonly MetricPoint [ ] metricPoints ;
4343 private readonly int [ ] currentMetricPointBatch ;
4444 private readonly AggregationType aggType ;
45- private readonly double [ ] histogramBounds ;
45+ private readonly HistogramExplicitBounds histogramExplicitBounds ;
4646 private readonly int exponentialHistogramMaxSize ;
4747 private readonly int exponentialHistogramMaxScale ;
4848 private readonly UpdateLongDelegate updateLongCallback ;
@@ -74,7 +74,7 @@ internal AggregatorStore(
7474 this . currentMetricPointBatch = new int [ this . NumberOfMetricPoints ] ;
7575 this . aggType = aggType ;
7676 this . OutputDelta = temporality == AggregationTemporality . Delta ;
77- this . histogramBounds = metricStreamIdentity . HistogramBucketBounds ?? FindDefaultHistogramBounds ( in metricStreamIdentity ) ;
77+ this . histogramExplicitBounds = new ( metricStreamIdentity . HistogramBucketBounds ?? FindDefaultHistogramBounds ( in metricStreamIdentity ) ) ;
7878 this . exponentialHistogramMaxSize = metricStreamIdentity . ExponentialHistogramMaxSize ;
7979 this . exponentialHistogramMaxScale = metricStreamIdentity . ExponentialHistogramMaxScale ;
8080 this . StartTimeExclusive = DateTimeOffset . UtcNow ;
@@ -143,7 +143,7 @@ internal AggregatorStore(
143143
144144 internal DateTimeOffset EndTimeInclusive { get ; private set ; }
145145
146- internal double [ ] HistogramBounds => this . histogramBounds ;
146+ internal double [ ] HistogramBounds => this . histogramExplicitBounds . Bounds ;
147147
148148 internal bool IsExemplarEnabled ( )
149149 {
@@ -393,11 +393,11 @@ private void InitializeZeroTagPointIfNotInitialized()
393393 if ( this . OutputDelta )
394394 {
395395 var lookupData = new LookupData ( 0 , Tags . EmptyTags , Tags . EmptyTags ) ;
396- this . metricPoints [ 0 ] = new MetricPoint ( this , this . aggType , null , this . histogramBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale , lookupData ) ;
396+ this . metricPoints [ 0 ] = new MetricPoint ( this , this . aggType , null , this . histogramExplicitBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale , lookupData ) ;
397397 }
398398 else
399399 {
400- this . metricPoints [ 0 ] = new MetricPoint ( this , this . aggType , null , this . histogramBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale ) ;
400+ this . metricPoints [ 0 ] = new MetricPoint ( this , this . aggType , null , this . histogramExplicitBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale ) ;
401401 }
402402
403403 this . zeroTagMetricPointInitialized = true ;
@@ -421,11 +421,11 @@ private void InitializeOverflowTagPointIfNotInitialized()
421421 if ( this . OutputDelta )
422422 {
423423 var lookupData = new LookupData ( 1 , tags , tags ) ;
424- this . metricPoints [ 1 ] = new MetricPoint ( this , this . aggType , keyValuePairs , this . histogramBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale , lookupData ) ;
424+ this . metricPoints [ 1 ] = new MetricPoint ( this , this . aggType , keyValuePairs , this . histogramExplicitBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale , lookupData ) ;
425425 }
426426 else
427427 {
428- this . metricPoints [ 1 ] = new MetricPoint ( this , this . aggType , keyValuePairs , this . histogramBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale ) ;
428+ this . metricPoints [ 1 ] = new MetricPoint ( this , this . aggType , keyValuePairs , this . histogramExplicitBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale ) ;
429429 }
430430
431431 this . overflowTagMetricPointInitialized = true ;
@@ -494,7 +494,7 @@ private int LookupAggregatorStore(KeyValuePair<string, object?>[] tagKeysAndValu
494494 }
495495
496496 ref var metricPoint = ref this . metricPoints [ aggregatorIndex ] ;
497- metricPoint = new MetricPoint ( this , this . aggType , sortedTags . KeyValuePairs , this . histogramBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale ) ;
497+ metricPoint = new MetricPoint ( this , this . aggType , sortedTags . KeyValuePairs , this . histogramExplicitBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale ) ;
498498
499499 // Add to dictionary *after* initializing MetricPoint
500500 // as other threads can start writing to the
@@ -543,7 +543,7 @@ private int LookupAggregatorStore(KeyValuePair<string, object?>[] tagKeysAndValu
543543 }
544544
545545 ref var metricPoint = ref this . metricPoints [ aggregatorIndex ] ;
546- metricPoint = new MetricPoint ( this , this . aggType , givenTags . KeyValuePairs , this . histogramBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale ) ;
546+ metricPoint = new MetricPoint ( this , this . aggType , givenTags . KeyValuePairs , this . histogramExplicitBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale ) ;
547547
548548 // Add to dictionary *after* initializing MetricPoint
549549 // as other threads can start writing to the
@@ -619,7 +619,7 @@ private int LookupAggregatorStoreForDeltaWithReclaim(KeyValuePair<string, object
619619 lookupData = new LookupData ( index , sortedTags , givenTags ) ;
620620
621621 ref var metricPoint = ref this . metricPoints [ index ] ;
622- metricPoint = new MetricPoint ( this , this . aggType , sortedTags . KeyValuePairs , this . histogramBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale , lookupData ) ;
622+ metricPoint = new MetricPoint ( this , this . aggType , sortedTags . KeyValuePairs , this . histogramExplicitBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale , lookupData ) ;
623623 newMetricPointCreated = true ;
624624
625625 // Add to dictionary *after* initializing MetricPoint
@@ -665,7 +665,7 @@ private int LookupAggregatorStoreForDeltaWithReclaim(KeyValuePair<string, object
665665 lookupData = new LookupData ( index , Tags . EmptyTags , givenTags ) ;
666666
667667 ref var metricPoint = ref this . metricPoints [ index ] ;
668- metricPoint = new MetricPoint ( this , this . aggType , givenTags . KeyValuePairs , this . histogramBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale , lookupData ) ;
668+ metricPoint = new MetricPoint ( this , this . aggType , givenTags . KeyValuePairs , this . histogramExplicitBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale , lookupData ) ;
669669 newMetricPointCreated = true ;
670670
671671 // Add to dictionary *after* initializing MetricPoint
@@ -776,7 +776,7 @@ private bool TryGetAvailableMetricPointRare(
776776 lookupData = new LookupData ( index , sortedTags , givenTags ) ;
777777
778778 ref var metricPoint = ref this . metricPoints [ index ] ;
779- metricPoint = new MetricPoint ( this , this . aggType , sortedTags . KeyValuePairs , this . histogramBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale , lookupData ) ;
779+ metricPoint = new MetricPoint ( this , this . aggType , sortedTags . KeyValuePairs , this . histogramExplicitBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale , lookupData ) ;
780780 newMetricPointCreated = true ;
781781
782782 // Add to dictionary *after* initializing MetricPoint
@@ -807,7 +807,7 @@ private bool TryGetAvailableMetricPointRare(
807807 lookupData = new LookupData ( index , Tags . EmptyTags , givenTags ) ;
808808
809809 ref var metricPoint = ref this . metricPoints [ index ] ;
810- metricPoint = new MetricPoint ( this , this . aggType , givenTags . KeyValuePairs , this . histogramBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale , lookupData ) ;
810+ metricPoint = new MetricPoint ( this , this . aggType , givenTags . KeyValuePairs , this . histogramExplicitBounds , this . exponentialHistogramMaxSize , this . exponentialHistogramMaxScale , lookupData ) ;
811811 newMetricPointCreated = true ;
812812
813813 // Add to dictionary *after* initializing MetricPoint
0 commit comments