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