Skip to content

Commit 87f96bf

Browse files
committed
Apply suggestions from code review
1 parent 75ae915 commit 87f96bf

File tree

1 file changed

+37
-29
lines changed
  • docs/sources/next/results-output/web-dashboard

1 file changed

+37
-29
lines changed

docs/sources/next/results-output/web-dashboard/_index.md

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,6 @@ k6 provides a built-in web dashboard that you can enable to visualize and monito
1212

1313
The dashboard provides a real-time overview of the performance observed by k6 while a test is running, and can help you identify potential reliability issues as they occur.
1414

15-
## Generate HTML test reports
16-
17-
You can generate detailed, downloadable HTML reports directly from the web dashboard or the command line. These reports are self-contained, making them ideal for sharing with your team.
18-
19-
![HTML test report screenshot](/media/docs/k6-oss/web-dashboard-report.png)
20-
21-
### Generate report from web dashboard
22-
23-
To generate a report from the web dashboard, click **Report** on the dashboard's menu.
24-
25-
![HTML test report generation button](/media/docs/k6-oss/web-dashboard-report-button.png)
26-
27-
### Generate report from the command line
28-
29-
To automatically generate a report from the command line once the test finishes running, use the `K6_WEB_DASHBOARD_EXPORT` option. For example:
30-
31-
```shell
32-
K6_WEB_DASHBOARD=true K6_WEB_DASHBOARD_EXPORT=html-report.html k6 run script.js
33-
```
34-
3515
## How to use
3616

3717
The web dashboard is a built-in feature of k6. You can enable it by setting the `K6_WEB_DASHBOARD` environment variable to `true` when running your test script, for example:
@@ -41,7 +21,7 @@ K6_WEB_DASHBOARD=true k6 run script.js
4121
```
4222

4323
```shell
44-
K6_WEB_DASHBOARD=true ./k6 run ../extensions/xk6-dashboard/script.js
24+
K6_WEB_DASHBOARD=true ./k6 run script.js
4525

4626
/\ |‾‾| /‾‾/ /‾‾/
4727
/\ / \ | |/ / / /
@@ -57,15 +37,43 @@ K6_WEB_DASHBOARD=true ./k6 run ../extensions/xk6-dashboard/script.js
5737
5838
By default, the web dashboard is available on localhost port `5665`. You can change the host and port by using the [dashboard options](#dashboard-options).
5939
40+
{{% admonition type="note" %}}
41+
42+
The k6 process waits to exit as long as there is at least one open browser window for the dashboard extension. In this way, the report can be downloaded, for example, even after the test has been completed.
43+
44+
In certain environments, it is not allowed that the k6 process does not exit after the test run (_e.g_ CI/CD pipeline). In this case, it is advisable to disable the HTTP port (with the `-1` value of port parameter).
45+
46+
{{% /admonition %}}
47+
48+
## Generate HTML test reports
49+
50+
You can generate detailed, downloadable HTML reports directly from the web dashboard or the command line. These reports are self-contained, making them ideal for sharing with your team.
51+
52+
![HTML test report screenshot](/media/docs/k6-oss/web-dashboard-report.png)
53+
54+
### Generate report from web dashboard
55+
56+
To generate a report from the web dashboard, click **Report** on the dashboard's menu.
57+
58+
![HTML test report generation button](/media/docs/k6-oss/web-dashboard-report-button.png)
59+
60+
### Generate report from the command line
61+
62+
To automatically generate a report from the command line once the test finishes running, use the `K6_WEB_DASHBOARD_EXPORT` option. For example:
63+
64+
```shell
65+
K6_WEB_DASHBOARD=true K6_WEB_DASHBOARD_EXPORT=html-report.html k6 run script.js
66+
```
67+
6068
## Dashboard options
6169
6270
The web dashboard can be configured using environment variables:
6371
64-
| Environment variable | Description | Default value |
65-
| ---------------------------------- | --------------------------------------------- | ------------- |
66-
| `K6_WEB_DASHBOARD` | Enable the web dashboard | `false` |
67-
| `K6_WEB_DASHBOARD_HOST` | Host to bind the web dashboard to | `localhost` |
68-
| `K6_WEB_DASHBOARD_PORT` | Port to bind the web dashboard to | `5665` |
69-
| `K6_WEB_DASHBOARD_PERIOD` | Period in seconds to update the web dashboard | `10s` |
70-
| `K6_WEB_DASHBOARD_OPEN` | Open the web dashboard in the default browser | `false` |
71-
| `K6_WEB_DASHBOARD_EXPORT ` | Filename to automatically export the HTML test report to at the end of the test run. By default, the value is empty and the report isn't exported. | `` |
72+
| Environment variable | Description | Default value |
73+
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
74+
| `K6_WEB_DASHBOARD` | Enable the web dashboard | `false` |
75+
| `K6_WEB_DASHBOARD_HOST` | Host to bind the web dashboard to | `localhost` |
76+
| `K6_WEB_DASHBOARD_PORT` | Port to bind the web dashboard to | `5665` |
77+
| `K6_WEB_DASHBOARD_PERIOD` | Period in seconds to update the web dashboard | `10s` |
78+
| `K6_WEB_DASHBOARD_OPEN` | Open the web dashboard in the default browser | `false` |
79+
| `K6_WEB_DASHBOARD_EXPORT ` | Filename to automatically export the HTML test report to at the end of the test run. By default, the value is empty and the report isn't exported. | `` |

0 commit comments

Comments
 (0)