Tools | trial

k6 is a versatile performance testing tool. Test scripting is done with JavaScript, but k6 itself is written in Go for better performance. It is available as a free and open-source tool or a paid SaaS with some additional features.

k6 doesn’t offer any built-in UI for running and monitoring the tests. Instead, all the tests are executed using the CLI. This, in combination with the possibility of defining custom checks and thresholds, makes it very easy to automate k6 tests. Test output can be saved to a JSON or CSV file, or streamed to an external service such as Grafana, Prometheus, or New Relic for deeper analysis and visualization.

One of the advantages of k6 over the other performance testing tool that we used, Locust, is very detailed metrics. It measures not only the cumulative response time but also the duration of the subsequent HTTP transaction steps: e.g. the time spent handshaking a TLS session with the remote host or time to first byte.

It’s worth noting that even though tests are written in JavaScript, k6 doesn’t support Node.js modules or npm packages. You can get around it by bundling the required packages, but it’s a bit cumbersome. Another disadvantage is that distributed load testing is available only in the premium SaaS version.

k6 is developer-friendly and easy to integrate both in existing pipelines and with external monitoring services. We will

definitely consider using it as a performance testing tool in future projects.