Using Gatling to populate a (REST) system with objects which must each be unique

In order to populate a system with test data (via a REST API), we would like to use Gatling. Each object must have a unique Primary ID.

So far, this has been very straight forward. I have written one script to populate the system and one to depopulate it.

`
object Object {

val create = repeat(4, “n”)
{
exec(http(“Create Object”)
.post("/our/api/objects")
.headers(headers_noCache)
.headers(headers_basicAuth)
.headers(headers_acceptJSON)
.headers(headers_contentTypeJSON)
.body(ELFileBody(“CreateObject_0001_request.txt”))
.check(status.is(201)))
}
}

val createObjects = scenario(“ModularSimulation”).exec(CreateObjects.create);

setUp(
createObjects.inject(atOnceUsers(1))
).protocols(httpProtocol)
`

n is used to parameterize the Primary ID in the body of the request.

Pretty straightforward, right?

What we’d like to do is have say 10, 100, or 1000 users all creating objects simultaneously. (But, of course, all objects must have unique Primary IDs). What is best practice for doing something like this? (Using feeders seems like it would be kinda clunky for this purpose…)

Thanks!

See feeder doc.

Thank you.

I presume the most effective solution is to write our own feeder which takes some sort of a loop as an input, so we can use this on a large scale.