Load test an HTTP API with k6
8 steps · about 1 h 24 min · Intermediate
- Write and run your first k6 test script (reference, Grafana Labs, 10 min)
Gets a working load script against an endpoint quickly.
- Choose between smoke, load, stress, spike and soak tests (guide, Grafana Labs, 10 min)
Matches the test shape to the question you are asking.
- Plan an API load test from goals to workload (guide, Grafana Labs, 20 min)
Walks through realistic API workload modelling.
- Assert response correctness with checks (reference, Grafana Labs, 6 min)
Ensures fast responses are also correct responses.
- Fail the run on latency and error thresholds (reference, Grafana Labs, 8 min)
Turns a load test into a pass/fail gate for CI.
- Model arrival rates and user ramps with scenarios (reference, Grafana Labs, 12 min)
Controls how traffic grows so results reflect real use.
- Read the end-of-test summary percentiles (reference, Grafana Labs, 8 min)
Explains p95, iteration and error metrics in the output.
- Compare with a Python-scripted load test in Locust (reference, Locust, 10 min)
Shows an alternative tool when your team writes Python.