Inserting a configurable pause before each User

Hello all,

I have an existing scenario that adds users linearly. The code in question:

}.inject(rampUsers(numInstances) over rampUpDuration)

I want to add a random pause before each user is started, but still generally follow the linear ramp up. Will the following modification do this? Or is this pause a global pause, followed by each user being created like the code above:

}.inject(nothingFor(scala.util.Random.nextInt(25)), rampUsers(numInstances) over rampUpDuration)

If the above is indeed a “global” pause (not what I need), is there another way I can inject a pseudo-random pause before each user is started?



A couple points on that, first that’s a global pause for user injection. That basically is just saying “don’t start my test for some random amount of time, then start ramping users”.

The way I’d do this is as part of defining your user action sequence, something like:

val search = pause(scala.util.Random.nextInt(25)).

Note though, the scala.util.Random.nextInt(25) happens once, at the time of initialization. That’s not going to perform a random pause for each user. As such it probably doesn’t make sense to do that.

After reading the docs at

pause(0 seconds, 25 seconds)

Seems to be what I needed.