pub struct AdaptiveSampler { /* private fields */ }
Expand description
Adaptive sampler for load shedding
Implementations§
Source§impl AdaptiveSampler
impl AdaptiveSampler
Sourcepub fn new(strategy: SamplingStrategy) -> Self
pub fn new(strategy: SamplingStrategy) -> Self
Create new sampler with strategy
Sourcepub fn should_sample(&self) -> bool
pub fn should_sample(&self) -> bool
Check if sample should be taken
Sourcepub fn current_rate(&self) -> u32
pub fn current_rate(&self) -> u32
Get current sampling rate
Sourcepub fn is_overloaded(&self) -> bool
pub fn is_overloaded(&self) -> bool
Check if system is overloaded
Auto Trait Implementations§
impl !Freeze for AdaptiveSampler
impl !RefUnwindSafe for AdaptiveSampler
impl Send for AdaptiveSampler
impl Sync for AdaptiveSampler
impl Unpin for AdaptiveSampler
impl UnwindSafe for AdaptiveSampler
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