8

I have my Gatling scenario set up and now I want to configure a simulation with fixed number of users for specific period of time - number of users should initially be increased gradually to specific value and then kept there by adding new as required as users finish.

I specifically don't want to use constantUsersPerSec (which injects users at a constant rate) but something like .throttle(reachUsers(100) in rampUpTime, holdFor(10 minute)) which should inject users when required.

Jarek Przygódzki
  • 4,284
  • 2
  • 31
  • 41

1 Answers1

7

If it's still relevant: Gatling supports a throttle method pretty much as you outlined it. You can use the following building blocks (taken from the docs):

  • reachRps(target) in (duration): target a throughput with a ramp over a given duration.

  • jumpToRps(target): jump immediately to a given targeted throughput.

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

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

setUp(scn.inject(constantUsersPerSec(100) during(10 minutes))).throttle(
  reachRps(100) in (1 minute),
  holdFor(9 minute)
)
Phonolog
  • 6,321
  • 3
  • 36
  • 64