Response time for whole scenario?

Hi, I’m having a system with workflow like this:

send an API request for a file
-> System acknowledges, sends out response
   - -> System then forms file in backend 
        - - -> Browser then calls refresh API repeatedly until status of this file changes to COMPLETE

In total, there will be 3 APIs to be called, the 3rd APIs will be called repeatedly after 5 seconds to refresh. What I’m thinking is if Gatling support a way to log the total response time of the scenario, something like this:

scenario("name")
.exec(
     logReponseTime(
         API#1,
         API#2,
         doWhile(...){
             API#3
         }
     )
)

thanks for reading :slight_smile:

Looks like using group could solve your problem:
:backhand_index_pointing_right: Gatling Scenario Groups

  • Cumulated response time → Group duration minus pauses
  • Duration → Total group time (including pauses)

About group timings, check this:
:link: Gatling Timings Reference

Example

ScenarioBuilder scenarioBuilder = scenario("dummy scenario")
            .exec(
                    group("yourTransactionForMeasure").on(
                            dummy("request_1",100),
                            pause(1,3),
                            dummy("request_2",100),
                            pause(1,3),
                            repeat(3).on(
                                    dummy("request_3",100),
                                    pause(1,3)
                            ),
                            doWhile("#{foo.isUndefined()}","iteration").on(
                                    dummy("request_4",100),
                                    pause(1,3),
                                    doIfEquals("#{iteration}", 3).then(
                                            exec(session -> session.set("foo",true))
                                    )
                            )
                    )
            );

Cumulated response time

Duration

2 Likes

nice, thank you Ivan :smiley: