k6 part 1: install k6, write your first script and read the summary
Install k6, write a ten-line script with a check and a pause, run it with a small crowd of pretend users, and read the table k6 prints at the end.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: a dress rehearsal with volunteer shoppers. Before opening day, a shop invites a few people to walk in together and buy things. The owner notes how long each person waits. A bigger crowd comes only after the small rehearsal makes sense.
Tom is a tester at Daily List, a to-do list app. Mei wants a baseline before a release. Leo wants numbers, not the words "it felt slow". Lily is the person in the queue.
What it is: k6 is a free load tool from Grafana Labs. You install it on your computer, or you run the Docker image grafana/k6. Docker (a tool that runs programs in sealed boxes) is one choice, not a must. A is a short JavaScript file that says what each pretend user does. A is how many of those users act at once, and for how long. The k6 summary output is the table printed at the end. The tool is not the API (application programming interface). The API is the service under test. The crowd is the tool. A check in the script does not stop the run. It only marks a pass rate.
Why it matters: One manual click cannot show how Daily List behaves with many users. The tool gives Tom a crowd he can repeat. He can attach the summary to a release note. Without that, performance talk stays an opinion.
PLAIN WORDS · 1 in this section
- grafana
- a company that makes tools for watching and testing software
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 Write a complete .
- Plan
- Crowd
- Notes
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| The rehearsal plan | The script file |
| The volunteer crowd | The virtual users |
| A pause between purchases | The sleep call |
| The owner's notes at the end | The summary table |
WHERE THIS PICTURE STOPS
- Volunteers are people, but virtual users are loops.
- A rehearsal is one day, but a script can run again at once.
- The owner watches live, but
k6prints at the end.
HOOK
Plan, crowd, notes.
TELL A FRIEND
A plan, a crowd and notes.
OFTEN MIXED UP WITH k6: a load test written as a script. That older topic shows the script . This one installs k6 and walks through a and its summary.
PRACTISE AND KEEP
Sources for this topic — 3 sources
- Implementation-specific
Running k6 and Install k6 (Grafana k6 documentation) ↗ — Grafana Labs · Rolling latest Running k6: imports, default function, options, response binding and local execution; opened6 November2026; no installed release asserted.
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.
- Implementation-specific
Built-in metrics (Grafana k6 documentation) ↗ — Grafana Labs · Rolling latest metric reference: http_req_duration=sending+waiting+receiving, excluding initial DNS/connect; http_req_failed uses expected-response policy; opened6 November2026.
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.
- Implementation-specific
Thresholds (Grafana k6 documentation) ↗ — Grafana Labs · Rolling latest thresholds: metric aggregates, strict comparisons, checks rate gate, nonzero exit and abortOnFail/delayAbortEval; opened6 November2026.
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.