subms-stats 0.6.0

Latency-distribution statistics. Pure functions on &[u64] sample arrays: percentiles, log2-spaced CDF histograms, jitter score, tail analysis (CTE / Hill index / fatness ratio), robust statistics (IQR / MAD / CoV / skew / kurtosis), KS distribution comparison, Cohen's d effect size, and bootstrap confidence intervals. Zero-dependency std-only. Byte-equivalent to the Java sibling com.submillisecond:subms-stats.
Documentation
  • Coverage
  • 100%
    51 out of 51 items documented2 out of 44 items with examples
  • Size
  • Source code size: 36.59 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 604.7 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • kdog007

subms-stats

Latency-distribution statistics. Pure functions on &[u64] sample arrays plus an ergonomic SubMsSamples facade.

This is the statistics primitive the subms perf harness uses internally, published as its own crate so you can use it without pulling in the bench machinery. Bring your own Vec<u64> of nanosecond readings (from any source) and compose the analyses you need.

cargo add subms-stats

Modules / Cargo features

Feature Module What
(always on) percentiles percentile, percentile_sweep, mean, stddev
histogram histogram 64-bucket log2 CDF for full-distribution export
jitter jitter Per-window CV score - measurement-rig stability
tail tail Conditional tail expectation, Hill estimator, p99/p50 fatness
robust robust IQR, MAD, CoV, skewness, excess kurtosis
compare compare KS statistic, Cohen's d effect size
bootstrap bootstrap Reproducible bootstrap CIs for percentiles

All features are on by default. For a minimal build:

subms-stats = { version = "0.5", default-features = false }

For a focused subset:

subms-stats = { version = "0.5", default-features = false, features = ["histogram", "tail"] }

Quickstart

use subms_stats::SubMsSamples;

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

let p99 = s.p99();
let p99_to_p50_ratio = s.tail_fatness_ratio();  // tail feature
let cdf = s.cdf_buckets();                        // histogram feature
let (lo, hi) = s.bootstrap_percentile_ci(0.99, 200, 0.95, 42);  // bootstrap feature

License

Dual: MIT OR Apache-2.0.