Trait telemetry::plain::Histogram [−][src]
A plain histogram.
Histograms do not implement Sync
, so an instance of Histogram
cannot be shared by several threads. However, any histogram can be
cloned as needed for concurrent use.
Performance
Cloning a histogram is relatively cheap, both in terms of memory and in terms of speed (most histograms weigh ~40bytes on a x86-64 architecture).
When the telemetry service is inactive, recording data to a
histogram is very fast (essentially a dereference and an atomic
fetch). When the telemetry service is active, the duration of
recording data is comparable to the duration of sending a simple
message to a Sender
.
Required methods
fn record_cb<F>(&self, _: F) where
F: FnOnce() -> Option<T>,
[src]
F: FnOnce() -> Option<T>,
Record a value in this histogram, as provided by a callback.
If the service is currently inactive, this is a noop.
If the callback returns None
, no value is recorded.
Provided methods
fn record(&self, value: T)
[src]
Record a value in this histogram.
If the service is currently inactive, this is a noop.
Implementors
impl Histogram<u32> for Count
[src]
impl Histogram<()> for Flag
[src]
impl<K> Histogram<K> for Enum<K> where
K: Flatten,
[src]
K: Flatten,
impl<T> Histogram<T> for Ignoring<T>
[src]
impl<T> Histogram<T> for Linear<T> where
T: Flatten,
[src]
T: Flatten,