pub struct NumericHistogram { /* private fields */ }Expand description
Bounded reservoir of float64 samples for response field statistics.
Fills up to max_samples, then applies Vitter’s Algorithm R reservoir
sampling so the retained set remains a uniform random sample of all
observed values.
Uses SmallRng (a Send-safe PRNG) seeded from entropy at construction
time, so instances can be sent across threads (e.g. moved into drain tasks).
Implementations§
Source§impl NumericHistogram
impl NumericHistogram
Sourcepub fn new(params: NumericHistogramParams) -> Self
pub fn new(params: NumericHistogramParams) -> Self
Creates a new histogram with the given parameters.
Sourcepub fn distribution(&self) -> Distribution
pub fn distribution(&self) -> Distribution
Returns a sorted Distribution over the retained samples.
Sourcepub fn total_seen(&self) -> usize
pub fn total_seen(&self) -> usize
Returns the total number of values observed (including those not retained).
Auto Trait Implementations§
impl Freeze for NumericHistogram
impl RefUnwindSafe for NumericHistogram
impl Send for NumericHistogram
impl Sync for NumericHistogram
impl Unpin for NumericHistogram
impl UnsafeUnpin for NumericHistogram
impl UnwindSafe for NumericHistogram
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