This directory contains the comprehensive load testing framework for Gatheraa, built with k6. It is designed to simulate realistic user traffic, detect performance regressions, and help identify bottlenecks in the Payment and Notification services.
- k6: The load testing engine that executes the test scripts.
- InfluxDB: Time-series database to store real-time test metrics.
- Grafana: Visualization dashboard to monitor performance baselines and regressions.
Start the metrics backend (InfluxDB and Grafana):
cd test/load
docker-compose up -dGrafana will be available at http://localhost:3000 (Default creds: admin/admin).
You can run tests using the provided helper script:
chmod +x run-test.sh
./run-test.sh scenarios/payment-flow.jsOr manually with k6:
k6 run --out influxdb=http://localhost:8086/k6 scenarios/payment-flow.js- Payment Flow (
scenarios/payment-flow.js): Simulates high-volume ticket purchases via Stripe and Crypto. - Notification Flow (
scenarios/notification-flow.js): Tests WebSocket connection stability and message delivery latency. - Chaos Test (
scenarios/chaos-test.js): Simulates traffic spikes to test system resilience and recovery.
Tests are configured with pass/fail thresholds (e.g., 95% of requests < 500ms). If these thresholds are breached, the CI/CD pipeline will fail, signaling a performance regression.