k6 README

The project's README from github.com/grafana/k6. As one markdown file: README.md.

Grafana k6

Grafana Labs

Like unit testing, for performance

Modern load testing for developers and testers in the DevOps era.

Github release Build status Go Report Card Codecov branch
@k6_io on Twitter

Download · Documentation · Community Forum · Public Roadmap


---

k6 is a modern load-testing tool, built on our years of experience in the performance and testing industries. It's built to be powerful, extensible, and full-featured. The key design goal is to provide the best developer experience.

Its core features are:

This is what load testing looks like in the 21st century.

Example script

import http from "k6/http";
import { check, sleep } from "k6";

// Test configuration
export const options = {
  thresholds: {
    // Assert that 99% of requests finish within 3000ms.
    http_req_duration: ["p(99) < 3000"],
  },
  // Ramp the number of virtual users up and down
  stages: [
    { duration: "30s", target: 15 },
    { duration: "1m", target: 15 },
    { duration: "20s", target: 0 },
  ],
};

// Simulated user behavior
export default function () {
  let res = http.get("https://quickpizza.grafana.com");
  // Validate response status
  check(res, { "status was 200": (r) => r.status == 200 });
  sleep(1);
}

You can run scripts like this on the CLI, or in your CI, or across a Kubernetes cluster.

[!NOTE] Don't want to write code ?

We got you! Meet k6 Studio, a desktop application made to help you generate k6 scripts without having to touch code!

Documentation

The docs cover all aspects of using k6. Some highlights include:

These links barely scratch the surface! If you're looking for conceptual information, you can read about Test types, Test strategies, or one of the many informative Blog posts.

Roadmap

Our team is dedicated to continuously improving and providing the best user experience possible. The public roadmap covers user-oriented features, UX improvements and JavaScript support that our team will focus on. Remember that timeframes and priorities may shift, but we believe it's important to share our vision.

We hope it provides a clear overview of our plans for future development. We welcome feedback, corrections, and suggestions via GitHub to make it more comprehensive, accessible, and valuable for the community.

It's worth mentioning that we consider upvotes (thumbs-up) to be one of the essential metrics for determining community needs. If you want to show us the importance of a feature, please give it a thumbs-up.

Contribute

If you want to contribute or help with the development of k6, start by reading CONTRIBUTING.md. Before you start coding, it might be a good idea to first discuss your plans and implementation details with the k6 maintainers—especially when it comes to big changes and features. You can do this in the GitHub issue for the problem you're solving (create one if it doesn't exist).

Note: To disclose security issues, refer to SECURITY.md.

Support

To get help, report bugs, suggest features, and discuss k6 with others, refer to SUPPORT.md.

License

k6 is distributed under the AGPL-3.0 license.

k6 (grafana/k6)

Searching Database…

32K ·GitHub
What is this?k6 is a modern load-testing tool: you write test scripts that simulate real user traffic against your application to see how it performs. It is built for developers and testers in the DevOps era — like unit testing, but for performance.
Is k6 a CLI tool I install, or a library I import into my code?It is a CLI tool rather than a library: you run test scripts from the terminal, in your CI, or across a Kubernetes cluster. The engine is written in Go, while the test scripts themselves are JavaScript.
How do I run my first test?Install the k6 CLI and run a JavaScript test script from the terminal — the Get Started docs cover installing, running a test and inspecting results. Don't want to write code? k6 Studio is a desktop app that generates k6 scripts for you.
Do I write my tests in JavaScript or in Go?No Go knowledge needed: tests are written in JavaScript with the k6 scripting API, and an embedded JavaScript engine pairs Go's performance with JavaScript's familiarity.
Can my laptop generate enough load, or do I need beefy hardware?It is lighter than you might expect: load generation is configurable, and even lower-end machines can simulate lots of traffic.
Is it just for HTTP APIs, or other protocols too?Beyond HTTP, k6 supports WebSockets, gRPC and browser traffic, and its extension ecosystem adds even more protocols and use cases.
Where do the test results and metrics go?Wherever you want: k6 can export summary statistics or granular metrics to the service of your choice, with native integration into Grafana Cloud for execution, metrics correlation and analysis.
What are thresholds and scenarios good for?Thresholds let you set goals for a test and codify your SLOs, while scenarios define the workload model — open or closed models, constant RPS, fixed iterations, and more.
Can I extend k6 for my own use cases?Yes — it is built to be extensible, and a large ecosystem of extensions shared by the community already covers new protocols and use cases.
What are similar projects?locust, pyroscope, vegeta, hey, goreplay, insomnia, oha, loki
Creator
grafana
Size
83.7 MB
Stars
32K
Age
10y
Commits · 90 Days