Skip to content

Commit c111744

Browse files
committed
exponentrial
1 parent 0813ad8 commit c111744

File tree

2 files changed

+16
-4
lines changed
  • opentelemetry-proto/src/transform
  • opentelemetry-sdk/src/metrics/data

2 files changed

+16
-4
lines changed

opentelemetry-proto/src/transform/metrics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ pub mod tonic {
258258
}),
259259
flags: TonicDataPointFlags::default() as u32,
260260
exemplars: dp.exemplars().map(Into::into).collect(),
261-
min: dp.min.map(Numeric::into_f64),
262-
max: dp.max.map(Numeric::into_f64),
261+
min: dp.min().map(Numeric::into_f64),
262+
max: dp.max().map(Numeric::into_f64),
263263
zero_threshold: dp.zero_threshold(),
264264
})
265265
.collect(),

opentelemetry-sdk/src/metrics/data/mod.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,9 @@ pub struct ExponentialHistogramDataPoint<T> {
448448
/// The number of updates this histogram has been calculated with.
449449
pub(crate) count: usize,
450450
/// The minimum value recorded.
451-
pub min: Option<T>,
451+
pub(crate) min: Option<T>,
452452
/// The maximum value recorded.
453-
pub max: Option<T>,
453+
pub(crate) max: Option<T>,
454454
/// The sum of the values recorded.
455455
pub(crate) sum: T,
456456

@@ -531,6 +531,18 @@ impl<T> ExponentialHistogramDataPoint<T> {
531531
}
532532
}
533533

534+
impl <T: Copy> ExponentialHistogramDataPoint<T> {
535+
/// Returns the minimum value recorded.
536+
pub fn min(&self) -> Option<T> {
537+
self.min
538+
}
539+
540+
/// Returns the maximum value recorded.
541+
pub fn max(&self) -> Option<T> {
542+
self.max
543+
}
544+
}
545+
534546
/// A set of bucket counts, encoded in a contiguous array of counts.
535547
#[derive(Debug, Clone, PartialEq)]
536548
pub struct ExponentialBucket {

0 commit comments

Comments
 (0)