-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document the web dashboard feature #1484
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
title: Web dashboard | ||
description: Track test results in real-time with the web-dashboard and generate HTML test reports directly from your web browser. | ||
weight: 200 | ||
--- | ||
|
||
# Web dashboard | ||
|
||
k6 provides a built-in web dashboard that you can enable to visualize and monitor your tests results in real-time. | ||
|
||
![Web dashboard screenshot](/media/docs/k6-oss/web-dashboard-overview.png) | ||
|
||
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. | ||
|
||
## How to use | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should move this section above the "HTML test reports" one, so it goes: Introduction, How to use, HTML reports, Dashboard options. |
||
|
||
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: | ||
|
||
```shell | ||
K6_WEB_DASHBOARD=true k6 run script.js | ||
``` | ||
|
||
```shell | ||
K6_WEB_DASHBOARD=true ./k6 run script.js | ||
|
||
/\ |‾‾| /‾‾/ /‾‾/ | ||
/\ / \ | |/ / / / | ||
/ \/ \ | ( / ‾‾\ | ||
/ \ | |\ \ | (‾) | | ||
/ __________ \ |__| \__\ \_____/ .io | ||
|
||
execution: local | ||
script: ../extensions/xk6-dashboard/script.js | ||
web dashboard: http://127.0.0.1:5665 | ||
output: - | ||
``` | ||
|
||
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). | ||
|
||
{{% admonition type="note" %}} | ||
|
||
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. | ||
|
||
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). | ||
|
||
{{% /admonition %}} | ||
|
||
## Generate HTML test reports | ||
|
||
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. | ||
|
||
![HTML test report screenshot](/media/docs/k6-oss/web-dashboard-report.png) | ||
|
||
### Generate report from web dashboard | ||
|
||
To generate a report from the web dashboard, click **Report** on the dashboard's menu. | ||
|
||
![HTML test report generation button](/media/docs/k6-oss/web-dashboard-report-button.png) | ||
|
||
### Generate report from the command line | ||
|
||
To automatically generate a report from the command line once the test finishes running, use the `K6_WEB_DASHBOARD_EXPORT` option. For example: | ||
|
||
```shell | ||
K6_WEB_DASHBOARD=true K6_WEB_DASHBOARD_EXPORT=html-report.html k6 run script.js | ||
``` | ||
|
||
## Dashboard options | ||
|
||
The web dashboard can be configured using environment variables: | ||
|
||
| Environment variable | Description | Default value | | ||
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | | ||
| `K6_WEB_DASHBOARD` | Enable the web dashboard | `false` | | ||
| `K6_WEB_DASHBOARD_HOST` | Host to bind the web dashboard to | `localhost` | | ||
| `K6_WEB_DASHBOARD_PORT` | Port to bind the web dashboard to | `5665` | | ||
| `K6_WEB_DASHBOARD_PERIOD` | Period in seconds to update the web dashboard | `10s` | | ||
| `K6_WEB_DASHBOARD_OPEN` | Open the web dashboard in the default browser | `false` | | ||
| `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. | `` | |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps a sentence could be written about how the report can be automatically saved using the
K6_WEB_DASHBOARD_EXPORT
environment variable, without starting a browser.