count0
avg0ms
p500ms
p950ms
p990ms
≤10
≤25
≤50
≤100
≤250
≤500
≤1000
≤2500
≤5000
>5000
latency (ms)

// recent observations (last 20)

none yet

How It Works

  • Each observation falls into a bucket (≤ threshold)
  • Percentiles estimated from cumulative distribution
  • p50 = median, p99 = tail latency
  • O(1) per observation, O(buckets) for percentile

Use Cases

  • Request latency tracking (Prometheus)
  • SLA monitoring (p99 < 200ms)
  • Database query performance
  • Response size distributions