Search code examples
loadlocust

Locust with different wait time for different tasks


I am working on writing a load test for a websocket endpoint using locust 1.3.2 I have 3 task:

task A
      --> send data every 10seconds
task B
   subtask b1
       --> send data every 5 seconds
   subtask b2
       --> send data every 3 seconds
task C
    --> send data every 5 sec

There are 3 websocket endpoints on the same host to which data has to be sent using these task. I am confused as to how to structure my locust file

Should I create separate classes for task A , B and C?

or should I have 3 tasks in the same class?

or should I have 3 separate locustfiles?


Solution

  • My recommendation is to have 3 separate User classes (or maybe even 4, if you mean for the b1/b2 subtasks to run concurrently).

    I see no benefit to making separate files.