Skip to main content

Understanding k6 results

As k6 runs your test, it collects performance metrics about both the test execution and system behavior. Understanding these results helps you identify performance issues and validate that your application meets reliability goals.

End-of-test summary

After your test completes, k6 prints a summary to the terminal with aggregated statistics for all metrics.

Running a test

Run any k6 test to see the results:
You’ll see:
  1. Test progress: Real-time updates as the test runs
  2. Summary statistics: Aggregated metrics after completion
  3. Check results: Pass/fail rates for validations
  4. Threshold results: Whether performance goals were met

Example output

The ✓ symbol indicates passing checks or thresholds, while ✗ indicates failures.

Built-in metrics

k6 automatically collects these metrics for every test:

HTTP metrics

http_req_duration
  • Description: Total time for the request (sending + waiting + receiving)
  • Type: Trend
  • Key metric: This is your primary latency metric
  • What to look for: p(95) and p(99) values under your target (e.g., < 500ms)
http_req_waiting
  • Description: Time spent waiting for response (server processing time)
  • Type: Trend
  • What to look for: High values indicate slow server processing
http_req_sending
  • Description: Time spent sending request data
  • Type: Trend
  • What to look for: High values may indicate network issues
http_req_receiving
  • Description: Time spent receiving response data
  • Type: Trend
  • What to look for: High values for large responses are normal

Test execution metrics

iterations
  • Description: Number of times the default function completed
  • Type: Counter
  • What to look for: Total test iterations and rate (iterations/s)
iteration_duration
  • Description: Time to complete one iteration
  • Type: Trend
  • What to look for: Should include all requests + sleep time
vus
  • Description: Number of active virtual users
  • Type: Gauge
  • What to look for: Current load level
vus_max
  • Description: Maximum possible number of virtual users
  • Type: Gauge
  • What to look for: Allocated VU capacity

Understanding metric statistics

For Trend metrics (like http_req_duration), k6 reports several statistics:
avg - Average (mean) value
  • Quick overview but can be misleading with outliers
min - Minimum value observed
  • Best-case performance
med - Median (50th percentile)
  • Middle value; more representative than average
max - Maximum value observed
  • Worst-case performance
p(90) - 90th percentile
  • 90% of requests were faster than this
p(95) - 95th percentile
  • Common SLA target
  • 95% of requests were faster than this
p(99) - 99th percentile
  • Catches most outliers
  • Important for user experience
p(99.9) - 99.9th percentile
  • Only the worst 0.1% of requests exceed this
Focus on percentiles (p95, p99) rather than averages. A low average with high p95/p99 indicates many users experience poor performance.

Configure summary statistics

Customize which statistics k6 displays:
This displays only median, p95, and p99.9 values, reducing clutter.

Checks and validations

Checks validate responses without stopping test execution. They appear in the summary as pass/fail rates:
Results show the pass rate for each check:
Checks don’t affect test execution. Use thresholds to fail tests based on performance criteria.

Thresholds for pass/fail criteria

Thresholds define performance requirements. If thresholds fail, k6 exits with a non-zero code:
Threshold results appear at the end of the summary:
Failed thresholds cause k6 to exit with code 99, failing CI/CD pipelines. Use this to enforce performance requirements.

Custom metrics

Create metrics that track business-specific data:
Custom metrics appear in the summary alongside built-in metrics.

Exporting results

For detailed analysis, export metrics to external systems.

JSON file

Export all metrics to a JSON file:
This creates a file with one JSON object per metric data point.

CSV file

Export metrics to CSV format:

Multiple outputs

Send results to multiple destinations:
Stream results to InfluxDB for time-series analysis:
Visualize in Grafana using k6 dashboards.

Custom summary report

Create custom end-of-test reports using handleSummary():
This creates:
  • Terminal output (stdout)
  • JSON summary file
  • HTML report

Real-time results

Monitor test progress in real-time using the web dashboard:
Open the provided URL in your browser to see live metrics during test execution.
The web dashboard is built into k6 and requires no additional setup.

Analyzing results

When reviewing test results, focus on:
1

Check error rate

Ensure http_req_failed is below your acceptable threshold (typically < 1%).
2

Review response times

Look at p95 and p99 of http_req_duration. These represent user experience better than averages.
3

Verify thresholds

Check if all thresholds passed. Failed thresholds indicate performance issues.
4

Examine checks

Review check pass rates. Low rates indicate functional issues.
5

Compare trends

Run tests regularly and compare results over time to detect performance regressions.

Common issues

Network latency or connection overhead is high. Check http_req_connecting and http_req_tls_handshaking.
Connection pool exhausted. Increase batch parallelism or check keep-alive settings.
System degradation. Could indicate memory leaks, resource exhaustion, or insufficient capacity.
System cannot handle the load. Scale infrastructure or optimize application.

Next steps

Now that you understand k6 results:

Metrics Guide

Deep dive into all k6 metrics and metric types

Thresholds

Learn advanced threshold configurations

Result Outputs

Explore all result export options

Grafana Dashboards

Visualize results in Grafana