#histogram #statistics

openhistogram

Fast, dense, stable auto-binning histograms

2 releases

new 0.1.1 Feb 3, 2025
0.1.0 Feb 3, 2025

#764 in Math

Apache-2.0

60KB
1.5K SLoC

OpenHistograms for Rust

This repository holds the rust implementation of OpenHistograms.


lib.rs:

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]);

Dependencies

~2.1–2.9MB
~52K SLoC