Hi all,
I’ve been trying for a while how to write in Gatling 2.0 API a chain that continuously poll a resource until the JSON response contain a specific value. The only example that came up, in this group, seems to be from Gatling 1.0 which uses loop.
It seems to me, I need to use group() because I want to measure the whole poll period instead of the individual calls, and asLongAs() but I can’t seem how to construct that.
This is how I’m trying to build it. My apologies if the code is not idiomatic, I’m still not that experienced with Scala, and Gatling.
`
asLongAs(/* Repeat if volumeStatus != available */) {
group(“Volume Creation”) {
exec(http(“volume_status”)
.get("${volumeURL}/volumes/${volumeId}")
.header(“X-Auth-Token”, “${authToken}”)
.check(jsonPath("$.volume.status").is(“available”).saveAs(“volumeStatus”))
.pause(5)
}
}
`
Thanks in advance