Executing scenarios sequentially for different number of users?

Hi,

I have a simulation that I’d like to run multiple times with a different number of users. Basically, I want to see how the application behaves with, say, 100, 200, 300 users.

I tried doing something like this:

`

val hundred = scenario("100 Users").exec(MyTest.test)
val two_hundred = scenario("200 Users").exec(MyTest.tes)
val three_hundred = scenario("200 Users").exec(MyTest.tes)

setUp(hundred.inject(atOnceUsers(100)),
      two_hundred.inject(atOnceUsers(200)),
      three_hundred.inject(atOnceUsers(300))
).protocols(httpProtocol)

`

The problem is that gatling seems to run all of them at once, which sort of defeats my purpose (it’s running with 600 users at once).

Is there any way to achieve this? Am I looking at the problem the wrong way?

Right now I just have a single scenario, and I update the users for every run. Which is a bit cumbersome.

Thanks!
Roberto

Hi,

This way, you can at best:

In Gatling 2.2, you’ll be able to launch multiple simulations sequentially from the maven and the sbt plugins.

Cheers,

Actually there is a workaround to do this currently.

What you want to do is read number of user from command line arguments http://gatling.io/docs/2.1.3/cookbook/passing_parameters.html

Then in a batch/shell script call your simulation runs.

Something like

./gatling.shJAVA_OPTS="-Dusers=100 `-s

./gatling.sh JAVA_OPTS="-Dusers=200 -s <your fully qualified class name>

`

I haven’t tried it but some variation of this should work.

I’ve done it. I always specify number of users and test run duration from the command line. I also have parameters for ramp time, among other things. I have created wrappers to let me test with varying numbers of users: 1, 2, 5, 10, 20, 50, 75, 100, 150, …

Thanks, Abhinav!

I got it working using parameters.