The number of users must be a strictly positive value...

319 views
Skip to first unread message

John Arrowwood

unread,
Jun 9, 2015, 1:30:14 PM6/9/15
to gat...@googlegroups.com
Am seeing the following exception:

Exception in thread "main" java.lang.IllegalArgumentException: requirement failed: The number of users must be a strictly positive value

       at scala.Predef$.require(Predef.scala:219)

       at io.gatling.core.controller.inject.RampInjection.<init>(InjectionStep.scala:41)

       at io.gatling.core.controller.inject.ConstantRateInjection.<init>(InjectionStep.scala:56)

       at io.gatling.core.controller.inject.InjectionSupport$ConstantRateBuilder.during(InjectionSupport.scala:29)

       at com.cigna.rtde.client.ClientBehavior$class.perHour(ClientBehavior.scala:31)

       at com.cigna.rtde.client.AppsAndActivities$.perHour(AppsAndActivities.scala:11)

       at com.cigna.rtde.client.AppsAndActivities$.behavior(AppsAndActivities.scala:21)

       at com.cigna.rtde.simulation.ProductionSimulation.<init>(ProductionSimulation.scala:16)

       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

       at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

       at java.lang.reflect.Constructor.newInstance(Unknown Source)

       at java.lang.Class.newInstance(Unknown Source)

       at io.gatling.app.Gatling.run(Gatling.scala:90)

       at io.gatling.app.Gatling.runIfNecessary(Gatling.scala:73)

       at io.gatling.app.Gatling.start(Gatling.scala:63)

       at io.gatling.app.Gatling$.start(Gatling.scala:51)

       at io.gatling.app.Gatling$.fromArgs(Gatling.scala:43)

       at io.gatling.app.Gatling$.main(Gatling.scala:37)

       at io.gatling.app.Gatling.main(Gatling.scala)


My simulation includes a number of individual scenarios being run concurrently.  I have a "baseline" per-hour rate, and a "multiplier" (so we can evaluate the impact as the traffic grows).  I implemented it something like this:

perHour(multiplier,perHourRate,scenario),...

The definition of perHour is:

 def perHour(

   multiplier: Double,

   rate: Double,

   flow: ScenarioBuilder

 ) =

   flow.inject(

     rampUsersPerSec( 1.0 / 3600.0 )

       to ( rate * multiplier / 3600.0 )

       during ( Test.rampTime )

       randomized,

     constantUsersPerSec( rate * multiplier / 3600.0 )

       during ( Test.duration )

       randomized

   )


Rate is a positive number, in this case "6".  Multiplier is a positive number, "1.0".  So we are passing ( 1.0 * 6.0 / 3600.0 ) or ( 0.001666 ) to the to() method, and the constantUsersPerSec() method.  One of them is not doing the right thing.

NOTE:  I modified "multiplier" to be 10, and the problem goes away.  It appears to be some kind of rounding problem.

Stéphane LANDELLE

unread,
Jun 9, 2015, 2:13:57 PM6/9/15
to gat...@googlegroups.com
No, the issue is with your "constantUsersPerSec".
It's actually turned into "rampUser" and it doesn't support injecting less than one user per second.

Stéphane Landelle
Lead developer


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Arrowwood

unread,
Jun 9, 2015, 2:28:50 PM6/9/15
to gat...@googlegroups.com
That's a fundamental problem for me, unless a workaround can be had.  How do I sustain a low-frequency user injection rate?

John Arrowwood

unread,
Jun 10, 2015, 10:26:31 AM6/10/15
to gat...@googlegroups.com
So, I appear to be able to work around it by just using rampUser with the same From and To values.  Could this just be a problem with not using full precision throughout the calculations?  Or some kind of rounding error? Because it seemed to work with 60/3600 but not 6/3600.
Reply all
Reply to author
Forward
0 new messages