Skip to main content

Module samples

Module samples 

Source
Expand description

Ergonomic wrapper around a borrowed &[u64] slice of nanosecond latency samples. Method-chained API for the common statistics.

The set of methods available on SubMsSamples depends on which Cargo features are enabled. Always-on: count, is_empty, raw, p50 / p99 / p999 / percentile / percentile_sweep, mean, stddev, max. Feature-gated methods are documented at their definitions.

use subms_stats::SubMsSamples;

let raw = vec![100u64, 200, 150, 300, 250, 175, 125, 400];
let s = SubMsSamples::new(&raw);
let p50 = s.p50();
let p99 = s.p99();
assert!(p99 >= p50);

Structsยง

SubMsSamples
Borrowing facade over a sample slice. Zero-cost - holds a reference only. Lazy-sorts internally on demand for percentile queries.