pub struct MeasurePlan { /* private fields */ }Expand description
Sampled ticks of a run, and the columns, reducers and stop condition each sample feeds.
A run samples tick warmup + j * stats_every for every j that does not pass the total, and the total itself.
Implementations§
Source§impl MeasurePlan
impl MeasurePlan
Sourcepub fn check(
run: &RunSettings,
measure: &MeasureSettings,
) -> Result<(), MeasureError>
pub fn check( run: &RunSettings, measure: &MeasureSettings, ) -> Result<(), MeasureError>
Checks the length and timeout of run, the cadence of measure, the threshold of every comparison and every
window, before any column is known.
§Errors
Returns MeasureError when the total tick count overflows, the timeout cannot be read back from the seconds
that a spec file records, stats_every is 0, series_every is not a multiple of stats_every, the stop
condition or a first reducer compares against a threshold that is not finite, or a mean@ reducer’s window
ends before it starts.
Sourcepub fn new(
run: &RunSettings,
measure: &MeasureSettings,
columns: StatColumns,
) -> Result<Self, MeasureError>
pub fn new( run: &RunSettings, measure: &MeasureSettings, columns: StatColumns, ) -> Result<Self, MeasureError>
Returns the plan for runs of run sampled as measure specifies, over the stat layout columns.
§Errors
Returns MeasureError when Self::check rejects the settings, or a reducer or the stop condition does
not bind to columns.
Sourcepub fn stats_every(&self) -> u64
pub fn stats_every(&self) -> u64
Ticks between two samples, counted from the end of the warm-up.
Sourcepub fn series_every(&self) -> u64
pub fn series_every(&self) -> u64
Ticks between two rows of the series, or 0 when no series is kept.
Sourcepub fn columns(&self) -> &StatColumns
pub fn columns(&self) -> &StatColumns
Stat layout every sample is read into.
Sourcepub fn reducers(&self) -> &ReducerPlan
pub fn reducers(&self) -> &ReducerPlan
Reducers bound to Self::columns.
Sourcepub fn stop(&self) -> Option<&StopCondition>
pub fn stop(&self) -> Option<&StopCondition>
Stop condition bound to Self::columns, if the run has one.
Sourcepub fn first_sample(&self) -> u64
pub fn first_sample(&self) -> u64
First sampled tick.
Sourcepub fn next_sample(&self, tick: u64) -> Option<u64>
pub fn next_sample(&self, tick: u64) -> Option<u64>
Returns the first sampled tick after tick, or None from the total on.
Sourcepub fn sample_ticks(&self) -> impl Iterator<Item = u64> + '_
pub fn sample_ticks(&self) -> impl Iterator<Item = u64> + '_
Returns every sampled tick in order.
Sourcepub fn sample_count(&self) -> u64
pub fn sample_count(&self) -> u64
Number of samples in a run that reaches the total.
Sourcepub fn series_row_count(&self) -> u64
pub fn series_row_count(&self) -> u64
Number of series rows kept by a run that reaches the total.