Struct hdrhistogram::Histogram
[−]
[src]
pub struct Histogram { // some fields omitted }
Methods
impl Histogram
[src]
Instance of a Histogram.
fn init(lowest_trackable_value: u64, highest_trackable_value: u64, significant_figures: u32) -> Result<Histogram, HistoErr>
Create a new Histogram instance. lowest_trackable_value
..highest_trackable_value
defines
the range of values in the Histogram
. lowest_trackable_value
must be >= 1.
significant_figures
defines the precision, and must be in the range 1..5.
HistoErr
is the catch-all failure case. It doesn't report much detail because the
underlying library doesn't.
fn reset(&mut self)
Zero all histogram state in place.
fn get_memory_size(&self) -> usize
Return allocation size.
fn get_counts_len(&self) -> u32
Return number of counters.
fn total_count(&self) -> u64
Total of all counters
fn record_value(&mut self, value: u64) -> bool
Record a specific value. Returns true if successful.
fn record_values(&mut self, value: u64, count: u64) -> bool
Record multiple counts of a specific value. Returns true if successful.
fn record_corrected_value(&mut self, value: u64, expected_interval: u64) -> bool
Record a value, correcting for coordinated omission. This should be used when accumulating latency measurements taked on a regular timebase (expected_interval). Any latency that's well above that interval implies some kind of outage in which sampled were lost. This corrects for those lost samples to preserve the integrity of the overall statistics.
fn record_corrected_values(&mut self, value: u64, count: u64, expected_interval: u64) -> bool
As with record_corrected_value()
but multiple counts of the value.
fn add(&mut self, other: &Histogram) -> u64
Sum two histograms, modifying self
in place. Returns the number of samples dropped;
samples will be dropped if they're out of the range lowest_trackable_value .. highest_trackable_value
.
fn add_while_correcting_for_coordinated_omission(&mut self, other: &Histogram, expected_interval: u64) -> u64
As with add
but corrects of potential lost samples while doing periodic latency
measurements, as in record_corrected_value
. Only one correction should be applied.
fn min(&self) -> u64
Smallest recorded value.
fn max(&self) -> u64
Largest recorded value.
fn value_at_percentile(&self, percentile: f64) -> u64
Value at a particular percentile (0-100).
fn stddev(&self) -> f64
Standard deviation of values.
fn mean(&self) -> f64
Mean of values.
fn values_are_equivalent(&self, a: u64, b: u64) -> bool
Returns true if two values are the same according to the lowest, highest and significant figures parameters.
fn lowest_equivalent_value(&self, value: u64) -> u64
Lowest value equivalent to the given value.
fn count_at_value(&self, value: u64) -> u64
Count for a specific value.
fn linear_iter<'a>(&'a self, value_units_per_bucket: u64) -> LinearIter<'a>
Linear iterator over values. Results are returned in equally weighted buckets.
fn log_iter<'a>(&'a self, value_units_per_bucket: u64, log_base: f64) -> LogIter<'a>
Logarithmic iterator over values. Results are returned in logarithmically weighted buckets.
fn recorded_iter<'a>(&'a self) -> RecordedIter<'a>
Iterator over recorded values.
fn percentile_iter<'a>(&'a self, ticks_per_half_distance: u32) -> PercentileIter<'a>
Iterator over percentiles.
Trait Implementations
impl Drop for Histogram
[src]
impl Clone for Histogram
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more