Run your k6 test locally

In this milestone, you run your k6 test script locally and review the results in your terminal.

  1. In your terminal, navigate to the directory containing your script.js file and run the test:

    Bash
    k6 run script.js

    If you’re using Docker:

    Bash
    docker run --rm -i grafana/k6 run - < script.js
  2. Observe the test execution in your terminal. k6 displays real-time progress including iteration count, HTTP request statistics, and response time metrics.

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


page 5 of 8