YBX.

Research · · 简体中文

Why agent latency p95 changes with the percentile method on 20 runs

On the same set of 20 synthetic latency values, our calculation gave 910 ms for nearest rank, 934.5 ms for Python’s inclusive method and 1,375.5 ms for its exclusive method.

Use the same input and compare the calculations

We ran Python 3.14.7 on this sorted list in milliseconds: 180, 185, 190, 195, 198, 201, 205, 208, 211, 214, 218, 222, 226, 229, 233, 238, 247, 270, 910, 1400. The median was 216 ms. The mean was 309 ms.

For nearest rank, round 0.95 times 20 up to an integer, then take that one-based rank. This selects the 19th value, 910 ms. In Python statistics.quantiles(values, n=100, method='inclusive')[94] returned 934.5. With method='exclusive' it returned 1375.5. The two methods put the 95th-percentile cut at different points between 910 and 1400.

Make a performance report reproducible

Include the sample count and percentile method beside p95. Keep timing boundaries consistent, including how you count retries and timeouts. Twenty synthetic values are enough to show the method difference. A production performance claim needs representative measured requests and the sample count relevant to that claim.

Sources

Related reading