Skip to main content

Module stats

Module stats 

Source
Expand description

Pure helpers used by super::ProviderMetrics::all_snapshots.

Kept in their own file so the orchestration code in metrics.rs stays small and readable.

Functionsยง

mean
Arithmetic mean of values. Returns 0.0 for empty input.
percentile
Return the value at the (n * pct) as usize index of sorted_values, or 0.0 if out of bounds. Inputs must be pre-sorted ascending.
sort_f64
Sort a Vec<f64> ascending, treating NaN as equal. Pure utility so the unwrap-on-ordering pattern only appears here.