Skip to main content

MeasurePlan

Struct MeasurePlan 

Source
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

Source

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.

Source

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.

Source

pub fn warmup(&self) -> u64

Number of ticks stepped before the first sample.

Source

pub fn total(&self) -> u64

Tick a run ends on unless it stops sooner, the warm-up included.

Source

pub fn stats_every(&self) -> u64

Ticks between two samples, counted from the end of the warm-up.

Source

pub fn series_every(&self) -> u64

Ticks between two rows of the series, or 0 when no series is kept.

Source

pub fn columns(&self) -> &StatColumns

Stat layout every sample is read into.

Source

pub fn reducers(&self) -> &ReducerPlan

Reducers bound to Self::columns.

Source

pub fn stop(&self) -> Option<&StopCondition>

Stop condition bound to Self::columns, if the run has one.

Source

pub fn first_sample(&self) -> u64

First sampled tick.

Source

pub fn next_sample(&self, tick: u64) -> Option<u64>

Returns the first sampled tick after tick, or None from the total on.

Source

pub fn is_sample(&self, tick: u64) -> bool

Returns whether a run samples tick.

Source

pub fn sample_ticks(&self) -> impl Iterator<Item = u64> + '_

Returns every sampled tick in order.

Source

pub fn sample_count(&self) -> u64

Number of samples in a run that reaches the total.

Source

pub fn series_row_count(&self) -> u64

Number of series rows kept by a run that reaches the total.

Trait Implementations§

Source§

impl Clone for MeasurePlan

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MeasurePlan

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for MeasurePlan

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MeasurePlan

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSync for T
where T: Sync,