Run the load test and read results

With your load profile and checks in place, you’re ready to run the test and interpret the output. The k6 summary is dense with metrics, but for establishing a baseline you need to focus on a few key lines: http_req_duration for latency, http_req_failed for error rate, and checks for correctness.

To run your test and read the results, complete the following steps:

  1. Open your terminal and run the test:

    Bash
    k6 run baseline.js

    k6 displays real-time progress as the test executes, showing the current VU count and completed iterations.

  2. When the test completes, review the summary output. Focus on the following metrics:

    http_req_duration: The time it takes for requests to complete. The summary shows several aggregations:

    text
    http_req_duration..: avg=180ms  min=95ms
                         med=165ms  max=850ms
                         p(90)=280ms  p(95)=350ms
    • avg is the mean across all requests, but averages hide outliers.
    • p(90) and p(95) are more useful for baselines. The p(95) value means 95% of requests completed within that time. The remaining 5% were slower.
    • If max is dramatically higher than p(95), a small number of requests are experiencing significant delays.

    http_req_failed: The percentage of requests that returned a non-2xx status code:

    text
    http_req_failed................: 0.00%   0 out of 1200

    The output shows how many requests failed out of the total. For a healthy baseline, this value should be at or near 0%.

    checks: The pass rate across all your check assertions. The checks section appears at the top of the summary under TOTAL RESULTS:

    text
    checks_total.......: 2400    10.00/s
    checks_succeeded...: 100.00% 2400 out of 2400
    checks_failed......: 0.00%   0 out of 2400
    
    ✓ status is 200
    ✓ response body is not empty

    A 100% checks_succeeded rate means every response met your correctness criteria. The individual check names are listed below with ✓ or ✗ indicators.

    iterations: The total number of times the default function executed:

    text
    iterations.....................: 1200    10.00/s

    The per-second rate represents your throughput (requests per second) during the test.

  3. Confirm that your test ran cleanly: checks are passing, the error rate is near zero, and the latency values are stable. If something looks off, such as high error rates, check failures, or erratic latency, investigate before using these numbers as your baseline.

    Note

    Percentiles are more reliable than averages for baselines. An average of 200 ms could mean most requests took 150 ms but a few took 2 s. The p95 value gives you a much clearer picture of actual user experience.

In the next milestone, you identify the specific values from these results to record as your baseline.

Were you successful?


page 5 of 10