End-of-Test Summary
When a test finishes, k6 prints a summary of aggregated results tostdout. 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:
- compact (default)
- full
- legacy
The compact mode displays the most relevant test results in a concise format, focusing on:Example output:
- Threshold results
- Check results
- Aggregated metrics by category
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
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 usingTrend, Counter, Gauge, or Rate
HTTP - Metrics from the k6/http module:
http_req_duration- Total request timehttp_req_blocked- Time waiting for a free connection slothttp_req_connecting- Time establishing TCP connectionhttp_req_tls_handshaking- Time performing TLS handshakehttp_req_sending- Time sending request datahttp_req_waiting- Time waiting for server response (TTFB)http_req_receiving- Time receiving response datahttp_req_failed- Rate of failed requestshttp_reqs- Total number of requests
iteration_duration- Time to complete one full iterationiterations- Total number of iterations completedvus- Current number of active virtual usersvus_max- Maximum VUs allocated
data_received- Total data receiveddata_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 thehandleSummary() function in your test script:
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