# Group's mean requests per second calculation?

**URL:** <https://community.gatling.io/t/groups-mean-requests-per-second-calculation/4299>\
**Category:** Gatling (Open-Source)\
**Created:** [April 27, 2018, 7:53pm UTC](https://community.gatling.io/t/groups-mean-requests-per-second-calculation/4299 "2018-04-27T19:53:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomas\_Zeman](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@Tomas\_Zeman](https://community.gatling.io/u/Tomas_Zeman)\
**Post date:** [April 27, 2018, 7:53pm UTC](https://community.gatling.io/t/groups-mean-requests-per-second-calculation/4299/1 "2018-04-27T19:53:49Z")

</div>

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]”,  
“pathFormatted”: “group\_load-step–1----1c236”,  
“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
