K6 is an open-source load testing tool developed by Grafana Labs. It is designed to help developers and engineers test the performance and reliability of their systems, particularly APIs, microservices, and websites. K6 is both an HTTP load and functional test tool, written in
Go and using th
gojaembedded
JavaScript
JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior.
Web browsers have ...
interpreter for test scripting purposes. Tests are written in
ECMAScript
ECMAScript (; ES) is a standard for scripting languages, including JavaScript, JScript, and ActionScript. It is best known as a JavaScript standard intended to ensure the interoperability of web pages across different web browsers. It is stan ...
6 using the Babel transpiler. There is support for
HTTP/2
HTTP/2 (originally named HTTP/2.0) is a major revision of the HTTP network protocol used by the World Wide Web. It was derived from the earlier experimental SPDY protocol, originally developed by Google. HTTP/2 was developed by the HTTP Working ...
,
TLS, test assertions, ramp up and down, duration, number of iterations etc. Standard metrics include reports to standard out but can include collectors that report to time-series databases which can be visualized in real-time. There is a
Jenkins
Jenkins may refer to:
People
* Jenkins (name), history of the surname
* List of people with surname Jenkins
* The Jenkins, country music group
Places United States
* Jenkins, Illinois
*Jenkins, Kentucky
* Jenkins, Minnesota
* Jenkins, Missour ...
plugin that can be combined with thresholds (global pass/fail criteria).
Features
* Developer-friendly: Uses JavaScript for scripting.
* Extensible: Can be extended with various modules and integrations.
* Performance testing: Supports stress, spike, and soak tests.
* Automation-friendly: Integrates with CI/CD pipelines for continuous testing.
History
K6 was initially released by LoadImpact in 2017. LoadImpact was later rebranded into k6 in 2020. K6 was then acquired by Grafana Labs in 2021. It has since become a popular tool for performance testing in the developer community.
Example and usage
The below script executes a GET request on the Wikipedia homepage, checks whether the HTTP status code is 200 and if we are using the HTTP/2 protocol.
import http from "k6/http";
import from "k6";
export default function()
The above test case can be run with the command
$ k6 run http_2.js
where
http_2.js
is the filename in which the test case is saved in.
See also
*
Software load testing
The term ''load testing'' or stress testing is used in different ways in the professional software testing community. ''Load testing'' generally refers to the practice of modeling the expected usage of a software program by simulating multiple use ...
*
Grafana
Grafana is a multi-platform open source analytics and interactive visualization web application. It can produce charts, graphs, and alerts for the web when connected to supported data sources.
There is also a licensed Grafana Enterprise version ...
*
Continuous integration
Continuous integration (CI) is the practice of integrating source code changes frequently and ensuring that the integrated codebase is in a workable state.
Typically, developers Merge (version control), merge changes to an Branching (revisio ...
References
External links
*
*
Free software testing tools
Software using the GNU Affero General Public License
Free and open-source software
Cross-platform free software
Free software for Linux
Free software for macOS
Free software for Windows
Free software programmed in JavaScript
Free software programmed in Go
{{programming-software-stub