# Group's mean requests per second calculation?

Hi,

I have a simulation that consists of warm-up (silent requests) and several groups. And it runs in total for 3000 seconds - 1500 seconds is the warm-up part and 1500 seconds are the groups.

Now here are are the first and the last records from the simulation.log for one selected group - Load Step #1 [ rps: 200 ]. The time span is 60 seconds which is correct.

GROUP Load Step #1 [ rps: 200 ] 213 Load Step #1 [ rps: 200 ] 1524747626805 1524747626817 9 OK

GROUP Load Step #1 [ rps: 200 ] 230 Load Step #1 [ rps: 200 ] 1524747684877 1524747687090 297 OK

So in such conditions, I would expect the final stats for this group to be:
numberOfRequests: 200 rps * 60 seconds = 12000
meanNumberOfRequestsPerSecond: 12000 requests / 60 seconds = 200

These stats would perfectly fit the parameters I specified in the beginning of the test.

Now, let’s see the final results generated in stats.json for the group:

“name”: “Load Step #1 [ rps: 200 ]”,
“path”: “Load Step #1 [ rps: 200 ]”,
“stats”: {
“name”: “Load Step #1 [ rps: 200 ]”,
numberOfRequests”: {
“total”: 12000,
“ok”: 12000,
“ko”: 0
},

meanNumberOfRequestsPerSecond”: {
“total”: 3.9946737683089215,
“ok”: 3.9946737683089215,
“ko”: 0
}
}

The meanNumberOfRequestsPerSecond here is wrong. The value is ~4 rps which is calculated as 12000 requests / 3000 seconds. 3000 seconds is time span of the whole test, including the silent phase.

The scenario for one group is defined as follows:

scenario(name)
.feed(feeder)
.forever() {
group(name) {
exec(request)
}
}
.inject(
nothingFor(scenarioStartTime(step)),
atOnceUsers(concurrency)
)
.throttle(
jumpToRps(0),
holdFor(scenarioStartTime(step)),
jumpToRps(stepRps(step)),
holdFor(throttleStepDurationSec),
jumpToRps(0),
holdFor(theRest)
)

I wanted to run the groups sequentially so to do that, I put a sleep (0 rps for sleep period, each group has different sleep period) at the beginning of each scenario. I don’t know any other way.

It’s clear that Gatling adds these 0 rps sleep periods into the group run time which alters the mean rps. How can I have stats only for the period I have group records in simulation.log?

Thank you