TOPIC 31/4316 MINNOT STARTED

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.

  1. Options
  2. Script
  3. Limits
Recipe

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
The recipeThe script
The cooksVirtual users
The tasterThe thresholds
How long to cookDuration

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
  1. 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)

    Describes thresholds as pass or fail limits on metrics such as http_req_duration, set in the options of a script, and says the k6 command returns a non-zero exit code when a test fails. Vendor documentation. Practitioner guidance, not a standard. · Checked 2026-11-06

    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.

  2. 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.

    Describes thresholds as pass or fail limits on metrics such as http_req_duration, set in the options of a script, and says the k6 command returns a non-zero exit code when a test fails. Vendor documentation. Practitioner guidance, not a standard. · Checked 2026-11-06

    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.