Tools / k6
Visit official site north_east

k6

k6 is an open-source load testing tool built for developers. Written in Go with JavaScript test scripts, it runs high-performance load tests with minimal system resources and integrates cleanly into CI/CD pipelines.

Features

Test Scripting

  • Write test scenarios in JavaScript/TypeScript (ES modules)
  • Built-in support for HTTP/1.1, HTTP/2, WebSocket, and gRPC
  • Lifecycle hooks: setup(), teardown(), and per-virtual-user logic
  • Reusable test logic with modules and imports

Load Scenarios

  • Virtual Users (VUs): Simulate concurrent users with ramping patterns
  • Arrival Rate: Control throughput by requests-per-second target
  • Scenarios: Compose multiple load patterns in a single test run
  • Thresholds: Define pass/fail criteria on metrics (error rate, p95 latency)

Metrics & Observability

  • Rich built-in metrics: http_req_duration, http_req_failed, iterations, vus
  • Custom metrics: counters, gauges, rates, and trends
  • Output to InfluxDB, Prometheus, Grafana, Datadog, and more
  • Grafana k6 Cloud for hosted result storage and analysis

Extensions

  • xk6 build tool for community extensions (browser, Kafka, SQL, Redis, etc.)
  • @grafana/k6-browser for browser-level load testing

Quick Start

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

export const options = {
    vus: 10,
    duration: '30s',
    thresholds: {
        http_req_failed: ['rate<0.01'],
        http_req_duration: ['p(95)<500'],
    },
};

export default function () {
    const res = http.get('https://api.example.com/health');
    check(res, { 'status 200': (r) => r.status === 200 });
    sleep(1);
}

Run the test:

k6 run script.js

Use Cases

  • API performance benchmarking before a release
  • Regression load testing in CI/CD pipelines
  • Spike and stress testing to find breaking points
  • SLA validation with threshold-based pass/fail gates

Pricing

k6 is free and open-source. Grafana k6 Cloud offers hosted test execution and result storage starting with a free tier.

Ready to get started? Visit the official site to learn more.

Visit official site north_east
An unhandled error has occurred. Reload