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
impl RunningInteger
Sourcepub fn new(name: &str, print_opts: &PrintOption) -> RunningInteger
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.
Sourcepub fn new_from_exporter(
name: &str,
title: &str,
print_opts: &PrintOption,
import: Export,
) -> RunningInteger
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.
Sourcepub fn export_data(&self) -> Export
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.
pub fn set_units(&mut self, units: Units)
pub fn get_printable(&self) -> Printable
Trait Implementations§
Source§impl Clone for RunningInteger
impl Clone for RunningInteger
Source§fn clone(&self) -> RunningInteger
fn clone(&self) -> RunningInteger
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl HierMember for RunningInteger
impl HierMember for RunningInteger
fn to_rustics(&self) -> &dyn Rustics
fn to_rustics_mut(&mut self) -> &mut dyn Rustics
fn as_any(&self) -> &dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
fn to_histogram(&self) -> &dyn Histogram
Source§impl Histogram for RunningInteger
impl Histogram for RunningInteger
Source§fn print_histogram(&self, printer: &mut dyn Printer)
fn print_histogram(&self, printer: &mut dyn Printer)
Prints the histogram on the given Printer instance.
Source§fn clear_histogram(&mut self)
fn clear_histogram(&mut self)
Clears the histogram data.
Source§fn to_log_histogram(&self) -> Option<LogHistogramBox>
fn to_log_histogram(&self) -> Option<LogHistogramBox>
Returns the corresponding LogHistogramBox if possible.
Source§fn to_float_histogram(&self) -> Option<FloatHistogramBox>
fn to_float_histogram(&self) -> Option<FloatHistogramBox>
Returns the corresponding FloatHistogramBox if possible.
Source§impl Rustics for RunningInteger
impl Rustics for RunningInteger
Source§fn record_i64(&mut self, sample: i64)
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)
fn record_f64(&mut self, _sample: f64)
Records an f64 value.
Source§fn record_event(&mut self)
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
fn record_event_report(&mut self) -> i64
Source§fn record_time(&mut self, _sample: i64)
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)
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 title(&self) -> String
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
fn class(&self) -> &str
Returns the class of the statistic. Currently, “integer”, “counter”,
“float”, and “time” classes exist.
Source§fn count(&self) -> u64
fn count(&self) -> u64
Returns the count of samples used to create the summary statistics
like the mean.
Source§fn log_mode(&self) -> isize
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 standard_deviation(&self) -> f64
fn standard_deviation(&self) -> f64
Returns the standard deviation of the samples in the instance.
Source§fn precompute(&mut self)
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
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
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
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
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 log_histogram(&self) -> Option<LogHistogramBox>
fn log_histogram(&self) -> Option<LogHistogramBox>
Returns a LogHistogramBox for the histogram if possible.
Source§fn float_histogram(&self) -> Option<FloatHistogramBox>
fn float_histogram(&self) -> Option<FloatHistogramBox>
Returns a FloatHistogramBox for the histogram if possible.
Source§fn print_opts(&self, printer: PrinterOption, title: Option<&str>)
fn print_opts(&self, printer: PrinterOption, title: Option<&str>)
Prints the statistics with the printer and title as given.
fn set_title(&mut self, title: &str)
fn equals(&self, other: &dyn Rustics) -> bool
fn generic(&self) -> &dyn Any
fn set_id(&mut self, id: usize)
fn id(&self) -> usize
Source§fn export_stats(&self) -> ExportStats
fn export_stats(&self) -> ExportStats
Returns the statistics for the sample stream.
Auto Trait Implementations§
impl Freeze for RunningInteger
impl !RefUnwindSafe for RunningInteger
impl !Send for RunningInteger
impl !Sync for RunningInteger
impl Unpin for RunningInteger
impl !UnwindSafe for RunningInteger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more