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
Что это такое?k6 — это современный инструмент для нагрузочного тестирования: вы пишете тестовые скрипты, которые имитируют реальный трафик пользователей на ваше приложение, чтобы посмотреть, как оно справляется с нагрузкой. Он создан для разработчиков и тестировщиков эпохи DevOps — как юнит-тесты, только для производительности.
k6 — это CLI-утилита, которую я устанавливаю, или библиотека, которую я подключаю в свой код?Это CLI-утилита, а не библиотека: вы запускаете тестовые скрипты из терминала, в CI или на кластере Kubernetes. Сам движок написан на Go, а тестовые скрипты — на JavaScript.
Как мне запустить свой первый тест?Установите CLI-утилиту k6 и запустите тестовый скрипт на JavaScript из терминала — в документации раздел Get Start объясняет, как установить k6, запустить тест и посмотреть результаты. Не хотите писать код? k6 Studio — это десктопное приложение, которое генерирует скрипты для k6 за вас.
Тесты нужно писать на JavaScript или на Go?Знание Go не нужно: тесты пишутся на JavaScript с помощью API k6, а встроенный JavaScript-движок сочетает скорость Go с привычностью JavaScript.
Моего ноутбука хватит, чтобы создать нагрузку, или нужно мощное железо?Все легче, чем кажется: генерация нагрузки настраивается гибко, и даже не самые мощные машины могут имитировать большой трафик.
Он только для HTTP API или поддерживает и другие протоколы?Кроме HTTP, k6 поддерживает WebSockets, gRPC и браузерный трафик, а экосистема расширений добавляет еще больше протоколов и сценариев использования.
Куда попадают результаты тестов и метрики?Куда захотите: k6 умеет выгружать сводную статистику или детальные метрики в любой сервис на ваш выбор, причем с Grafana Cloud есть встроенная интеграция для запуска тестов, сопоставления метрик и их анализа.
Зачем нужны thresholds и scenarios?С помощью thresholds вы задаете целевые показатели для теста и формализуете свои SLO, а scenarios описывают модель нагрузки — открытую или закрытую модель, постоянный RPS, фиксированное число итераций и другое.
Могу ли я расширить k6 под свои задачи?Да — он изначально сделан расширяемым, и большая экосистема расширений от сообщества уже закрывает новые протоколы и сценарии использования.
What are similar projects?locust, pyroscope, vegeta, hey, goreplay, insomnia, oha, buildkit
Creator
grafana
Size
83.7 MB
Stars
32K
Age
10y
Commits · 90 Days