pub enum MetricValue {
Counter(u64),
Gauge(f64),
Histogram {
samples: Vec<f64>,
bucket_bounds: Vec<f64>,
bucket_counts: Vec<u64>,
},
}
Expand description
An enumeration of possible metric values.
Variants§
Counter(u64)
A 64-bit unsigned integer for counters.
Gauge(f64)
A 64-bit float for gauges.
Histogram
A collection of samples and their distribution across predefined buckets.
Implementations§
Source§impl MetricValue
impl MetricValue
Sourcepub fn metric_type(&self) -> MetricType
pub fn metric_type(&self) -> MetricType
Returns the MetricType
corresponding to this value.
Sourcepub fn as_counter(&self) -> Option<u64>
pub fn as_counter(&self) -> Option<u64>
Returns the value as a u64
if it is a Counter
.
Trait Implementations§
Source§impl Clone for MetricValue
impl Clone for MetricValue
Source§fn clone(&self) -> MetricValue
fn clone(&self) -> MetricValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for MetricValue
impl RefUnwindSafe for MetricValue
impl Send for MetricValue
impl Sync for MetricValue
impl Unpin for MetricValue
impl UnwindSafe for MetricValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more