You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sources/next/results-output/web-dashboard/_index.md
+37-29Lines changed: 37 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,26 +12,6 @@ k6 provides a built-in web dashboard that you can enable to visualize and monito
12
12
13
13
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.
14
14
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
-

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
-

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
-
35
15
## How to use
36
16
37
17
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
41
21
```
42
22
43
23
```shell
44
-
K6_WEB_DASHBOARD=true ./k6 run ../extensions/xk6-dashboard/script.js
24
+
K6_WEB_DASHBOARD=true ./k6 run script.js
45
25
46
26
/\ |‾‾| /‾‾/ /‾‾/
47
27
/\ / \ ||/ / / /
@@ -57,15 +37,43 @@ K6_WEB_DASHBOARD=true ./k6 run ../extensions/xk6-dashboard/script.js
57
37
58
38
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).
59
39
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
+

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
+

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
+
60
68
## Dashboard options
61
69
62
70
The web dashboard can be configured using environment variables:
63
71
64
-
| Environment variable | Description| Default value |
|`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 |
| `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