Run your k6 test locally
In this milestone, you run your k6 test script locally and review the results in your terminal.
In your terminal, navigate to the directory containing your
script.jsfile and run the test:k6 run script.jsIf you’re using Docker:
docker run --rm -i grafana/k6 run - < script.jsObserve the test execution in your terminal. k6 displays real-time progress including iteration count, HTTP request statistics, and response time metrics.
When the test completes, review the summary. Look for:
- checks_succeeded: Should be 100% if all requests returned status 200
- http_req_duration: Average, median, and p95 response times
- http_req_failed: Should be 0% for a healthy endpoint
- iterations: Should show 10 completed iterations
Troubleshooting
If the test fails to run, check that your script syntax is correct and that you have network connectivity to https://quickpizza.grafana.com.
In the next milestone, you send your test results to Grafana Cloud for visualization and analysis.