An enterprise-ready, modular k6 performance testing framework with predefined SLA thresholds, smoke/load/stress profiles, and turnkey Docker Compose + InfluxDB + Grafana live telemetry.
Maintained with ❤️ by OpsTrellis — Engineering-driven QA, Load Testing, and Observability.
- Smoke Testing (
tests/smoke-test.js): Fast 30-second verification before merging pull requests. - Load Testing (
tests/load-test.js): Ramp-up from 0 to 100 concurrent virtual users (VUs) to measure sustained p95 and p99 response times. - Stress & Soak Testing (
tests/stress-test.js): Extreme load ramp-up to 500 VUs to determine system breaking points, connection pooling exhaustion, and recovery behavior. - Dockerized Observability: Pre-configured
docker-compose.ymlthat streams k6 metrics in real time into InfluxDB and renders them on an interactive Grafana dashboard.
Install k6 locally (official instructions):
# macOS
brew install k6
# Windows (winget or choco)
winget install k6 --source winget
# or
choco install k6
# Linux (Debian/Ubuntu)
sudo gpg -k
sudo gpg --no-default-keyring --keyring /usr/share/keyrings/k6-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69
echo "deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] https://dl.k6.io/deb stable main" | sudo tee /etc/apt/sources.list.d/k6.list
sudo apt-get update && sudo apt-get install k6# Run quick sanity check
k6 run tests/smoke-test.js
# Run full load test with custom target URL
TARGET_URL="https://your-api.com" k6 run tests/load-test.jsTo view live graphs of RPS, virtual users, and p95 latency:
docker compose up -d influxdb grafana
k6 run --out influxdb=http://localhost:8086/k6 tests/load-test.jsOpen your browser to http://localhost:3001 (user: admin, pass: admin) to view the real-time metrics.
Thresholds are centrally defined in src/config/thresholds.js:
export const standardThresholds = {
// 95% of requests must complete below 400ms, 99% below 800ms
http_req_duration: ['p(95)<400', 'p(99)<800'],
// HTTP failure rate must stay below 1%
http_req_failed: ['rate<0.01'],
};If any threshold is violated, k6 exits with non-zero code, failing your CI/CD pipeline immediately.
OpsTrellis designs scalable automated testing pipelines, API contract validation, and high-concurrency load testing for SaaS and enterprise platforms.
- Explore Services: OpsTrellis Custom Software & QA Engineering
- Contact Us: https://opstrellis.com/contact/
MIT License. Copyright (c) 2026 OpsTrellis.