Is it possible to change load during runtime?


I suppose my question is not possible, but I’m asking just in case.
But I would like, just for fun, to change the load by reading users per seconds (constantUsersPerSec) from a file which I can edit the value in during runtime?

That means
1: I have a text-file with a value in for constant users per sec
2: I start a test and the value is read from the file
3: If I update the value in the file, the load will change accordingly runtime

We are going to have a hackaton, and my idea, just for fun is to connect some hardware (a potentiometer) to the computer to be able to change the load during runtime.
In addition create a website where we can update the same value.



No, it’s not currently possible.
First, the injection function is computed upstream.
Then, Gatling doesn’t provide a way to interact at runtime.
However, that’s something we have in the FrontLine roadmap.


Hi Stèphane,
I have a similar question.
I want to simulate a scenario where guest traffic goes up & down at each second/minute level. For the same reason I don’t want to use fixed number of users/tps as part of scenario.
A crude way is; I can have a file with no. of entries required each second & users finish the file & don’t loop in a second. Then for the next second they pick up next file & I am hoping pause function can give me that flexibility.
Any other suggestion would be appreciated.


Since the number of users injected can’t be dynamically changed at runtime, you could probably do something along these lines:

  • Always inject the max number of users per second that you’ll need during your test- At the beginning of each user’s iteration, load whatever value you need from external source (file / redis / some external web server hosting etc, depending on your use case and taking scalability into account).
  • Evaluate that value loaded at runtime using a doIf() - programmatically calculate whether to run the iteration code (return true) or not (return false)

Thanks for the suggestion, I have been thinking along the same line. But only problem with including a doif() at a user level would be that I won’t have information regarding total load being injected or whether the file got completed or not.