hi all ! i need an example for load testing apollo subscription on websocket. i tried artillery but no luck. i just need an example config or example file for any load testing library. my current artillery code is this if it helps:
target: "ws://localhost:3001/subscription" # Your WebSocket server URL
phases:
- duration: 60 # Duration of the test in seconds
arrivalRate: 5 # Number of new connections per second
ws:
connection:
headers:
Sec-WebSocket-Protocol: graphql-ws # Specify the graphql-ws subprotocol
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.9,az;q=0.8,tr;q=0.7,ru;q=0.6,tg;q=0.5,de;q=0.4
Cache-Control: no-cache
Connection: Upgrade
Pragma: no-cache
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
Sec-WebSocket-Version: '13'
Upgrade: websocket
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Host: localhost:3001
Origin: http://localhost:3001
Sec-WebSocket-Key: "CkFMtBrl0VsPJyKJ4eagwA=="
# proxy:
# url: 'http://localhost:3000'
scenarios:
- engine: "ws"
flow:
- send:
text: '{"type":"connection_init","payload":{}}'
- send:
text: '{"type":"subscribe","id":"1","payload":{"query":"subscription test { numberIncremented } "}}'
- think: 5
- loop:
- send: 'Hello from Artillery'
count: 10