Enum metrics_util::Handle [−][src]
pub enum Handle {
Counter(Arc<AtomicU64>),
Gauge(Arc<AtomicU64>),
Histogram(Arc<AtomicBucket<f64>>),
}
Expand description
Basic metric handle.
Provides fast, thread-safe access and storage for the three supported metric types: counters, gauges, and histograms.
Variants
A counter.
A gauge.
Histogram(Arc<AtomicBucket<f64>>)
A histogram.
Tuple Fields of Histogram
0: Arc<AtomicBucket<f64>>
Implementations
Creates a histogram handle.
The histogram handle is initialized to empty.
Increments this handle as a counter.
Panics if this handle is not a counter.
Updates this handle as a gauge.
Panics if this handle is not a gauge.
Records to this handle as a histogram.
Panics if this handle is not a histogram.
Reads this handle as a counter.
Panics if this handle is not a counter.
Reads this handle as a gauge.
Panics if this handle is not a gauge.
Reads this handle as a histogram.
Panics if this handle is not a histogram.
Reads this handle as a histogram, and whether or not it’s empty.
Panics if this handle is not a histogram.
Reads this handle as a histogram incrementally into a closure, and clears the histogram.
The closure f
passed in is invoked multiple times with slices of values present in the
histogram currently. Once all values have been read, the histogram is cleared of all values.
Panics if this handle is not a histogram.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Handle
impl !UnwindSafe for Handle
Blanket Implementations
Mutably borrows from an owned value. Read more