Updating the current k6 metrics summaries on the terminal during the test run.

  • By Iván Szkiba
  • Last update: Apr 5, 2023
  • Comments: 1

xk6-top logo 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

xk6-top snapshot

asciicast

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:

Then:

  1. Download xk6:
$ go install go.k6.io/xk6/cmd/[email protected]
  1. 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&param2=value2&param3=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

Download

xk6-top.zip

Comments(1)

  • 1

    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?