Skip to content

Commit fcada17

Browse files
authored
Use ValueMap for Histogram- Throughput increased by 5x (#2033)
1 parent 7742587 commit fcada17

File tree

7 files changed

+281
-175
lines changed

7 files changed

+281
-175
lines changed

opentelemetry-sdk/benches/metric_histogram.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
RAM: 64.0 GB
77
| Test | Average time|
88
|--------------------------------|-------------|
9-
| Histogram_Record | 509.21 ns |
9+
| Histogram_Record | 193.04 ns |
1010
1111
*/
1212

opentelemetry-sdk/src/metrics/internal/aggregate.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
use std::{marker, sync::Arc};
22

3-
use once_cell::sync::Lazy;
43
use opentelemetry::KeyValue;
54

6-
use crate::metrics::{
7-
data::{Aggregation, Gauge, Temporality},
8-
AttributeSet,
9-
};
5+
use crate::metrics::data::{Aggregation, Gauge, Temporality};
106

117
use super::{
128
exponential_histogram::ExpoHistogram,
@@ -17,10 +13,6 @@ use super::{
1713
};
1814

1915
const STREAM_CARDINALITY_LIMIT: u32 = 2000;
20-
pub(crate) static STREAM_OVERFLOW_ATTRIBUTE_SET: Lazy<AttributeSet> = Lazy::new(|| {
21-
let key_values: [KeyValue; 1] = [KeyValue::new("otel.metric.overflow", "true")];
22-
AttributeSet::from(&key_values[..])
23-
});
2416

2517
/// Checks whether aggregator has hit cardinality limit for metric streams
2618
pub(crate) fn is_under_cardinality_limit(size: usize) -> bool {

0 commit comments

Comments
 (0)