By default, k6 will print runtime information and general results to
stdout while the test is running, and a summary after the test has ended.
Runtime output to stdout
By default, k6 sends its output to stdout only. When started up, it will display a very tasteful ASCII splash screen with the k6 logo and version information, plus details about the test and options active. We will go through the things one by one here:
execution: localk6 is not being used to control another k6 instance (distributed execution).
output: -Output is sent to stdout only.
script: group.js (js)Shows what script we are running. The
duration: 0s, iterations: 1The VUs in the test will only perform one single script iteration (calling the default function once) each, and there is no time limit set.
vus: 1, max: 1Simulate 1 VU (virtual user), allocate resources for a "max" of 1 VU (meaning we can't scale up the load level in this case).
done [==============] 800ms / 800msThis is the progress bar that updates while the test is running, to indicate how far the test has come and how much time has passed.
█ my user scenariois the name of a group we have created in our JS script.
█ front pageis the name of a sub-group that was created inside the previously mentioned group ("my user scenario").
✓ 100.00% - status code is 200is the result from a check() that was executed inside the "front page" group. Note how this check result is indented, to indicate that it belongs to the "front page" group. The "front page" group name, in turn, is indented to indicate it belongs to its parent group ("my user scenario").
█ features pageis another group that belongs to the parent group "my user scenario".
✓ 100.00% - status code is 200and
✓ 100.00% - h1 message is correctare two more checks that belong to the "features page" group.
checks................: 100.00%tells us the percentage of our checks that passed.
And then comes the HTTP timing information. There are several metrics being reported here, and percentiles etc. for each of them:
http_req_blockedThe time VUs spent waiting to be allocated a TCP connection from the connection pool.
http_req_connectingThe time VUs spent performing TCP handshakes (setting up TCP connections to the remote host).
http_req_looking_upThe time spent performing DNS lookups.
http_req_sendingThe time spent transmitting HTTP requests to the remote host.
http_req_waitingThe time spent waiting for a response to come back from the remote host (after having sent a request).
http_req_receivingThe time spent receiving a reply from the remote host.
http_req_durationTotal time for the request. It's equal to
http_req_sending + http_req_waiting + http_req_receiving(i.e. how long did the remote server take to process the request and respond, without the initial DNS lookup/connection times).
All of these are metrics of the Trend type, which means you can extract max, min, percentile, average values from them. On stdout they are printed like this:
http_req_duration.....: avg=46.32ms, max=46.32ms, med=46.32ms, min=46.32ms, p90=46.32ms, p95=46.32ms
After the HTTP timing metrics, there will be a few final lines of output:
http_reqs........: 2The total number of HTTP requests made during the whole load test.
iterations........: 1The total number of times all VUs in the test managed to run through the default() function.
vus.................: 1How many VUs the test was configured to simulate.
vus_max........: 1The number of pre-allocated VU slots the test was configured for (vus_max allows you to scale up the number of VUs in the test to max that number).
Output result data
k6 may also output more granular result data using special output plugins. Currently, there are a few plugins that can output data:
- JSON plugin that writes data in JSON format to a file
Plugins that push the metrics to:
- Cloud plugin that streams your test results to the k6 Cloud platform
To know more about the metrics k6 collects, please see the Metrics management page
You can simultaneously send the emitted metrics to several outputs by using the CLI
--out flag multiple times, for example:
$ k6 run --out json=test.json --out influxdb=http://localhost:8086/k6