Skip to main content
No Result Found
Get your setup working faster. Join our Discord for optimisation tips from elite testers. Join our DiscordJoin our Discord

Set thresholds

Define pass/fail criteria based on performance metrics

Set thresholds to automatically flag regressions when metrics exceed acceptable limits.

Want to fail a test the moment a critical threshold is breached? Enable fail-on-breach to stop a load test mid-execution as soon as a threshold is violated, saving VU hours and giving you faster feedback. See Fail a load test on threshold breach.

You can scope a threshold to a scenario in Browser Load Tests only, because multiple scenarios exist only in browser tests. On API Load Tests, a threshold applies globally or to specific requests, not to a scenario.

Depending on your preferred method, select any one of the following to set thresholds:

Set thresholds

In Step 3/3: Load Configuration, open the Thresholds tab. BrowserStack marks the test as failed if any threshold condition is not met.

To add a threshold:

  • Select Add Threshold.
  • Choose a metric, set a condition such as is greater than, and enter a value.
  • Keep the scope set to All Requests to evaluate the metric across the entire test run. To apply a threshold to specific requests, a pattern, a group, or an individual scenario, see Set thresholds for specific requests.
  • Repeat for more thresholds as needed, then save the test.

The Thresholds tab with a threshold row and the request scope set to All Requests

Available metrics:

  • Total requests (count)
  • Error % (percentage)
  • Error count (count)
  • Avg request rate (req/s)
  • Avg response time (ms)
  • p90 response time (ms)
  • p75 LCP (s)
  • p75 INP (ms)
  • p75 FCP (s)
  • p75 TTFB (ms)
  • p75 CLS

WebSocket metrics

The following WebSocket metrics are available when your script uses WebSockets:

  • Connection error % (percentage)
  • Connection time P95 (ms)
  • Session duration P95 (ms)
  • Peak concurrent sessions (count)
  • Messages sent (count)
  • Messages received (count)

The metric picker shows WebSocket metrics for a WebSocket script, and both HTTP and WebSocket metrics for a script that mixes the two. You can scope most WebSocket thresholds to specific requests, but not to a scenario. Peak concurrent sessions is run-wide only. Session duration is measured up to the end of the run or iteration window, not up to the actual socket close, so treat it as a lower bound.

k6 options.thresholds on WebSocket metrics, such as ws_connecting, run natively inside k6 but don’t become BrowserStack thresholds. Add WebSocket thresholds here to have BrowserStack grade them.

For more about these metrics, see WebSocket load test results.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle