1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! # subms-stats
//!
//! Latency-distribution statistics for measurement-heavy workloads.
//! Pure functions on `&[u64]` sample arrays + 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.
//!
//! ## Feature flags
//!
//! The crate ships a tiny **core** that's always on (`percentile`,
//! `mean`, `stddev`) plus optional features that you opt into via Cargo:
//!
//! - `histogram` (default) - log2-spaced CDF buckets
//! - `jitter` (default) - per-window variance score
//! - `tail` (default) - CTE, Hill estimator, fatness ratio
//! - `robust` (default) - IQR, MAD, CoV, skewness, kurtosis
//! - `compare` (default) - KS statistic, Cohen's d
//! - `bootstrap` (default) - bootstrap CIs for percentiles
//!
//! Everything is on by default. For a minimal build:
//!
//! ```toml
//! [dependencies]
//! subms-stats = { version = "0.5", default-features = false }
//! ```
//!
//! Then pick only the features you need:
//!
//! ```toml
//! subms-stats = { version = "0.5", default-features = false, features = ["histogram", "tail"] }
//! ```
//!
//! ## Quickstart
//!
//! ```
//! use subms_stats::SubMsSamples;
//!
//! let raw = vec![100u64, 200, 150, 300, 250, 175, 125, 400];
//! let s = SubMsSamples::new(&raw);
//! let p99 = s.p99();
//! let _ = p99;
//! ```
// Always-on core.
// Flat re-exports for the most common entry points. Library consumers
// can use module paths (e.g. `subms_stats::tail::hill_tail_index`) or
// the flat form (e.g. `subms_stats::hill_tail_index`).
pub use ;
pub use SubMsSamples;
pub use bootstrap_percentile_ci;
pub use ;
pub use cdf_buckets;
pub use jitter_score;
pub use ;
pub use ;