RunningInteger

Struct RunningInteger 

Source
pub struct RunningInteger { /* private fields */ }
Expand description

RunningInteger provides basic statistics on a stream of integer data samples.

See the module comments for a sample program.

Implementations§

Source§

impl RunningInteger

Source

pub fn new(name: &str, print_opts: &PrintOption) -> RunningInteger

Creates a new RunningInteger instance with the given name and an optional set of print options.

Source

pub fn new_from_exporter( name: &str, title: &str, print_opts: &PrintOption, import: Export, ) -> RunningInteger

Creates a RunningInteger instance by summing data from a list of instances.

Source

pub fn export_data(&self) -> Export

Exports all the statistics kept for a given instance to be used to create a sum of many instances.

Source

pub fn set_units(&mut self, units: Units)

Source

pub fn get_printable(&self) -> Printable

Trait Implementations§

Source§

impl Clone for RunningInteger

Source§

fn clone(&self) -> RunningInteger

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl HierMember for RunningInteger

Source§

fn to_rustics(&self) -> &dyn Rustics

Source§

fn to_rustics_mut(&mut self) -> &mut dyn Rustics

Source§

fn as_any(&self) -> &dyn Any

Source§

fn as_any_mut(&mut self) -> &mut dyn Any

Source§

fn to_histogram(&self) -> &dyn Histogram

Source§

impl Histogram for RunningInteger

Source§

fn print_histogram(&self, printer: &mut dyn Printer)

Prints the histogram on the given Printer instance.
Source§

fn clear_histogram(&mut self)

Clears the histogram data.
Source§

fn to_log_histogram(&self) -> Option<LogHistogramBox>

Returns the corresponding LogHistogramBox if possible.
Source§

fn to_float_histogram(&self) -> Option<FloatHistogramBox>

Returns the corresponding FloatHistogramBox if possible.
Source§

impl Rustics for RunningInteger

Source§

fn record_i64(&mut self, sample: i64)

Records an i64 sample, if allowed by the implementation. Time-based statistics do not support this method.
Source§

fn record_f64(&mut self, _sample: f64)

Records an f64 value.
Source§

fn record_event(&mut self)

Records an event. This method is implementation-specific in meaning. For the Counter type, it is is equivalent to record_i64(1). Read more
Source§

fn record_event_report(&mut self) -> i64

Source§

fn record_time(&mut self, _sample: i64)

Records a time in ticks. This method will panic if the underlying type is not a time statistic.
Source§

fn record_interval(&mut self, _timer: &mut TimerBox)

Records a time interval by reading the given TimerBox instance. This method will panic if the underlying type is not a time statistic.
Source§

fn name(&self) -> String

Returns the name passed on instance creation.
Source§

fn title(&self) -> String

Returns the default title used for printing. The Rc and ArcSet implementation create hierarchical titles for members of the set. This function can be used to retrieve them.
Source§

fn class(&self) -> &str

Returns the class of the statistic. Currently, “integer”, “counter”, “float”, and “time” classes exist.
Source§

fn count(&self) -> u64

Returns the count of samples used to create the summary statistics like the mean.
Source§

fn log_mode(&self) -> isize

Returns the most common pseudo-log seen in the data samples. This method is supported only for integer and time types.
Source§

fn mean(&self) -> f64

Returns the mean of the samples in the instance.
Source§

fn standard_deviation(&self) -> f64

Returns the standard deviation of the samples in the instance.
Source§

fn variance(&self) -> f64

Returns the variance of the samples in the instance.
Source§

fn skewness(&self) -> f64

Returns the skewness of the samples in the instance.
Source§

fn kurtosis(&self) -> f64

Returns the kurtosis of the samples in the instance.
Source§

fn precompute(&mut self)

Precomputes the summary data of the samples. This is useful when implementing custom print functions or querying multiple summary statistics like the mean or skewness. The window-based Rustics types will cache the result of data analysis so it need not be redone each time a summary statistic is retrieved.
Source§

fn int_extremes(&self) -> bool

Returns a boolean indicating whether the underlying type supports the min_i64() and max_i64() methods.
Source§

fn float_extremes(&self) -> bool

Returns a boolean indicating whether the underlying type supports the min_f64() and max_f64() methods.
Source§

fn min_i64(&self) -> i64

Returns the minimum of the sample space for an integer or time type. Time statistics return a value in ticks.
Source§

fn max_i64(&self) -> i64

Returns the maximum of the sample space for an integer or time type. Time statistics return a value in ticks.
Source§

fn min_f64(&self) -> f64

Returns the minimum of the sample space for an f64 type.
Source§

fn max_f64(&self) -> f64

Returns the maximum of the sample space for an f64 type.
Source§

fn clear(&mut self)

Clears the data in the instance.
Source§

fn log_histogram(&self) -> Option<LogHistogramBox>

Returns a LogHistogramBox for the histogram if possible.
Source§

fn float_histogram(&self) -> Option<FloatHistogramBox>

Returns a FloatHistogramBox for the histogram if possible.
Source§

fn print(&self)

Prints the statistics with the default options.
Source§

fn print_opts(&self, printer: PrinterOption, title: Option<&str>)

Prints the statistics with the printer and title as given.
Source§

fn set_title(&mut self, title: &str)

Source§

fn equals(&self, other: &dyn Rustics) -> bool

Source§

fn generic(&self) -> &dyn Any

Source§

fn set_id(&mut self, id: usize)

Source§

fn id(&self) -> usize

Source§

fn export_stats(&self) -> ExportStats

Returns the statistics for the sample stream.

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 = 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>,

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.