-
Notifications
You must be signed in to change notification settings - Fork 1
feat(load-tests): add local load test runner #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adds a new load testing package with two scenarios: - connection-storm: Rapid connection establishment testing - steady-state: Connection stability over time Usage: yarn start --target=ws://localhost:8000/connection/websocket --scenario=steady-state --connections=100 --duration=60 Features: - Centrifuge WebSocket client wrapper with timing - Progress bar with real-time connection status - JSON output with latency percentiles - Configurable ramp-up pacing Note: Infrastructure commands (infra, results aggregate) are placeholders for the follow-up distributed testing PR.
- Rename 'latency' to 'connectTime' for clarity (measures connection establishment time, NOT message RTT) - Add p50 and p99 percentiles to connectTime stats - Fix connectionStability comment to accurately describe what it measures (percentage connected at end, not 'stayed connected the whole time') - Add temp/ to gitignore for working documents - Update lavamoat config for tsx>esbuild
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning MetaMask internal reviewing guidelines:
Ignoring alerts on:
|
…ck overflow Since the array is already sorted ascending, use sorted[0] for min and sorted[sorted.length - 1] for max instead of Math.min/max(...sorted). This prevents RangeError: Maximum call stack size exceeded when testing with >65K connections.
|
These alerts are for packages used exclusively in
The flagged packages are expected dependencies for SSH-based infrastructure management: @SocketSecurity ignore npm/ssh2@1.17.0 @SocketSecurity ignore npm/buildcheck@0.0.7 @SocketSecurity ignore npm/cpu-features @SocketSecurity ignore npm/asn1 |
|
@SocketSecurity ignore npm/ssh2@1.17.0 |
|
@SocketSecurity ignore npm/buildcheck@0.0.7 |
|
@SocketSecurity ignore npm/cpu-features@0.0.10 |
|
@SocketSecurity ignore npm/asn1@0.2.6 |
- Remove .gitkeep, results/ dir is created programmatically - Remove redundant .infra-state.json ignore (already covered by results/) - Simplify .tsbuildinfo pattern to **/*.tsbuildinfo
Summary
Adds a new
apps/load-testspackage with a local load test runner for validating the relay server's WebSocket connection handling.Features
Two test scenarios:
connection-storm: Rapid connection establishment (tests throughput)steady-state: Connect and hold for duration (tests stability)Rich output:
Usage
cd apps/load-testsRun against local Docker Compose
yarn start --target=ws://localhost:8000/connection/websocket --scenario=steady-state --connections=100 --duration=60Run against production
yarn start --target=wss://mm-sdk-relay.api.cx.metamask.io/connection/websocket --scenario=connection-storm --connections=500 --ramp-up=10 --output=results/test.jsonNote
Adds a new
apps/load-testspackage to run local WebSocket load tests against a Centrifugo relay.startcommand executesconnection-stormandsteady-statescenarios with ramp-up/hold, using aCentrifugeClientwrapper and progress barswriterinfra,resultsstubs),.env.example, and ignoresresults/.gitignorefor**/*.tsbuildinfo; update root LavaMoat allowScripts fortsx>esbuildWritten by Cursor Bugbot for commit 1c54b83. This will update automatically on new commits. Configure here.