k6: a load test written as a script
k6 describes a load test in a short script with users, duration and pass or fail limits. Write one and run it in a pipeline.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: a recipe with a taste test. A recipe says how many cooks, for how long, and what each cook does. At the end a taster says pass if the dish is good enough.
The recipe is a short page that anyone can read.
A k6 script is like that. Tom, the tester at Daily List, a to-do list app, writes how many users, how long, and the limits for a pass.
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Describing a as a short script with limits for a pass, like a recipe with a taste test.
- Options
- Script
- Limits
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| The recipe | The script |
| The cooks | Virtual users |
| The taster | The thresholds |
| How long to cook | Duration |
WHERE THIS PICTURE STOPS
- A taster decides by taste, but thresholds decide by numbers.
- Cooks vary, but virtual users repeat one script.
- A dish is eaten once, but a test is repeated.
HOOK
Users, time, limits.
TELL A FRIEND
A recipe: cooks, time, a taster.
OFTEN MIXED UP WITH JMeter: your first load test. That topic builds a plan on screen. This one writes the same idea as a short script.
PRACTISE AND KEEP
Sources for this topic — 2 sources
- Market practice
Thresholds (Grafana k6 documentation) ↗ — Grafana Labs · Grafana k6 documentation: options set vus and duration for the load and thresholds set pass or fail limits on metrics such as http_req_duration, for example p(90) below 400 ms (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail. V27 supplement, 6 November 2026: relevant primary page sections actually opened; implementation-specific current product guidance, not universal standard. See full V27 audit for version and access scope.
- Market practice
Thresholds (Grafana k6 documentation) ↗ — Grafana Labs · Opened primary source, 6 November 2026. Grafana k6 current product documentation: Opened checks versus threshold pass/fail and periodic abort evaluation (including cloud delay); opened open/closed model guidance. Not a general standard or fixed release claim.
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail. V27 supplement, 6 November 2026: relevant primary page sections actually opened; implementation-specific current product guidance, not universal standard. See full V27 audit for version and access scope.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.