pub struct Options {
    pub first_checkpoint: u64,
    pub max_checkpoint_size: Option<u64>,
    pub delay: u64,
    pub max_scale_factor: f64,
}
Expand description

Optional parameters for creating a new progress observer.

Fields§

§first_checkpoint: u64

Number of ticks before sending the first report.

Typically not necessary to set manually; the default starting checkpoint size of 1 should be sufficient for most workloads, and the checkpoint size should adjust automatically within 1-3 prints to adapt to the workload you’re performing. In some cases, if the initial iterations have a moderately chaotic execution time, setting this value higher than 1 will prevent the first checkpoint estimate from being excessively large. If the reporter seems to fail to work properly using the default settings, adjust this value up as a first fix. Specify if you have a general estimate for how many iterations will pass within the timeframe of your specified frequency target.

§max_checkpoint_size: Option<u64>

Specify a maximum number of ticks to wait for in between observations.

In some instances, such as during particularly chaotic computations, the observer could erroneously derive an exceedingly large size for the next potential checkpoint. In those situations, you might want to specify a maximum number of ticks between progress reports, so that the observer doesn’t get stuck waiting indefinitely after a bad next checkpoint estimate.

§delay: u64

Delay observations for this many initial ticks.

Sometimes your computation needs time to “warm up”, where the first 1 or 2 iterations may take significantly longer to process than all subsequent ones. This may throw off the checkpoint estimation. Specify this argument to ignore the first n ticks processed, only beginning to record progress after they have elapsed.

§max_scale_factor: f64

Maximum factor that subsequent checkpoints are allowed to increase in size by.

Intended to prevent sudden large jumps in checkpoint size between reports. The default value of 2 is generally fine for most cases. Panics if the factor is set less than 1.

Trait Implementations§

source§

impl Default for Options

source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.