Understading test duration

Hi,

I’m trying to reverse-engineer and understand a test written by one of our testers. I found the concept of duration can occur in multiple places in the test

  • duration1 seems to be for a single step of a scenario
  • duration2 is for whole scenario, including all steps so must be >duration1, right?
  • duration4 is when Gatling slowly limits the traffic (throttling), so it is after executing the scenario for duration2 period of time
  • duration3 includes both scenario execution and throttle, right?

Regards,
Maciej

val scn = scenario(“Generate once, validate many”)
.tryMax(3) {
exec(login)
}
.exitHereIfFailed
.tryMax(3) {
exec(generateToken)
}
.exitHereIfFailed
.during(duration1) {
forever {
pace(5 seconds).repeat(5) {
exec(validateToken)
}
}
}

setUp(
GenerateOnceValidateMany.scn.inject(
rampUsers((maxRps * 1.1) toInt) over(duration2)
)
)
.protocols(httpConf)
.maxDuration(duration3)
.throttle(
reachRps(maxRps) in (duration4)
holdFor(duration)
)

  • duration1 is how long each virtual user will perform this during loop. Each virtual user is independent.
  • duration2 is the duration of your user injection ramp. You use this to control arrival rate. Not related to other durations.
  • duration4 and duration control throttling (so you can reduce and shape the number of requests per second your scenario normally generates)
  • duration3 will shut down run no matter how many virtual users are still running or waiting to be scheduled. But throttle duration (duration4 + duration) will have precedence if it’s greater.