Gatling simulations with a fixed number of users over a period of time

I have my Gatling script installed, and now I want to set up a simulation with a fixed number of users for a certain period of time - the number of users must first be gradually increased to a certain value, and then saved there, adding a new one as needed as users finish.

I specifically do not want to use constantUsersPerSec (which introduces users at a constant speed), but something like .throttle(reachUsers(100) in rampUpTime, holdFor(10 minute)) , which should enter users if necessary.

+5
source share
1 answer

If this is still relevant: Gatling supports the throttle method to a large extent, as you have outlined. You can use the following building blocks (taken from docs ):

  • reachRps(target) in (duration) : specify the throughput with a ramp for a given duration.

  • jumpToRps(target) : Immediately jump to the specified bandwidth.

  • holdFor(duration) : hold the current bandwidth for a given duration.

So, a modified example for your use case might look something like this:

 setUp(scn.inject(constantUsersPerSec(100) during(10 minutes))).throttle( reachRps(100) in (1 minute), holdFor(9 minute) ) 
+1
source

Source: https://habr.com/ru/post/1259479/


All Articles