Gatling 2.0.0M3a
Objective to use command line parameters to specify users, ramp up time and duration of simulation.
Question: I got the code to compile as below, but, was wondering if there is a better way.
e.g. gatling.sh -s basic.mysimulation -Dusers=100 -Drampup=100 -Dsimulation_duration=3600
And the simulation would run with 100 users, coming in over 100 seconds (1 user per second)
and run the main simulation for 1 hour.
In my simulation, I do the following
40 val number_of_users = userNumber(Integer.getInteger(“users”))
41 val rampup = intToFiniteDuration(Integer.getInteger(“rampup”))
139 setUp(myScenario.inject(ramp(number_of_users) over (rampup))).protocols(httpProtocol)
I cannot use code like:
ramp(Integer.getInteger(“users”) users) over (Integer.getInteger(“rampup”) seconds)
10:34:06.054 [ERROR] i.g.a.ZincCompiler$ - mySimulation.scala:139: value seconds is not a member of scala.concurrent.duration.FiniteDuration
10:34:06.056 [ERROR] i.g.a.ZincCompiler$ - setUp(myScenario.inject(ramp(number_of_users) over (rampup seconds))).protocols(httpProtocol)
and
10:20:46.582 [ERROR] i.g.a.ZincCompiler$ - /mySimulation.scala:137: value users is not a member of String
10:20:46.584 [ERROR] i.g.a.ZincCompiler$ - setUp(myScenario.inject(ramp(System.getProperty(“users”) users) over (Integer.getInteger(“rampup”, 100) seconds))).protocols(httpProtocol)
Question2: How can I invoke scala compiler (ZincCompiler) from the command line for a specific scala file, instead of running gatling.sh to compile the changed code?
Thanks
Sajjad