# Group total is wrongly calculated

**URL:** <https://community.gatling.io/t/group-total-is-wrongly-calculated/6254>\
**Category:** Gatling (Open-Source)\
**Created:** [September 18, 2021, 10:19am UTC](https://community.gatling.io/t/group-total-is-wrongly-calculated/6254 "2021-09-18T10:19:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![umeshwaran\_v](https://avatars.discourse-cdn.com/v4/letter/u/f4b2a3/32.png) [@umeshwaran\_v](https://community.gatling.io/u/umeshwaran_v)\
**Post date:** [September 18, 2021, 10:19am UTC](https://community.gatling.io/t/group-total-is-wrongly-calculated/6254/1 "2021-09-18T10:19:37Z")

</div>

Hi,

In our scenario group is added for the executions. It looks group total is wrongly calculated. The image is attached and highlighted the group total.

Please kindly let me know how to fix this. And also is there a setting to convert milliseconds values to seconds values for percentiles.

 ![gatlingGrouping.jpg](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/1X/70ba3ad3b79ff4411e38888a1a1ec283875d4d31.jpeg)

Regards,  
Umeshwaran.V

---

<div class="post-metadata">

**Author:** ![sbrevet](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/sbrevet/32/830_2.png) [@sbrevet](https://community.gatling.io/u/sbrevet)\
**Post date:** [September 18, 2021, 11:32am UTC](https://community.gatling.io/t/group-total-is-wrongly-calculated/6254/2 "2021-09-18T11:32:39Z")

</div>

Hi,

What do you call wrongly calculated?  
Things do not add up and this is perfectly fine, depending on your group definition.

For instance, if you have conditional branches in your group:

```auto
group("withCondition") {
  doIfOrElse(_ => Random.nextInt(10) > 5) {
    exec(http("if true").get("..."))
  } {
    exec(http("if false").get("..."))
  }
}

```

You will have values for `"if true"` and `"if false"` but the group won’t be the sum.

On other hands, pauses are not shown as requests.

Another concern will be the difference between averages and percentiles.  
The metrics are not identical:

- group: duration of the whole group
- request: duration of one single request

Your group may be smaller, bigger,

If you continue to be convinced that are issues with calculation, please, be more specific and provide the injection logs.

Cheers!

 ![gatlingGrouping.jpg](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/1X/70ba3ad3b79ff4411e38888a1a1ec283875d4d31.jpeg)

---

<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:** [September 18, 2021, 11:37am UTC](https://community.gatling.io/t/group-total-is-wrongly-calculated/6254/3 "2021-09-18T11:37:28Z")

</div>

Doc about group metrics: [https://gatling.io/docs/gatling/reference/current/general/reports/](https://gatling.io/docs/gatling/reference/current/general/reports/)
