Closed nitinv0078 closed 7 months ago
Because locust.run will block, so only the first step works.
How will first step know which tasks to execute then?
I think you can refer to taskset to control multiple tasks, and implement your own taskset, and the taskset can change the ratelimiter at runtime.
I tried multiple ways but nothing gave the desired outcome. Can you explain bit more. My understanding is even task set needs to be run via locust
AbstractTaskSet taskset = new TaskSetThatSupportSteps()
// create a timer in another thread
timer.run(
for (LocustConfig.Step step : locustConfig.getSteps()) {
locust.SetRateLimiter(xxxx);
taskset.clear()
taskset.add(other tasks)
}
)
locust.run(taskset)
yaml file being read into locustConfig: uiMaxRPS: 20 autoRun: true steps:
DurationInSec - indicates how long should the step be run in seconds NumUsers - indicates the maximum number of users to spawn HatchRate - indicates how fast each user can be spawn per second MaxRPS - indicates max RPS for the step Name - a label to show which step the schedule is running
I am trying to implement a scenario where if autoRun is true then the run of locust is automatic based on the details from Step in yaml config file and if possible the run is visible on the locust web UI or at least I still get the statistics report in a presentable form .
When autoRun is false then the user gets to control the NumUsers and HatchRate from Locust Web UI. The false flow is working very well but for autoRun true neither the task execution is happening as expected nor I see anything on locust web UI nor the execution stops after steps completion.
Below is code I used:
Please help me with this implementation.