Struct hdrhistogram_c::Histogram [] [src]

pub struct Histogram { /* fields omitted */ }

Instance of a Histogram.

Methods

impl Histogram
[src]

[src]

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.

HistogramErr is the catch-all failure case. It doesn't report much detail because the underlying library doesn't.

Example

let mut h = Histogram::init(1, 100000, 2).unwrap();
h.record_value(10);  // record a single count of '10'

[src]

Zero all histogram state in place.

[src]

Record a specific value. Returns true if successful.

h.record_value(5);
assert_eq!(h.total_count(), 1);

[src]

Record multiple counts of a specific value. Returns true if successful.

h.record_values(5, 10);
assert_eq!(h.total_count(), 10);

[src]

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.

[src]

As with record_corrected_value() but multiple counts of the value.

[src]

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.

[src]

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.

[src]

Total of all counters

[src]

Smallest recorded value.

h.record_value(1);
h.record_value(5);
assert_eq!(h.min(), 1);

[src]

Largest recorded value.

h.record_value(1);
h.record_value(5);
assert_eq!(h.max(), 5);

[src]

Value at a particular percentile (0-100).

h.record_values(20, 10);
h.record_value(40);
assert_eq!(h.value_at_percentile(50.0), 20);
assert_eq!(h.value_at_percentile(99.0), 40);

[src]

Standard deviation of values.

[src]

Mean of values.

[src]

Returns true if two values are the same according to the lowest, highest and significant figures parameters.

[src]

Lowest value equivalent to the given value.

[src]

Count for a specific value.

[src]

Linear iterator over values. Results are returned in equally weighted buckets.

let mut h = Histogram::init(1, 100000, 3).unwrap();
for i in 1..100 { h.record_values(i, i); }
for (i, c) in h.linear_iter(1).enumerate() {    // 100 buckets
    println!("bucket {} = {}", i, c.count_added_in_this_iteration_step);
}

[src]

Logarithmic iterator over values. Results are returned in logarithmically weighted buckets.

[src]

Iterator over recorded values.

[src]

Iterator over percentiles.

[src]

Encode Histogram state into a Base64 encoded string.

[src]

Decode Histogram state from a Base64 string generated by encode.

Trait Implementations

impl Send for Histogram
[src]

impl Drop for Histogram
[src]

[src]

Executes the destructor for this type. Read more

impl Clone for Histogram
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more