Skip to content

Commit 556b391

Browse files
Fix, minor style fixes on thresholds
- Imperative in task headings
1 parent 7802bb5 commit 556b391

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/data/markdown/translated-guides/en/02 Using k6/04 Thresholds.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ excerpt: 'Thresholds are a pass/fail criteria used to specify the performance ex
55

66
Thresholds are the pass/fail criteria that you define for your test metrics.
77
If the performance of the system under test (SUT) does not meet the conditions of your threshold,
8-
**the test will finish with a failed status.**
8+
**the test finishes with a failed status.**
99

1010
Often, testers use thresholds to codify their SLOs.
1111
For example, you can create thresholds for any combination of the following expectations:
@@ -23,7 +23,7 @@ Thresholds are also essential for [load-testing automation](/testing-guides/auto
2323

2424
After that, you need to worry about the test only after your SUT fails to meet its performance expectations.
2525

26-
## Example: HTTP errors and response duration
26+
## Example: Set threshold for HTTP errors and response duration
2727

2828
This sample script specifies two thresholds.
2929
One threshold evaluates the rate of HTTP errors (`http_req_failed` metric).
@@ -69,7 +69,7 @@ If any of the thresholds had failed, the little green checkmark <span style="col
6969
(`http_req_failed`, `http_req_duration`) would have been a red cross <span style="color:red; font-weight:bold"></span>,
7070
and k6 would have generated a non-zero exit code.
7171
72-
## Copy-paste threshold examples
72+
## Threshold examples to copy and paste
7373
7474
The quickest way to start with thresholds is to use the [standard, built-in k6 metrics](/using-k6/metrics#http-specific-built-in-metrics).
7575
Here are a few copy-paste examples that you can start using right away.
@@ -193,7 +193,7 @@ export default function () {
193193
194194
## Threshold Syntax
195195
196-
To use a threshold, you must define at least one `threshold_expression`:
196+
To use a threshold, define at least one `threshold_expression`:
197197
198198
<CodeGroup labels={["threshold-options.js"]} lineNumbers={[true]}>
199199
@@ -217,11 +217,13 @@ export const options = {
217217
This declaration configures thresholds for the metrics `metric_name1` and `metric_name2`.
218218
To determine whether the threshold passes or fails, the script evaluates the `'threshold_expression'.`
219219
220-
The `'threshold_expression'` must follow the format:
220+
The threshold expression must be in the following format:
221221
222-
`aggregation_method operator value`
222+
```
223+
<aggregation_method> <operator> <value>
224+
```
223225
224-
Examples:
226+
For example:
225227
226228
- `avg < 200` // average duration must be less than 200ms
227229
- `count >= 500` // count must be larger than or equal to 500
@@ -238,7 +240,7 @@ Each of the four [metric types](/using-k6/metrics/#metric-types) included in k6
238240
| Rate | `rate` |
239241
| Trend | `avg`, `min`, `max`, `med` and `p(N)` where `N` is a number between 0.0 and 100.0 meaning the percentile value to look at, e.g. `p(99.99)` means the 99.99th percentile. The unit for these values is milliseconds. |
240242
241-
Here is a (slightly contrived) sample script that uses all different types of metrics,
243+
This (slightly contrived) sample script uses all different types of metrics,
242244
setting different types of thresholds for each:
243245
244246
<CodeGroup labels={["thresholds-all.js"]} lineNumbers={[true]}>
@@ -311,7 +313,7 @@ Only the last one will remain.
311313
The rest will be **silently** ignored.
312314
Instead, specify them with an [array for the same key](/using-k6/thresholds/#multiple-thresholds-on-a-single-metric).
313315
314-
## Thresholds on tags
316+
## Set thresholds for specific tags
315317
316318
It's often useful to specify thresholds on a single URL or specific tag.
317319
In k6, tagged requests create sub-metrics that you can use in thresholds:
@@ -364,7 +366,7 @@ export default function () {
364366
365367
</CodeGroup>
366368
367-
## Aborting a test when a threshold is crossed
369+
## Abort a test when a threshold is crossed
368370
369371
If you want to abort a test as soon as a threshold is crossed,
370372
set the `abortOnFail` property to `true`.

0 commit comments

Comments
 (0)