pub enum SamplingValue {
SampleRate {
value: f64,
},
Factor {
value: f64,
},
Reservoir {
limit: i64,
},
}
Expand description
A sampling strategy definition.
A sampling strategy refers to the strategy that we want to use for sampling a specific rule.
Variants§
SampleRate
A direct sample rate to apply.
A rule with a sample rate will be matched and the final sample rate will be computed by multiplying its sample rate with the accumulated factors from previous rules.
Factor
A factor to apply on a subsequently matching rule.
A rule with a factor will be matched and the matching will continue onto the next rules until a sample rate rule is found. The matched rule’s factor will be multiplied with the accumulated factors before moving onto the next possible match.
Reservoir
A reservoir limit.
A rule with a reservoir limit will be sampled if the rule have been matched fewer times than the limit.
Trait Implementations§
source§impl Clone for SamplingValue
impl Clone for SamplingValue
source§fn clone(&self) -> SamplingValue
fn clone(&self) -> SamplingValue
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SamplingValue
impl Debug for SamplingValue
source§impl<'de> Deserialize<'de> for SamplingValue
impl<'de> Deserialize<'de> for SamplingValue
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for SamplingValue
impl PartialEq for SamplingValue
source§impl Serialize for SamplingValue
impl Serialize for SamplingValue
impl Copy for SamplingValue
impl StructuralPartialEq for SamplingValue
Auto Trait Implementations§
impl Freeze for SamplingValue
impl RefUnwindSafe for SamplingValue
impl Send for SamplingValue
impl Sync for SamplingValue
impl Unpin for SamplingValue
impl UnwindSafe for SamplingValue
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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