pub struct ExemplarSampler { /* private fields */ }Expand description
Sampling + squelch gate for exemplar submission.
Two independent controls compose (read live from the
ExemplarConfig cell, so a dynamic control moves them
mid-run):
rate∈ [0, 1] — the fraction of caught errors that become exemplar candidates.0.0(the default) disables the sampler entirely; the caller’s hot path pays one atomic load. The roll is DETERMINISTIC on (cycle, attempt) so runs replay.max_hz— ceiling on emitted exemplars per second. Candidates over the ceiling are squelched and COUNTED; the count drains onto the next admitted exemplar, and any leftover flushes at Debug on drop.0or non-finite = no ceiling.
Implementations§
Source§impl ExemplarSampler
impl ExemplarSampler
Sourcepub fn pinned(rate: f64, max_hz: f64) -> Self
pub fn pinned(rate: f64, max_hz: f64) -> Self
A sampler over its own private cell — the authored-pin form
(op-level retry_exemplar_* params); dynamic controls do
not move it.
A sampler over a shared cell — the default form; the cell’s
owner (the activity) wires it to the retry_exemplar_rate /
retry_exemplar_max_hz dynamic controls.
Trait Implementations§
Source§impl Drop for ExemplarSampler
impl Drop for ExemplarSampler
Auto Trait Implementations§
impl !Freeze for ExemplarSampler
impl RefUnwindSafe for ExemplarSampler
impl Send for ExemplarSampler
impl Sync for ExemplarSampler
impl Unpin for ExemplarSampler
impl UnsafeUnpin for ExemplarSampler
impl UnwindSafe for ExemplarSampler
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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