strange behavior using during() statement and pauses

Hello,

I’m observing strange behavior in my simulation setup using Gatling 2.1.4. Let me explain. My simulation scenario looks like this:

class LBBenchmark extends Simulation {

val httpConf = http
.baseURL(“http://localhost”)
.acceptHeader(“text/html,application/xhtml+xml,application/xml,application/json,text/javascript;q=0.9,/;q=0.8”)
.acceptLanguageHeader(“en-US,en;q=0.5”)
.acceptEncodingHeader(“gzip, deflate”)
.connection(“keep-alive”)
.userAgentHeader(“Mozilla/5.0 (Windows NT 6.2; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0”)
.check(status.not(404), status.not(500))

val scn = scenario(“LB Benchmark”)
.during(60 seconds) {
exec(http(“redirect”)
.get("/redirect")).pause(20 seconds)
}

setUp(scn.inject(rampUsers(100) over (10 seconds)).protocols(httpConf))
}

Nothing extraordinary here. The /redirect request takes variable (random) time to complete and it responds with, well… redirect. So each GET to /redirect generates two requests.

When I run the simulation it ALWAYS results in 600 completed requests. I don’t know how is that possible because each request takes variable time to complete. The during() statement behaves as repeat(3) was used insted of it. The result of the simulation I just described is in no_global_pauses_modification-1424334085726 folder attached in this post.

Also, it looks like global simulation pause definition is ignored for normalPauses. Let me explain.

When I change the setUp statement to this one:
setUp(scn.inject(rampUsers(100) over (10 seconds)).protocols(httpConf)).pauses(normalPauses(5))
I get exactly the same behavior as in previous scenario. Result of this simulation is in normal_pauses-1424333758436 folder.

When I disable pauses althogether with:
setUp(scn.inject(rampUsers(100) over (10 seconds)).protocols(httpConf)).pauses(disabledPauses)
I has an effect, as expected.
I get exactly the same behavior as in previous scenario. Result of this simulation is in disabled_pauses-1424333852573 folder.

When I use this one:
setUp(scn.inject(rampUsers(100) over (10 seconds)).protocols(httpConf)).pauses(uniformPausesPlusOrMinusPercentage(50))
The results are different than previous two scenarious but still as a result I ALWAYS get 700 completed requests. This situation is in uniformPausesPlusOrMinusPercentage-1424334267969 folder.

I’m completely confused with this behavior and I don’t know how to interpret it. Is this a bug or am I doing something wrong ?

Thank you.

Martin

gatling_pauses.zip (1.13 MB)

no_global_pauses_modification: Cumulated response time (original request + redirect) is about 200-350ms, which is completely neglectable compared to your 20s pauses, so each user perform a request at 0, 20+, and 40+.

normal_pauses: documentation is lacking, and maybe API is inappropriate: the standard deviation you pass is expressed in milliseconds. We should either make it or a duration (or maybe a percentage of the value). With a 5ms stdDev, you ended up in the same situation as above, with ~20sec pauses.

disabled_pauses: I guess your sentence “I get exactly the same behavior as in previous scenario. Result of this simulation is in disabled_pauses-1424333852573 folder.” is a bad copy-pasting.

uniformPausesPlusOrMinusPercentage: I can’t reproduce the behavior you describe (always getting the same number of requests). I ran tests and got different numbers every time.

Cheers,

You are right when I changed .pauses(normalPauses(5)) to .pauses(normalPauses(5000)) everything is OK. The docs should definitely mention that. Thank you for explanation and for Gatling :slight_smile:

Martin