Skip to main content

Web Dashboard

k6 includes a built-in web dashboard that provides real-time visualization of your test results. The dashboard helps you monitor performance as your test runs and can generate downloadable HTML reports for sharing with your team. k6 web dashboard showing real-time test metrics

Features

The web dashboard offers:

Real-Time Metrics

Watch test performance live with updating graphs and statistics

HTML Reports

Generate self-contained reports for sharing and archiving

Zero Setup

Built into k6 - no additional tools or services required

Interactive Graphs

Zoom, pan, and explore metrics during and after test runs

Quick Start

Enable the web dashboard using the K6_WEB_DASHBOARD environment variable:
K6_WEB_DASHBOARD=true k6 run script.js
Output:
         /\      Grafana   /‾‾/
    /\  /  \     |\  __   /  /
   /  \/    \    | |/ /  /   ‾‾\
  /          \   |   (  |  (‾)  |
 / __________ \  |_|\_\  \_____/

     execution: local
        script: script.js
 web dashboard: http://127.0.0.1:5665
        output: -
Open your browser to http://127.0.0.1:5665 to view the dashboard.

Dashboard Interface

The web dashboard displays:

Overview Section

  • Test progress - Visual progress bar and elapsed time
  • Virtual users - Current, min, and max VUs
  • Request statistics - Total requests, request rate, error rate
  • Response times - Current p95, p99, and average response times

Metrics Section

HTTP Metrics:
  • Request duration (blocked, connecting, TLS, sending, waiting, receiving)
  • Request rates and counts
  • Error rates
Execution Metrics:
  • Iteration duration
  • VUs over time
  • Data sent/received
Custom Metrics:
  • Any custom metrics defined in your test

Thresholds Section

  • Real-time threshold status (passing/failing)
  • Threshold values and limits
  • Visual indicators for threshold violations

Checks Section

  • Check pass/fail counts
  • Success percentages
  • Individual check status

Configuration

Customize the dashboard behavior with environment variables:
# Enable dashboard
K6_WEB_DASHBOARD=true k6 run script.js

# Custom port
K6_WEB_DASHBOARD=true \
K6_WEB_DASHBOARD_PORT=8080 \
k6 run script.js

# Bind to all interfaces (remote access)
K6_WEB_DASHBOARD=true \
K6_WEB_DASHBOARD_HOST=0.0.0.0 \
k6 run script.js

Configuration Options

Environment VariableDescriptionDefault
K6_WEB_DASHBOARDEnable the web dashboardfalse
K6_WEB_DASHBOARD_HOSTHost to bind the server tolocalhost
K6_WEB_DASHBOARD_PORTPort to bind the server to (use -1 to disable)5665
K6_WEB_DASHBOARD_PERIODUpdate frequency for metrics10s
K6_WEB_DASHBOARD_OPENAuto-open dashboard in browserfalse
K6_WEB_DASHBOARD_EXPORTAuto-export HTML report to file“ (disabled)

HTML Reports

Generate shareable HTML reports directly from the dashboard:

From the Dashboard UI

  1. Run your test with the dashboard enabled
  2. Click the Report button in the dashboard menu
  3. The report downloads as an HTML file
Report button in web dashboard

From Command Line

Auto-generate reports when the test completes:
K6_WEB_DASHBOARD=true \
K6_WEB_DASHBOARD_EXPORT=test-report-$(date +%Y%m%d-%H%M%S).html \
k6 run script.js

Report Features

The generated HTML report:
  • Self-contained - Single file with embedded assets
  • Interactive - Graphs are still zoomable and explorable
  • Shareable - Email or upload anywhere
  • Archive-friendly - Stores complete test history
Example HTML test report
Reports only include graphs if test duration exceeds 3× the aggregation period (default: 30 seconds).

Use Cases

Monitor tests during development:
# Quick feedback loop
K6_WEB_DASHBOARD=true \
K6_WEB_DASHBOARD_OPEN=true \
k6 run script.js
Benefits:
  • See results immediately
  • Iterate quickly on test scripts
  • Debug issues in real time

Example Test

Here’s a complete example showing the dashboard in action:
test.js
import http from 'k6/http';
import { check, sleep } from 'k6';
import { Trend } from 'k6/metrics';

// Custom metric for dashboard
const customWaitTime = new Trend('custom_wait_time');

export const options = {
  stages: [
    { duration: '30s', target: 10 },
    { duration: '1m', target: 10 },
    { duration: '30s', target: 0 },
  ],
  thresholds: {
    http_req_duration: ['p(95)<500'],
    http_req_failed: ['rate<0.01'],
    custom_wait_time: ['avg<300'],
  },
};

export default function () {
  const startTime = Date.now();
  
  const res = http.get('https://test.k6.io');
  
  check(res, {
    'status is 200': (r) => r.status === 200,
    'response time < 500ms': (r) => r.timings.duration < 500,
    'has content': (r) => r.body.length > 0,
  });
  
  const waitTime = Date.now() - startTime;
  customWaitTime.add(waitTime);
  
  sleep(1);
}
Run with dashboard:
K6_WEB_DASHBOARD=true \
K6_WEB_DASHBOARD_OPEN=true \
K6_WEB_DASHBOARD_EXPORT=report.html \
k6 run test.js
The dashboard will show:
  • Real-time request metrics
  • Threshold status (3 thresholds)
  • Check results (3 checks)
  • Custom metric (custom_wait_time)
  • VU ramping stages

Tips and Best Practices

The k6 process waits while browser windows are open. To exit immediately:
  • Close the browser window, or
  • Set K6_WEB_DASHBOARD_PORT=-1 for CI/CD, or
  • Use Ctrl+C to force quit
To access the dashboard from another machine:
K6_WEB_DASHBOARD=true \
K6_WEB_DASHBOARD_HOST=0.0.0.0 \
K6_WEB_DASHBOARD_PORT=5665 \
k6 run script.js
Then access via http://<server-ip>:5665Security Warning: Only bind to 0.0.0.0 in trusted networks.
The dashboard has minimal overhead but can impact high-load tests:
  • Increase K6_WEB_DASHBOARD_PERIOD for very high RPS
  • Consider disabling for maximum performance tests
  • Use --out options for zero-overhead metrics collection
Create a structured naming convention:
# Include timestamp and test name
export REPORT="reports/$(basename $TEST)-$(date +%Y%m%d-%H%M%S).html"
K6_WEB_DASHBOARD=true K6_WEB_DASHBOARD_EXPORT=$REPORT k6 run $TEST

Comparison with Other Outputs

Best for:
  • Local development
  • Quick visual feedback
  • Sharing with non-technical users
  • No additional infrastructure
Limitations:
  • Only one test at a time
  • No historical comparison
  • Limited to test duration

Troubleshooting

Port already in use:
Error: listen tcp 127.0.0.1:5665: bind: address already in use
Solution: Change the port or stop the conflicting service:
K6_WEB_DASHBOARD=true K6_WEB_DASHBOARD_PORT=8080 k6 run script.js
Empty or missing graphs in report:Reports only include graphs if test duration > 3× the period.For a 10s period (default), run tests for at least 30 seconds:
export const options = {
  duration: '30s', // Minimum for graphs
  vus: 10,
};

Next Steps

End-of-Test Summary

Understand the default text summary output

Real-Time Streaming

Stream metrics to external services

Grafana Dashboards

Create advanced visualizations with Grafana

Custom Metrics

Add custom metrics to your tests

Build docs developers (and LLMs) love