xk6-top
A k6 extension to updating the current k6 metrics summaries on the terminal during the test run. Metric summaries are updated on the terminal screen at regular intervals (default: 2s).
All custom k6 metrics (Counter,Gauge,Rate,Trend) and build-in metrics are supported.
Screenshot
asciicast
Table of Contents
Download
You can download pre-built k6 binaries from Releases page. Check Packages page for pre-built k6 Docker images.
Build
To build a k6
binary with this extension, first ensure you have the prerequisites:
- Go toolchain
- Git
Then:
- Download
xk6
:
$ go install go.k6.io/xk6/cmd/[email protected]
- Build the binary:
$ xk6 build --with github.com/szkiba/[email protected]
Usage
$ ./k6 run --out top script.js
Parameters
The output extension accept parameters in a standard query string format:
k6 run --out 'top=param1=value1¶m2=value2¶m3=value3'
Note apostrophe (
'
) characters around the--out
parameter! You should use it for escape&
characters from shell (or use backslash before&
characters).
The following parameters are recognized:
parameter | description |
---|---|
period | Screen refresh frequency (default: 2s ), example: 1m |
Docker
You can also use pre-built k6 image within a Docker container. To do that, you'll need to execute something more-or-less like the following:
Linux
docker run -v $(pwd):/scripts -it --rm ghcr.io/szkiba/xk6-top:latest run --out=top /scripts/script.js
Windows
docker run -v %cd%:/scripts -it --rm ghcr.io/szkiba/xk6-top:latest run --out=top /scripts/script.js
Display total and remaining duration of test
Hey, I just tried it and it looks really nice. I have one problem though, it doesn't seem to show how long the test has been running for (and/or remaining duration).
Additionally, would it be possible to show the name of the currently-running script?