Section 3 · Establishing a baseline

Threshold failures in the terminal, CI exit codes, and a regression example

Estimated time: 2 min

Failure signals in the terminal

passed that line; failed the threshold on that line.

When all thresholds pass:

text
✓ http_req_duration..............: avg=186ms  p(95)=312ms
✓ http_req_failed................: 0.00%
✓ checks.........................: 100.00%

When a threshold fails:

text
✗ http_req_duration..............: avg=743ms  p(95)=1247ms
                                   ✗ { p(95)<500 }
✓ http_req_failed................: 0.42%
✓ checks.........................: 99.80%

Exit codes and early stop

Exit codeMeaningCI/CD behavior
0All thresholds passedPipeline continues
99One or more thresholds breachedPipeline fails the step

Add abortOnFail to end the run immediately on a critical breach:

JavaScript
thresholds: {
  http_req_duration: [
    { threshold: 'p(95)<500', abortOnFail: true },
  ],
}

Example: regression caught in CI

A change ships with passing unit tests; the baseline gate runs last. p(95)=683ms vs p(95)<500exit 99, deploy blocked.

text
running (2m01.3s), 00/20 VUs, 1847 complete iterations
     ✓ status is 200
     ✓ body is not empty

     ✗ http_req_duration..............: avg=512ms  p(95)=683ms
                                        ✗ { p(95)<500 }
     ✓ http_req_failed................: 0.00%
     ✓ checks.........................: 100.00%

ERRO threshold breached: http_req_duration p(95)<500, got 683.21ms
MetricLast passingThis run
p95318 ms683 ms
Throughput15.3 requests per second (RPS)15.1 RPS (similar)
Errors0%0%

Latency jumps while throughput is flat usually means per-request work got heavier (for example synchronous database work). Fix the hot path, re-run, pipeline goes green.