|
| 1 | +--- |
| 2 | +title: Web Dashboard |
| 3 | +excerpt: With the web-dashboard, you can track test results in real-time, and generate HTML test reports directly from your web browser. |
| 4 | +weight: 200 |
| 5 | +--- |
| 6 | + |
| 7 | +# Web dashboard |
| 8 | + |
| 9 | +k6 provides a built-in web dashboard running on the user's machine and enabling them to monitor their test results in real-time. |
| 10 | + |
| 11 | +## Real-time test results |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +The dashboard provides a real-time overview of the performance observed by k6 while a test is running, and helps to identify potential reliability issues as they occur. |
| 16 | + |
| 17 | +## HTML test reports |
| 18 | + |
| 19 | +The dashboard enables to generate detailed, downloadable HTML reports directly from the dashboard. These reports are self-contained, making them ideal for sharing with your team. |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +The HTML test report can be accessed from the dashboard's menu, by clicking on the "Report" button. |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | +## How to use |
| 28 | + |
| 29 | +The web dashboard is a built-in feature of k6, and can be enabled by setting the `K6_WEB_DASHBOARD` environement variable to `true`. When used, the k6 run command will provide a link to the web dashboard in the terminal output: |
| 30 | + |
| 31 | +```shell |
| 32 | +K6_WEB_DASHBOARD=true ./k6 run ../extensions/xk6-dashboard/script.js |
| 33 | + |
| 34 | + /\ |‾‾| /‾‾/ /‾‾/ |
| 35 | + /\ / \ | |/ / / / |
| 36 | + / \/ \ | ( / ‾‾\ |
| 37 | + / \ | |\ \ | (‾) | |
| 38 | + / __________ \ |__| \__\ \_____/ .io |
| 39 | + |
| 40 | + execution: local |
| 41 | + script: ../extensions/xk6-dashboard/script.js |
| 42 | + web dashboard: http://127.0.0.1:5665 |
| 43 | + output: - |
| 44 | +``` |
| 45 | +
|
| 46 | +By default, when active, the web dashboard is exposed on localhost port `5665`. You can however configure. |
| 47 | +
|
| 48 | +## Dashboard options |
| 49 | +
|
| 50 | +The web dashboard can be configured using environment variables: |
| 51 | +
|
| 52 | +| Environment variable | Description | Default value | |
| 53 | +| ---------------------------------- | --------------------------------------------- | ------------- | |
| 54 | +| `K6_WEB_DASHBOARD` | Enable the web dashboard | `false` | |
| 55 | +| `K6_WEB_DASHBOARD_HOST` | Host to bind the web dashboard to | `localhost` | |
| 56 | +| `K6_WEB_DASHBOARD_PORT` | Port to bind the web dashboard to | `5665` | |
| 57 | +| `K6_WEB_DASHBOARD_PERIOD` | Period in seconds to update the web dashboard | `10s` | |
| 58 | +| `K6_WEB_DASHBOARD_OPEN` | Open the web dashboard in the default browser | `false` | |
| 59 | +| `K6_WEB_DASHBOARD_REPORT_FILENAME` | Filename to export the HTML test report to | `report.html` | |
0 commit comments