load_test.sample 499 B

1234567891011121314151617181920
  1. #!/bin/sh
  2. instance='127.0.0.1:4000'
  3. timeline='public:local'
  4. number_of_ws=300
  5. command -v websocat >/dev/null || { echo >&2 "Install websocat with `cargo install websocat` to use this script"; exit 1; }
  6. echo "Opening $number_of_ws WebSockets to $timeline"
  7. for i in $(seq 0 $number_of_ws); do
  8. websocat wss://${instance}/api/v1/streaming/?stream=${timeline} --no-close > /dev/null &
  9. done
  10. echo "$number_of_ws WebSocket connections established..."
  11. sleep 60
  12. echo "Closing WebSockets"
  13. echo "Done"