Skip to content
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

Adds script.scenario.path to ws engine #221

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

calebgregory
Copy link

I have a room-based real-time communication server that uses the URL path to specify the roomID and a URL query param ?id= to specify a clientID. I've implemented it to prevent two clients with the same clientID from being in the same Room at once. For example,

[0] peer1 makes request to wss://my-rtc-server-ho.st/room1?id=client1
[a]   client1 at peer1 connected to room1
[1] peer2 makes request to wss://my-rtc-server-ho.st/room1?id=client1
[a]   client1 at peer1 disconnected from room1
[b]   client1 at peer2 connected to room1

To load test this, I need to be able to change the WebSocket client's path. This PR adds the ability to do so.

Example

Suppose I've added a csv file with random IDs.

id
BATb3eukXu5V3e7y9eBWWvicNLiQZjN0
5IDZQ1pJCOdGSl1V3PhnBZfJcBBVCMy6
lSThKruBW1wZDJgZkmEWlTdR2k787QVf
RvxsCYgJ4CtvHPV0VMwAGmc7b39ooQoe
5seju5S9jHyi22UJ6EVdJyEOw2H9qFuS
...

I use this to test concurrent connections to a single room:

config:
  payload:
    path: "./random-ids.csv"
    fields:
      - "id"
    order: "sequence"
  target: "ws://my-rtc-server-ho.st"
  phases:
    - duration: 20
      arrivalRate: 10
scenarios:
  - engine: "ws"
    path: "/room1?id={{ id }}"
    flow:
      - send: '{"token":":)"}' # auth
      - think: 1
      - send: '{"some":"json"}'

I hope this is helpful. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant