A dashboard shows a 410 ms p99 from 200 requests. Before changing the service, ask what decision depends on that number. “What fraction exceeded our fixed 500 ms target?” and “What latency corresponds to the 99th percentile?” need different uncertainty estimates.

Count the evidence for a fixed target

Under an illustrative model of independent requests with a 1% chance of exceeding 500 ms, 200 requests have two expected breaches. The standard deviation of the observed fraction is about 0.70 percentage points. At 10,000 requests there are 100 expected breaches and the standard deviation is about 0.10 percentage points. These follow from the square root of p(1−p)/n. They quantify variability of a breach fraction at a fixed threshold; they do not yield a confidence interval in milliseconds for the latency percentile. With very few breaches, a symmetric normal interval is a poor choice.

For the empirical p99, keep the window, request count, quantile convention and sufficiently fine histogram buckets or order statistics. Bucket boundaries affect an interpolated percentile. A burst affecting many requests also breaks the independent-trials assumption. Segment by traffic pattern or inspect independent time blocks before pooling them.

Test how the load generator affects the answer

If a closed-loop client waits for a response before generating the next arrival, it issues fewer requests during a stall. For a service designed for scheduled arrivals, drive the intended arrival process independently and distinguish scheduled time, actual send time and completion time. Also count arrivals the generator could not send. Scheduled-to-completion includes queueing in the load generator; send-to-completion answers a different question.

Report the threshold breach count and total alongside the p99. When there are only a handful of tail observations, showing them directly can be more useful than reporting an additional decimal place.

Prometheus histograms and summaries

This article was created with AI assistance.