Aggregate response time check failure errors in the Gatling report.

In my test I have response time bucket for each request. Below are some of my requests which shows how I have coded this in Gatling.

val postAccount = http(“POST /Accounts”)
.post("/account")
.headers(headers)
.body(new StringBody("${cardAddBody}"))
.asJSON
.check(status.is(201))
.check(regex("""“account_id”:\s*"([^"]*)""").saveAs(“accountId”))
.check(responseTimeInMillis.lessThan(responseTimeBudgetForPostAccount))

val getAccounts = http(“GET /Accounts”)
.get("/account")
.headers(headers)
.check(status.is(200))
.check(responseTimeInMillis.lessThan(responseTimeBudgetForGetAccount))

val getAccountById = http(“GET /Account/AccountId”)
.get("/account/${AccountId}")
.headers(headers)
.check(status.is(200))
.check(responseTimeInMillis.lessThan(responseTimeBudgetForSingleAccount))

When I observe the Gatling report after I execute a test, I see ERRORS section of the report takes huge part of the report because it’s displaying an individual error message for each response time check failure like below.

responseTime.find.lessThan(800), but actually 3153 is not less than 800 1 3.125 %
responseTime.find.lessThan(250), but actually 1147 is not less than 250 1 3.125 %
responseTime.find.lessThan(800), but actually 1495 is not less than 800 1 3.125 %
responseTime.find.lessThan(1000), but actually 3207 is not less than 1000 1 3.125 %
responseTime.find.lessThan(1000), but actually 3224 is not less than 1000 1 3.125 %
responseTime.find.lessThan(250), but actually 1235 is not less than 250 1 3.125 %
responseTime.find.lessThan(250), but actually 3288 is not less than 250 1 3.125 %
responseTime.find.lessThan(800), but actually 3253 is not less than 800 1 3.125 %
responseTime.find.lessThan(1000), but actually 3342 is not less than 1000 1 3.125 %
responseTime.find.lessThan(800), but actually 3179 is not less than 800 1 3.125 %

I have had a look into assertions however it’s not giving me what I wanted… Is there a way that I can group app these errors into one error bucket in Gatling? I have had a look into implementing a custom error message when this check failed but seems like Gatling is not allowing me to to it.

Anyone had this experience before? Highly appreciate your help, ideas, thoughts, workarounds…

I use Gatling 2.2.0.

Many thanks,

-Pujitha.

Gatling behaves exactly the way it should in this case.

If you don’t really need to see the actual response time for each call, try extracting the checker code to a separate method, which would return a boolean value (whether the response time was OK).

Then the values would aggregate by a boolean value, shortening the report list to a maximum of 2 values per each unique check.