Skip to content

Latest commit

 

History

History
65 lines (38 loc) · 1.31 KB

load-testing-k6.md

File metadata and controls

65 lines (38 loc) · 1.31 KB

Load Testing with k6 — Accellens

Last updated: 2025-12-23

This guide explains how to run load/performance tests with k6 in Accellens.


What we test

  • Gateway baseline: simple endpoints (e.g. /health) to validate API latency under load.
  • (Next) Scan orchestration endpoints once stable test fixtures exist.

Prerequisites

Choose one:

  • Install k6 locally (recommended): see k6 installation docs.
  • Use Docker (no local install required).

Quick start

1) Start the target service

By default, the sample script targets http://localhost:3000.

2) Run the load test

Using the repo helper:

BASE_URL=http://localhost:3000 VUS=10 DURATION=30s npm run test:load

Directly with k6:

BASE_URL=http://localhost:3000 k6 run tests/perf/k6/gateway-health.js

Tuning

  • BASE_URL: where to send traffic (staging/prod should be explicit)
  • VUS: number of virtual users (default: 10)
  • DURATION: scenario duration (default: 30s)

Interpreting results

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