Struct metriken::histogram::RwLockHistogram
source · pub struct RwLockHistogram { /* private fields */ }
Expand description
A histogram that uses free-running non-atomic counters to track the
distribution of values. They are only useful for bulk recording of values
and producing [crate::Snapshot
]s of the histogram state which can then be
used for reporting.
The AtomicHistogram
should be preferred when individual events are being
recorded. The RwLockHistogram
should be preferred when bulk-updating the
histogram from pre-aggregated data with a compatible layout.
Implementations§
source§impl RwLockHistogram
impl RwLockHistogram
sourcepub const fn new(grouping_power: u8, max_value_power: u8) -> Self
pub const fn new(grouping_power: u8, max_value_power: u8) -> Self
Create a new ::histogram::AtomicHistogram
with the given parameters.
§Panics
This will panic if the grouping_power
and max_value_power
do not
adhere to the following constraints:
max_value_power
must be in the range 1..=64grouping_power
must be in the range0..=(max_value_power - 1)
sourcepub fn update_from(&self, data: &[u64]) -> Result<(), Error>
pub fn update_from(&self, data: &[u64]) -> Result<(), Error>
Updates the histogram counts from raw data.
pub fn config(&self) -> Config
Trait Implementations§
source§impl Metric for RwLockHistogram
impl Metric for RwLockHistogram
source§fn as_any(&self) -> Option<&dyn Any>
fn as_any(&self) -> Option<&dyn Any>
Get the current metric as an
Any
instance. This is meant to allow
custom processing for known metric types.source§fn value(&self) -> Option<Value<'_>>
fn value(&self) -> Option<Value<'_>>
Get the value of the current metric, should it be enabled. Read more
source§fn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Indicate whether this metric has been set up. Read more
Auto Trait Implementations§
impl !Freeze for RwLockHistogram
impl !RefUnwindSafe for RwLockHistogram
impl Send for RwLockHistogram
impl Sync for RwLockHistogram
impl Unpin for RwLockHistogram
impl UnwindSafe for RwLockHistogram
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