Menu
Grafana Cloud

Inspect thresholds

Thresholds are the pass/fail criteria that you define for your test metrics. If the performance of the system under test (SUT) doesn’t meet the conditions of your threshold, the test finishes with a failed status.

For example, this test script specifies a threshold to evaluate the rate of HTTP errors:

JavaScript
import http from 'k6/http';

export const options = {
  thresholds: {
    http_req_failed: ['rate<0.01'], // http errors should be less than 1%
  },
};

export default function () {
  http.get('https://test-api.k6.io/public/crocodiles/1/');
}

To visually inspect and analyze Thresholds, go to a test result and click the Threshold tab.

Thresholds Tab

The Thresholds tab includes a list of all the thresholds configured for that test run. A green or red marking is displayed next to each threshold to help you visualize if it passed or failed.

You can also filter the list by using the Quick select and the Add filter options:

  • Quick select: Filter by Only failed thresholds or Only passed thresholds.
  • Add filter: Filter by Name or Tainted. You can add multiple filters at the same time, and search by generic names (such as http or vus) or specific thresholds (such as vus: value>100).

Use this tab to analyze failed thresholds. That can help you and your team to fix any underlying issues in your system, or customize the Threshold settings.

To see visualizations for the metric, select the threshold and inspect the graph.

Thresholds passed