pub struct AtomicSamplingReservoir { /* private fields */ }
Available on crate feature
storage
only.Expand description
An atomic sampling reservoir.
Reservoir sampling is a technique used to produce a statistically representative sample of a data stream, in a
fixed space, without knowing the length of the stream in advance. AtomicSamplingReservoir
is a thread-safe version of a
sampling reservoir, based on Vitter’s “Algorithm R”.
Utilizes an A/B-based storage mechanism to avoid contention between producers and the consumer, and a fast, thread-local PRNG (Xoshiro256**) to limit the per-call sampling overhead.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AtomicSamplingReservoir
impl RefUnwindSafe for AtomicSamplingReservoir
impl Send for AtomicSamplingReservoir
impl Sync for AtomicSamplingReservoir
impl Unpin for AtomicSamplingReservoir
impl UnwindSafe for AtomicSamplingReservoir
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