Creating a checkpoint

I started using Gatling as an alternative to HP LoadRunner, since I found LoadRunner (via HP’s cloud platform) to be extremely tedious to use for ad-hoc testing (not to mention the fact that I needed to write tests in C). But one feature that LoadRunner has which I found absolutely necessary for my testing is the ability to create a checkpoint; i.e., a state of execution that all users must reach before proceeding.

For my tests, I want to quantify the number of simultaneous users which can hit a particular web service endpoint before it begins to fail, and I want also to measure the response times for different numbers of users. But many of the endpoints being tested have prerequisite web service requests (login, REST PUTs, etc.) that need to be made, and many of these are non-trivial. So I don’t want to make the prerequisite requests at the same time I’d like to ramp up the prerequisite requests first, and after all prerequisites have been met (“checkpointed”), make all all of the requests for each user at the same time.

I’m very new to Scala, but I managed to hack together a solution I thought I’d share (attached), so that I can do something like this in Gatling:

val myScenario = scenario(“MyScenario”)
.feed(…)
// ramp up slowly…
.exec(some_prerequiite)
.exec(some_other_prerequisite)
// the “checkpoint”:
.exec(CheckpointBuilder(numUsers))
// once checkpoint is reached, execute for all users at once:
.exec(endpoint_under_test)
.users(numUsers)
.ramp(rampTimePerUser * numUsers)
.protocolConfig(httpConf)
setUp(myScenario)

I haven’t learned concurrency in Scala yet, so I’ll admit using pauses is pretty sub-par, but it scales to a couple hundred users pretty easily and executes all of the “simultaneous” requests within a few milliseconds of each other, which is good enough for my purposes.

Are there any plans to add functionality like this to Gatling 2 or beyond? I’m sure I’m not the only one who would find it extremely valuable.

CheckpointBuilder.scala (2.48 KB)

Hi Matt,

Thanks for sharing.

You’re actually the first one to ask for this feature.
If there’s more people asking for it, we might consider it for Gatling 2. Until then, we’ll just redirect to your post.

Cheers,

Stéphane