Hi all,
I have a use-case where I make a HTTP POST to a specific URL and after that a GET to another URL. The system is eventually consistent, which means that the second request will somewhen return the correct value. I want to measure the time when the consistent state was reached. Here is my current scenario:
`
val scn = scenario(“Create And Query”).repeat(1000) {
feed(feeder)
.exec {
group(“Create and Query Group”) {
exec {
http(“Create Item”)
.post(“http://example.org/items”)
.body(StringBody(someBodyVar)).asJSON
.check(status.is(204))
}
.tryMax(100, “tryQuery”) {
exec {
http(“Query Item”)
.get(“http://example.org/items”)
.queryParam(“search”,“eq(thingId,“someId”)”)
.check(status.is(200), jsonPath("$.items[0]").find.not(“someId”))
.silent
}.pause(10 milliseconds)
}
}
}
}
`
I used a “group” to measure the time for the whole roundtrip and “tryMax” to try it several times (polling mechanism) until I receive the correct value.
In the “tryMax” you can see the “.silent” at the end. If I omit it, every failing request is counted, even when the correct value is received somewhen. If I have “.silent” in place, I can not see the time it took to actually receive the correct value (how long my system needs to get to a consistent state). The documentation says, that the time of silent requests does count to the overall request time of a group, but that’s somehow not the case here (maybe because there is no other request after the silent one in the group.
I tried to implement a “silentOnFailure” config option that only prevents request with status == KO to be logged, but than somehow only the requests are counted that succeed on the first try (in the “tryMax”). If there is one failing request which succeeds on the second try, this request is not counted in the overall stats.
Is there another way to solve my problem? Should I do a pull request or just a fork to show you how I implemented my silentOnFailure or is the mentioned behavior a bug in Gatling?
Kind regards
Niko Will