> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/grafana/k6/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction to k6

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

<img src="https://raw.githubusercontent.com/grafana/k6/master/assets/logo.svg" alt="k6" width="150" height="150" />

## Like unit testing, for performance

k6 is a modern load-testing tool built on years of experience in the performance and testing industries. It's designed to be powerful, extensible, and full-featured with the best developer experience at its core.

<Note>
  Don't want to write code? Meet [k6 Studio](https://github.com/grafana/k6-studio), a desktop application that helps you generate k6 scripts without touching code!
</Note>

## What is k6?

k6 is an open-source load testing tool that makes performance testing easy and productive for engineering teams. Built for the DevOps era, k6 enables you to write tests as code, integrate them into your CI/CD pipelines, and scale from local development to distributed cloud execution.

### Core philosophy

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

* **Tests as code**: Reuse scripts, modularize logic, version control, and integrate tests with your CI
* **Developer-first**: Familiar JavaScript syntax with the performance of Go under the hood
* **Production-ready**: Simulate real-world traffic patterns with flexible load generation
* **Cloud-native**: Native integration with Grafana Cloud and flexible metrics export

## Key features

<CardGroup cols={2}>
  <Card title="Configurable load generation" icon="gauge">
    Even lower-end machines can simulate lots of traffic with k6's efficient architecture.
  </Card>

  <Card title="Tests as code" icon="code">
    Write tests in JavaScript, version control them, and integrate seamlessly with your CI/CD pipeline.
  </Card>

  <Card title="Full-featured API" icon="bolt">
    Rich scripting API packed with features to simulate real application traffic patterns.
  </Card>

  <Card title="Embedded JavaScript engine" icon="rocket">
    Get the performance of Go with the scripting familiarity of JavaScript.
  </Card>

  <Card title="Multiple protocol support" icon="network-wired">
    HTTP, WebSockets, gRPC, Browser automation, and more out of the box.
  </Card>

  <Card title="Large extension ecosystem" icon="puzzle-piece">
    Extend k6 to support your needs with a rich ecosystem of community extensions.
  </Card>

  <Card title="Flexible metrics" icon="chart-line">
    Export summary statistics or granular metrics to the service of your choice.
  </Card>

  <Card title="Grafana Cloud integration" icon="cloud">
    Native SaaS solution for test execution, metrics correlation, and data analysis.
  </Card>
</CardGroup>

## Example test script

Here's what a k6 test looks like:

```javascript theme={null}
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);
}
```

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

## Use cases

k6 is perfect for:

* **Load testing**: Verify your system can handle expected traffic
* **Stress testing**: Find your system's breaking point
* **Spike testing**: Test how your system handles sudden traffic spikes
* **Soak testing**: Validate reliability over extended periods
* **API testing**: Functional and performance testing of REST APIs
* **Browser testing**: End-to-end testing with real browser automation

## Why choose k6?

<CardGroup cols={1}>
  <Card title="Developer experience" icon="heart">
    Write tests in familiar JavaScript, use modern ES6+ features, and enjoy excellent documentation and tooling.
  </Card>

  <Card title="CI/CD integration" icon="gears">
    Designed from the ground up to fit seamlessly into your continuous integration and deployment pipelines.
  </Card>

  <Card title="Scalability" icon="arrow-up-right-dots">
    Run tests from your laptop or scale to millions of requests across distributed infrastructure.
  </Card>

  <Card title="Open source" icon="github">
    AGPL-3.0 licensed with an active community and transparent development on GitHub.
  </Card>
</CardGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Install k6" icon="download" href="/installation">
    Get k6 installed on your platform in minutes
  </Card>

  <Card title="Quick start guide" icon="rocket" href="/quickstart">
    Run your first load test in under 5 minutes
  </Card>
</CardGroup>

<Warning>
  k6 is distributed under the AGPL-3.0 license. Make sure you understand the license terms before using k6 in your projects.
</Warning>
