setUp(scn.inject(rampUsers(160) over (160 seconds))).maxDuration(10 minutes).protocols(httpProtocol)
with these lines above, I can compile But when I try to run the simulation program,
I have thes error messages :
[ERROR] [10/20/2014 14:51:59.725] [GatlingSystem-akka.actor.default-dispatcher-2
] [akka://GatlingSystem/user/$a] requirement failed: Scenario Call SOA is empty
java.lang.IllegalArgumentException: requirement failed: Scenario Call SOA is emp
ty
at scala.Predef$.require(Predef.scala:233)
at io.gatling.core.scenario.Simulation$$anonfun$scenarios$2.apply(Simula
tion.scala:40)
at io.gatling.core.scenario.Simulation$$anonfun$scenarios$2.apply(Simula
tion.scala:40)
at scala.collection.immutable.List.foreach(List.scala:318)
at io.gatling.core.scenario.Simulation.scenarios(Simulation.scala:40)
at io.gatling.core.controller.Controller$$anonfun$1.applyOrElse(Controll
er.scala:80)
at akka.actor.Actor$class.aroundReceive(Actor.scala:465)
at io.gatling.core.akka.BaseActor.aroundReceive(BaseActor.scala:23)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
at akka.actor.ActorCell.invoke(ActorCell.scala:487)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)
at akka.dispatch.Mailbox.run(Mailbox.scala:220)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(Abst
ractDispatcher.scala:393)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool
.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:19
79)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThre
ad.java:107)
14:51:59.749 [ERROR] i.g.c.c.Controller - Actor Controller crashed on message So
me(Run(advanced.OSB_SC1_Simulation@15b2e27,osb-sc1-simulation,Timings(Some(10 m
inutes),None,Map())))
java.lang.IllegalArgumentException: requirement failed: Scenario Call SOA is emp
ty
at scala.Predef$.require(Predef.scala:233) ~[scala-library.jar:na]
at io.gatling.core.scenario.Simulation$$anonfun$scenarios$2.apply(Simula
tion.scala:40) ~[gatling-core-2.0.0.jar:2.0.0]
at io.gatling.core.scenario.Simulation$$anonfun$scenarios$2.apply(Simula
tion.scala:40) ~[gatling-core-2.0.0.jar:2.0.0]
at scala.collection.immutable.List.foreach(List.scala:318) ~[scala-libra
ry.jar:na]
at io.gatling.core.scenario.Simulation.scenarios(Simulation.scala:40) ~[
gatling-core-2.0.0.jar:2.0.0]
at io.gatling.core.controller.Controller$$anonfun$1.applyOrElse(Controll
er.scala:80) ~[gatling-core-2.0.0.jar:2.0.0]
at akka.actor.Actor$class.aroundReceive(Actor.scala:465) ~[akka-actor_2.
10-2.3.6.jar:na]
at io.gatling.core.akka.BaseActor.aroundReceive(BaseActor.scala:23) ~[ga
tling-core-2.0.0.jar:2.0.0]
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) ~[akka-actor 2.10-2.3.6.jar:na]
at akka.actor.ActorCell.invoke(ActorCell.scala:487) ~[akka-actor_2.10-2.
3.6.jar:na]
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238) ~[akka-actor
2.10-2.3.6.jar:na]
at akka.dispatch.Mailbox.run(Mailbox.scala:220) ~[akka-actor_2.10-2.3.6.
jar:na]
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(Abst
ractDispatcher.scala:393) [akka-actor_2.10-2.3.6.jar:na]
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
[scala-library.jar:na]
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool
.java:1339) [scala-library.jar:na]
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:19
79) [scala-library.jar:na]
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThre
ad.java:107) [scala-library.jar:na]
I think I do not use accurately the maxDuration method.
Your problem has nothing to do with duration.
You somehow managed to remove the dot between the scenario call and the next exec so the scenario is indeed empty.
maxDuration limits the maximum run time of your simulation but does not lengthen it if your injection profile means that your simulation would end before that.
maxDuration has an effect if your simulation runs longer that the maxDuration, which is not the case here.
In your case, the simplest solution is :
If you removed it, wrap again your simulation in a during(10 minutes)
remove maxDuration
Set your injection profile so that it would run for more that 10 minutes (rampUsers(160) over (12 minutes) for example)