Capturing Load Time for looping API call

Gatling version: 3.15.1
Gatling flavor: java kotlin scala javascript typescript
Gatling build tool: maven gradle sbt bundle npm

I made sure I’ve update my Gatling version to the latest release
I read the guidelines and how to ask a question topics.
I provided a SSCCE (or at least, all information to help the community understand my topic)
I copied output I observe, and explain what I think should be.

Hello Community,
I have a scenario where I have an HTTP request which starts a process on the backend to summarize some data. The request returns a JSON response with a status value of ‘SUMMARIZING’.
I need to create a loop that continues to make that request until the status value in the response returns ‘SUMMARIZED’. There is 1 second pause between requests in the loop. The load time I want is the TOTAL time it takes to get a response status value of ‘SUMMARIZED’, which would include the pauses in between requests. I know it takes about an avg of 40 seconds to summarize the data. What is the best way to simulate this in Gatling and capture the total response time including pauses? Any help would be appreciated. Currently I am only able to capture the time of the request itself not the cumulative time of all the requests in the loop including the pause time?

Thanks,
Timmer

What you’re looking for is group: Gatling scenario scripting reference

Hello Slandelle,
I have tried the following code and the first group just gives me the timings of the “AthenaAdvisorSummarizationWindowNoResponses20260528_3” call itself based on the number of requests made until the request returns the ‘SUMMARIZED’ status back:

exec(session -> session.set("loop_start_time", System.currentTimeMillis()).set("loop_attempt_count", 0)),
group("AthenaAdvisorSummarization_Loop").on(
  asLongAs(session -> {
            String status = session.getString("summarization_status");
            return status == null || !status.equals("SUMMARIZED");
  }).on(
    exec(session -> {
      int currentCount = session.getInt("loop_attempt_count");
      return session.set("loop_attempt_count", currentCount + 1);
    }),
    http("AthenaAdvisorSummarizationWindowNoResponses20260528_3:GET_http://athena-advisor-int3/api/claim/#{claimNo}/summary-with-tracking?regenerate=false&attemptNumber=1")
      .get(athenaAdvisorBaseUrl + "/api/claim/#{claimNo}/summary-with-tracking?regenerate=false&attemptNumber=1")
      .headers(headers_advisor_popup_api)
      .check(regex("summarization_status\\\\?\":\\\\?\"(.*?)\\\\?\"").saveAs("summarization_status")),
    pause(1)
  )
),

Am I grouping incorrectly?

Thanks,
Timmer

See the explanation here about the group timings: Timings

In the Gatling OSS reports, you can only have one metric at a time: either “cumulated response time” (default) or group duration. You want the latter.