Skip to content

Report the p95, Not the Average

Quick Tips•
October 21, 2026

An average folds every fast request and every slow one into one number. If 95% of requests finish in 200ms and 5% take four seconds, the average is 0.95 x 200 + 0.05 x 4000 = 390ms. That passes a 500ms gate while one request in twenty takes four seconds, and the user behind that request sees a spinner.

Don't do this:

JAVASCRIPT
import http from 'k6/http'; export const options = { thresholds: { http_req_duration: ['avg<500'], }, }; export default function () { http.get('https://example.com/api/invoices'); }

Do this instead:

JAVASCRIPT
import http from 'k6/http'; export const options = { thresholds: { http_req_duration: ['p(95)<500', 'p(99)<1000'], }, }; export default function () { http.get('https://example.com/api/invoices'); }

The p95 is the response time that 95% of requests beat. If it is under 500ms, no more than one request in twenty is slower. The p99 covers the slowest one in a hundred, which the p95 cannot see. Both are k6 thresholds, and when any threshold fails, k6 exits with a non-zero code, so a CI job stops on the same numbers you read. The average can stay in the report as a reference, but it should not gate the build.