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

**URL:** <https://community.gatling.io/t/the-number-of-users-must-be-a-strictly-positive-value/2347>\
**Category:** Gatling (Open-Source)\
**Created:** [June 9, 2015, 5:30pm UTC](https://community.gatling.io/t/the-number-of-users-must-be-a-strictly-positive-value/2347 "2015-06-09T17:30:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jarrowwx](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@jarrowwx](https://community.gatling.io/u/jarrowwx)\
**Post date:** [June 9, 2015, 5:30pm UTC](https://community.gatling.io/t/the-number-of-users-must-be-a-strictly-positive-value/2347/1 "2015-06-09T17:30:14Z")

</div>

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.(InjectionStep.scala:41)

at io.gatling.core.controller.inject.ConstantRateInjection.(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.(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.

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [June 9, 2015, 6:13pm UTC](https://community.gatling.io/t/the-number-of-users-must-be-a-strictly-positive-value/2347/2 "2015-06-09T18:13:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jarrowwx](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@jarrowwx](https://community.gatling.io/u/jarrowwx)\
**Post date:** [June 9, 2015, 6:28pm UTC](https://community.gatling.io/t/the-number-of-users-must-be-a-strictly-positive-value/2347/3 "2015-06-09T18:28:50Z")

</div>

That’s a fundamental problem for me, unless a workaround can be had. How do I sustain a low-frequency user injection rate?

---

<div class="post-metadata">

**Author:** ![jarrowwx](https://avatars.discourse-cdn.com/v4/letter/j/4af34b/32.png) [@jarrowwx](https://community.gatling.io/u/jarrowwx)\
**Post date:** [June 10, 2015, 2:26pm UTC](https://community.gatling.io/t/the-number-of-users-must-be-a-strictly-positive-value/2347/4 "2015-06-10T14:26:31Z")

</div>

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.
