Skip to content

Add percentile reporting (p50, p95, p99, p999) to DumpToStream #9

Description

@fior512

Motivation

For latency-sensitive systems (HFT, game engines), the mean and standard deviation are often misleading. A system with avg=500ns but p99=50µs is unacceptable. Percentiles are the standard lens for latency analysis and are the first thing practitioners look at when comparing against raw chrono measurements.

Current State

DumpToStream() currently reports: count, average, median, std dev, skewness, min, max, range, outlier count.

There is no percentile output.

Proposed Change

Add a percentile row (or additional columns) to the telemetry table:

[ p50 ]  [ p95 ]  [ p99 ]  [ p999 ]
 480 ns   620 ns  1.2 µs   8.4 µs

Since DumpToStream already sorts the sample array for median computation, percentiles are free — just index into the sorted vector at the right rank.

// After sort:
double p99 = sorted[(size_t)(0.99 * sorted.size())];

Acceptance Criteria

  • p50, p95, p99, p999 displayed in every per-ID block of the report
  • Values respect the chosen Parameter::Cycle / Parameter::Time unit
  • Calibrated mode subtracts the appropriate offset from percentile values too
  • No additional allocations beyond what the existing sort already does

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions