k6 threshold

A k6 threshold is a pass or fail rule applied to a measured metric, such as p(99)<300 for request duration. It can include abortOnFail to stop the test when the specified performance requirement is breached.

Minimal example

javascript
thresholds: { http_req_duration: ['p(99)<300'] }

Learn this concept

Lesson 6.7 · k6 workload models

Used in exercises

Exercise 6.11 · Browse and order k6 scripts
Prerequisite conceptsLoad testLatency percentile