Ramp users until failure

Hi,

I’m trying to write a load test that ramps concurrent users until one of the users encounters a failure. Upon failure, I want to halt the load test and capture the results. The max achieved throughput before the failure would be the achieved throughput for a given server version. How would I go about doing this? So far, my current approach has been around detecting failure within the session object and then switching a flag that would notify all the subsequent users of the failure who would then quit before following through with a simulation:

`
var halt: Boolean = false

def exitSessionOnFailure(session: Session) = {
if (session.status == KO) {
println(“Not ok”)
halt = true
session.markAsFailed.exit()
}
session
}

def skipIfHalted(session: Session) = {
if (halt) session.markAsFailed.exit()
session
}
`

And then using it like so:

`
scenario(“Get Status”)
.exec(session => skipIfHalted(session))
.exec(postUserRequest)
.exec(session => exitSessionOnFailure(session))
.exec(getUserRequestStatus)
.exec(session => exitSessionOnFailure(session))

`

Upon failure, I do see a drop in users but the drop doesn’t carry on as sharply as I expect it to (dotted black line is expected drop).

Any ideas? Is this approach wrong or too complicated? Is there something simpler available to build a baseline?

Thanks,
Manthan

We have some kind of panic criteria in mind for FrontLine.
But I don’t see an easy way to achieve what you want with Gatling OSS.