Last updated: 2025-12-23
This guide explains how to run load/performance tests with k6 in Accellens.
- Gateway baseline: simple endpoints (e.g.
/health) to validate API latency under load. - (Next) Scan orchestration endpoints once stable test fixtures exist.
Choose one:
- Install k6 locally (recommended): see k6 installation docs.
- Use Docker (no local install required).
By default, the sample script targets http://localhost:3000.
Using the repo helper:
BASE_URL=http://localhost:3000 VUS=10 DURATION=30s npm run test:loadDirectly with k6:
BASE_URL=http://localhost:3000 k6 run tests/perf/k6/gateway-health.js- BASE_URL: where to send traffic (staging/prod should be explicit)
- VUS: number of virtual users (default: 10)
- DURATION: scenario duration (default: 30s)
Current thresholds are defined in the script:
http_req_failed < 1%p95(http_req_duration) < 500ms
If thresholds fail:
- capture the k6 output as an artifact (CI) or attach it to the ticket (manual run)
- include environment, VUs, duration, and a link to the deployment/commit