Как писать k6 скрипты для нагрузки?

Middle
361 просмотров
AFK Offer AI

k6 — JavaScript. Базовый скрипт: import http from "k6/http"; import {check, sleep} from "k6"; export default function() { const res = http.get("https://api.example.com/users"); check(res, {"status 200": (r) => r.status === 200}); sleep(1); }. Stages: export const options = {stages: [{duration: "30s", target: 100}, {duration: "1m", target: 100}, {duration: "10s", target: 0}]}. Thresholds: thresholds: {"http_req_duration": ["p(95)<500"], "http_req_failed": ["rate<0.01"]}. k6 Cloud для distributed. Метрики в Grafana через Prometheus remote write.

Следующий вопрос

Как запускать тесты параллельно?