pub struct AdaptiveSampler { /* private fields */ }Expand description
Adaptive sampler for high-frequency data
Implementations§
Source§impl AdaptiveSampler
impl AdaptiveSampler
pub fn new(max_samples: usize) -> Self
pub async fn should_sample(&self) -> bool
pub async fn add_sample( &self, cpu_percent: f32, memory_bytes: u64, request_count: u32, )
pub async fn get_sampling_rate(&self) -> f32
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AdaptiveSampler
impl !UnwindSafe for AdaptiveSampler
impl Freeze for AdaptiveSampler
impl Send for AdaptiveSampler
impl Sync for AdaptiveSampler
impl Unpin for AdaptiveSampler
impl UnsafeUnpin 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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more