TOPIC 13/1716 MINNOT STARTED

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 .

  1. Plan
  2. Crowd
  3. Notes
Dress rehearsal

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
The rehearsal planThe script file
The volunteer crowdThe virtual users
A pause between purchasesThe sleep call
The owner's notes at the endThe 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 k6 prints 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
  1. 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.

    The Grafana k6 pages on running and installing: the command k6 run script.js runs a script. The flags --vus and --duration set the crowd and the length. The same settings can sit in an exported options object. Packages exist for Linux, Mac and Windows, a Docker image exists, and k6 version confirms the install. · 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. 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.

    The Grafana k6 metrics page: http_req_duration is a trend metric for total request time. http_req_failed is a rate metric. Checks give a pass rate but do not stop the test when one fails. · 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.

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

    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.