diff --git a/opentelemetry-sdk/src/metrics/internal/histogram.rs b/opentelemetry-sdk/src/metrics/internal/histogram.rs index 4da6144c2f..849684fcbd 100644 --- a/opentelemetry-sdk/src/metrics/internal/histogram.rs +++ b/opentelemetry-sdk/src/metrics/internal/histogram.rs @@ -14,7 +14,7 @@ struct HistogramTracker { buckets: Mutex>, } -impl Aggregator for HistogramTracker +impl Aggregator for HistogramTracker where T: Number, { @@ -88,7 +88,7 @@ impl Buckets { /// Summarizes a set of measurements as a histogram with explicitly defined /// buckets. pub(crate) struct Histogram { - value_map: ValueMap>, + value_map: ValueMap>, bounds: Vec, record_min_max: bool, record_sum: bool, diff --git a/opentelemetry-sdk/src/metrics/internal/last_value.rs b/opentelemetry-sdk/src/metrics/internal/last_value.rs index e4c9433f9a..aa6aef0bd3 100644 --- a/opentelemetry-sdk/src/metrics/internal/last_value.rs +++ b/opentelemetry-sdk/src/metrics/internal/last_value.rs @@ -17,7 +17,7 @@ where pub(crate) value: T::AtomicTracker, } -impl Aggregator for Assign +impl Aggregator for Assign where T: Number, { @@ -37,7 +37,7 @@ where /// Summarizes a set of measurements as the last one made. pub(crate) struct LastValue { - value_map: ValueMap>, + value_map: ValueMap>, start: Mutex, } diff --git a/opentelemetry-sdk/src/metrics/internal/mod.rs b/opentelemetry-sdk/src/metrics/internal/mod.rs index 6b5470f633..d10ceab34f 100644 --- a/opentelemetry-sdk/src/metrics/internal/mod.rs +++ b/opentelemetry-sdk/src/metrics/internal/mod.rs @@ -22,10 +22,7 @@ use crate::metrics::AttributeSet; pub(crate) static STREAM_OVERFLOW_ATTRIBUTES: Lazy> = Lazy::new(|| vec![KeyValue::new("otel.metric.overflow", "true")]); -pub(crate) trait Aggregator -where - T: Number, -{ +pub(crate) trait Aggregator { /// A static configuration that is needed in order to initialize aggregator. /// E.g. bucket_size at creation time . type InitConfig; @@ -46,10 +43,9 @@ where /// /// This structure is parametrized by an `Operation` that indicates how /// updates to the underlying value trackers should be performed. -pub(crate) struct ValueMap +pub(crate) struct ValueMap where - T: Number, - A: Aggregator, + A: Aggregator, { /// Trackers store the values associated with different attribute sets. trackers: RwLock, Arc>>, @@ -63,10 +59,9 @@ where config: A::InitConfig, } -impl ValueMap +impl ValueMap where - T: Number, - A: Aggregator, + A: Aggregator, { fn new(config: A::InitConfig) -> Self { ValueMap { diff --git a/opentelemetry-sdk/src/metrics/internal/precomputed_sum.rs b/opentelemetry-sdk/src/metrics/internal/precomputed_sum.rs index f08f70b73e..977c7d4a88 100644 --- a/opentelemetry-sdk/src/metrics/internal/precomputed_sum.rs +++ b/opentelemetry-sdk/src/metrics/internal/precomputed_sum.rs @@ -11,7 +11,7 @@ use std::{ /// Summarizes a set of pre-computed sums as their arithmetic sum. pub(crate) struct PrecomputedSum { - value_map: ValueMap>, + value_map: ValueMap>, monotonic: bool, start: Mutex, reported: Mutex, T>>, diff --git a/opentelemetry-sdk/src/metrics/internal/sum.rs b/opentelemetry-sdk/src/metrics/internal/sum.rs index 17d81ca262..34044020b8 100644 --- a/opentelemetry-sdk/src/metrics/internal/sum.rs +++ b/opentelemetry-sdk/src/metrics/internal/sum.rs @@ -17,7 +17,7 @@ where value: T::AtomicTracker, } -impl Aggregator for Increment +impl Aggregator for Increment where T: Number, { @@ -37,7 +37,7 @@ where /// Summarizes a set of measurements made as their arithmetic sum. pub(crate) struct Sum { - value_map: ValueMap>, + value_map: ValueMap>, monotonic: bool, start: Mutex, }