Run the spike test and interpret results
Running the spike test reveals how your system responds to a sudden burst. The test is shorter than a baseline or stress test (about seven minutes), but the summary packs the baseline phase, the spike, and the recovery into a single set of aggregated metrics. Compare these values against your baseline results to determine whether the spike had an effect.
To run the spike test and interpret the results, complete the following steps:
Open your terminal and run the spike test:
k6 run spike.jsAs the test runs, watch the real-time VU count. You’ll see it hold at 5, then jump to 100 within seconds, hold, and drop back to 5. The sharp transitions are visible in the progress output.
Tip
To watch the spike unfold on a live chart instead of reading terminal output, enable the built-in web dashboard: run
K6_WEB_DASHBOARD=true k6 run spike.jsand openhttp://127.0.0.1:5665in your browser. Refer to Web dashboard.When the test completes, review the summary. At the top, find
█ THRESHOLDSand confirm each threshold fromspike.jspassed or failed:█ THRESHOLDS http_req_duration ✓ 'p(95)<1500' p(95)=55ms http_req_failed ✓ 'rate<0.10' rate=0.00%A ✓ means the threshold passed. A ✗ means it failed and k6 exits with a non-zero exit code (typically 99). Your exact values differ from this example; compare them against your baseline results.
Under
█ TOTAL RESULTS, find the checks and HTTP metrics. Compare each value against your baseline test results:Checks (confirm correctness held;
checks_failedshould show0 out ofthe same total aschecks_succeeded):█ TOTAL RESULTS checks_total.......................: 6400 15.2/s checks_succeeded...................: 100.00% 6400 out of 6400 checks_failed......................: 0.00% 0 out of 6400 ✓ status is 200 ✓ response body is not emptyhttp_req_durationunder HTTP (compare p95 and max):HTTP http_req_duration..................: avg=42ms min=30ms med=40ms max=620ms p(90)=48ms p(95)=55ms { expected_response:true }.......: avg=42ms min=30ms med=40ms max=620ms p(90)=48ms p(95)=55ms http_req_failed....................: 0.00% 0 out of 3200 http_reqs..........................: 3200 7.5/sA higher
maxthan your baseline, or a non-zerohttp_req_failedrate, suggests the burst had an effect even when thresholds pass.Record the differences between your spike and baseline values for p95 latency, max latency, error rate, and check pass rate.
For now, a scratch note is enough; the Document spike results and measure recovery milestone walks you through a structured, per-phase results table.
Because the summary aggregates all phases, even small differences from your baseline indicate the spike had an effect.
Note
The end-of-test summary blends all phases into a single set of metrics. To see how metrics changed over time during the burst compared to recovery, you need a timeline view. In the next milestone, you send results to Grafana Cloud k6 to get that visibility.
In the next milestone, you visualize the spike test in Grafana Cloud k6 to see how metrics correlated with each phase of the test.
Please tell us what didn't work: