Skip to main content

End-of-Test Summary

When a test finishes, k6 prints a summary of aggregated results to stdout. This summary provides a comprehensive overview of your test execution, organized by thresholds, checks, and metric categories.

Summary Modes

k6 provides three display modes through the --summary-mode option:
The compact mode displays the most relevant test results in a concise format, focusing on:
  • Threshold results
  • Check results
  • Aggregated metrics by category
Example output:

Understanding the Summary

Thresholds Section

Thresholds appear at the top of the summary with clear pass/fail indicators:
  • ✓ Indicates a passing threshold
  • ✗ Indicates a failing threshold
Each threshold shows its expression and the actual value:
If any threshold fails, k6 exits with a non-zero status code, making it perfect for CI/CD pipelines.

Checks Section

Checks show pass/fail ratios for assertions in your test:
Unlike thresholds, failed checks do not cause k6 to exit with an error. They’re for informational purposes.

Metrics by Category

Metrics are organized into categories based on their source: CUSTOM - Your custom metrics using Trend, Counter, Gauge, or Rate HTTP - Metrics from the k6/http module:
  • http_req_duration - Total request time
  • http_req_blocked - Time waiting for a free connection slot
  • http_req_connecting - Time establishing TCP connection
  • http_req_tls_handshaking - Time performing TLS handshake
  • http_req_sending - Time sending request data
  • http_req_waiting - Time waiting for server response (TTFB)
  • http_req_receiving - Time receiving response data
  • http_req_failed - Rate of failed requests
  • http_reqs - Total number of requests
EXECUTION - Test execution metrics:
  • iteration_duration - Time to complete one full iteration
  • iterations - Total number of iterations completed
  • vus - Current number of active virtual users
  • vus_max - Maximum VUs allocated
NETWORK - Data transfer metrics:
  • data_received - Total data received
  • data_sent - Total data sent
Categories only appear when relevant. For example, browser metrics appear only when using k6/browser.

Customization Options

k6 provides several options to customize the summary output:

Available Options

Custom Summary with handleSummary()

For complete control over the summary output, use the handleSummary() function in your test script:
The handleSummary() function:
  • Receives the complete metrics data object
  • Returns a map of {destination: content} pairs
  • Can output to stdout, stderr, or any file path
  • Allows multiple outputs simultaneously
For more details on custom summaries, see the Custom Summary documentation.

CI/CD Integration

The end-of-test summary is ideal for CI/CD pipelines:

Next Steps

Custom Summary

Create fully customized summary reports with handleSummary()

Real-Time Output

Stream metrics during test execution for live monitoring

Thresholds

Learn how to define performance requirements with thresholds

Checks

Understand how to add assertions to your tests