pub enum SamplingStrategy {
None,
Random {
size: usize,
},
Reservoir {
size: usize,
},
Systematic {
interval: usize,
},
}Expand description
How rows are selected for profiling.
Strategies divide into two families, which differ in cost.
Systematic decides each row as it arrives and adds no
memory. Random and Reservoir cannot
know the final sample until the source ends, so they hold size rows in
memory and the profile is computed from that buffer.
Every strategy is applied by RowSampler.
Variants§
None
No sampling - analyze all data
Random
A uniform random sample of exactly size rows (or every row, when the
source is shorter).
Over a source of unknown length this is reservoir sampling, so it holds
size rows in memory and is equivalent to
Reservoir; both names are kept because both are
familiar.
Reservoir
A uniform random sample of exactly size rows, selected with Algorithm
R over a single pass.
Holds size rows in memory: membership is not final until the source
ends, and statistics folded in earlier could not be retracted.
Systematic
Every interval-th row, starting at the first.
Implementations§
Source§impl SamplingStrategy
impl SamplingStrategy
Sourcepub fn description(&self) -> String
pub fn description(&self) -> String
Get description of the sampling strategy
Trait Implementations§
Source§impl Clone for SamplingStrategy
impl Clone for SamplingStrategy
Source§fn clone(&self) -> SamplingStrategy
fn clone(&self) -> SamplingStrategy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SamplingStrategy
impl RefUnwindSafe for SamplingStrategy
impl Send for SamplingStrategy
impl Sync for SamplingStrategy
impl Unpin for SamplingStrategy
impl UnsafeUnpin for SamplingStrategy
impl UnwindSafe for SamplingStrategy
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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