Load Testing · Junior · Question 20 of 75
What is a threshold in k6?
export const options = {
thresholds: {
http_req_duration: ['p(95)<500'],
},
};- 1A limit on how many virtual users k6 is allowed to start
- 2A timeout after which k6 cancels a single slow request
- 3A pass/fail criterion on a metric: the run fails if it is not met
Show the answer
Correct answer: A pass/fail criterion on a metric: the run fails if it is not met
Explanation
Thresholds turn metrics into a verdict. If p95 is 500 ms or more here, k6 marks the threshold as failed and exits with a non-zero code, which fails a CI job.