Crate openhistogram

Crate openhistogram 

Source
Expand description

An implementation of the OpenHistogram log-linear histogram specification.

Use this crate for high-performance, high-volume measurement recording and analysis.

§Examples

// Create a new empty histogram
let mut perf = openhistogram::Histogram::new();
 
// Instrument a function
fn some_interesting_function() {
    let start = std::time::Instant::now();
    // do some work
    let finish = std::time::Instant::now();
    perf.insert(finish.duration_since(start), 1);
}
 
// Analyze
println!("Average call time: {}s, 99th-percentile: {}s", perf.mean(), perf.quantile1(&[0.99])?[0]);

Structs§

Bin
A Bin represent a log(10)-linear range in some unitless value domain.
Histogram
A distribution histogram containing sample counts in base 10 log-linear Bins.

Enums§

Error
QuantileType
The QuantileType represents various methodologies for calculating quantiles.

Constants§

NAN_BIN
NAN_BIN is a solitary Bin for accumulations on values that cannot be expressed in the OpenHistogram log-linear binning system. This can happen because the value being inserted into this histogram falls outside of a recognized range.