We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e221c1 commit 53e892aCopy full SHA for 53e892a
opentelemetry-sdk/src/metrics/internal/histogram.rs
@@ -74,9 +74,15 @@ pub(crate) struct Histogram<T: Number> {
74
}
75
76
impl<T: Number> Histogram<T> {
77
+ #[allow(unused_mut)]
78
pub(crate) fn new(mut bounds: Vec<f64>, record_min_max: bool, record_sum: bool) -> Self {
- bounds.retain(|v| !v.is_nan());
79
- bounds.sort_by(|a, b| a.partial_cmp(b).expect("NaNs filtered out"));
+ #[cfg(feature = "spec_unstable_metrics_views")]
80
+ {
81
+ // TODO: When views are used, validate this upfront
82
+ bounds.retain(|v| !v.is_nan());
83
+ bounds.sort_by(|a, b| a.partial_cmp(b).expect("NaNs filtered out"));
84
+ }
85
+
86
let buckets_count = bounds.len() + 1;
87
Histogram {
88
value_map: ValueMap::new(buckets_count),
0 commit comments