Load Testing · Junior · Question 20 of 75

What is a threshold in k6?

export const options = {
  thresholds: {
    http_req_duration: ['p(95)<500'],
  },
};
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.

Further reading

Problem with a question

Load Testing · Junior · question 20

Test yourself

Take the Load Testing · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz