- Updated README.md to reflect changes in load testing commands and added usage examples for Bash scripts. - Converted PowerShell load testing scripts to Bash equivalents for better cross-platform compatibility. - Added new Bash scripts: run-loadtests.sh, summarize-artillery.sh, and summarize-k6.sh to mirror existing PowerShell functionality. - Updated admin-api.js and ws-chat.yml for consistency and improved performance metrics reporting. - Enhanced error handling and output formatting in summary scripts for better readability.
Load Test Scaffolding
These files back the scaling/performance playbook.
WebSocket chat (artillery)
Run with an explicit WebSocket URL, capturing output to an artifact file:
export WS_URL='wss://linearvoid.tv/ws?username=loadtest&room=main'
mkdir -p artifacts
npx artillery run scripts/loadtest/ws-chat.yml --output artifacts/ws-chat-report.json
Summarize key counters, rates, and available percentile stats from a saved Artillery JSON report:
scripts/loadtest/summarize-artillery.sh artifacts/ws-chat-report.json
Admin API (k6)
Run with a cookie or session header that can access admin endpoints, capturing machine-readable metrics and a text summary:
export ADMIN_BASE_URL='https://linearvoid.tv'
export ADMIN_SESSION_COOKIE='session=...'
mkdir -p artifacts
k6 run --summary-export artifacts/admin-api-summary.json scripts/loadtest/admin-api.js | tee artifacts/admin-api-output.txt
The script emits global and per-endpoint thresholds (overview, analytics, chat-log, users) so p95 and error-rate regressions are visible per route.
Summarize endpoint p95 and failure rates from a saved k6 JSON summary:
scripts/loadtest/summarize-k6.sh artifacts/admin-api-summary.json
Runner helper
Use the helper to run one scenario or both and automatically write outputs into a dated artifact folder:
- The helper resolves scenario paths from its own script location, so it can be run from any current working directory.
- WebSocket runs also emit
ws-chat-summary.txtwith connection/error counters and available summary percentiles. - Admin runs also emit
admin-api-endpoint-summary.txtwith per-endpoint p95/error values.
scripts/loadtest/run-loadtests.sh -s ws -w 'wss://linearvoid.tv/ws?username=loadtest&room=main'
scripts/loadtest/run-loadtests.sh -s admin -a 'https://linearvoid.tv' -c 'session=...'
scripts/loadtest/run-loadtests.sh -s all -w 'wss://linearvoid.tv/ws?username=loadtest&room=main' \
-a 'https://linearvoid.tv' -c 'session=...'
Notes
- Adjust target URLs for test lab or production.
- Keep the same commit SHA or image tag when comparing runs.
- Record results using the worksheet in
docs/operations/scaling-performance-playbook.md. - Store raw outputs under an
artifacts/folder per run date (for exampleartifacts/2026-08-09/). - The repository
.gitignoreexcludes benchmark artifacts by default.