Injecting users after the previous user(s) leave

The first request in our application takes a lot of time, up to 80 seconds dependent on amount of data and it affects mean response time very much. I would like to be able to inject a single user, so that he runs through the scenario and warm-ups the application, and after he is done, ramp some amount of users who will do everything else.

I would expect this to solve the problem, although constantUsersPerSec takes only positive arguments.

setUp( scnBuilder.inject( atOnceUsers(1), constantUsersPerSec(0) during(2 seconds), rampUsers(nbUsers) over (15 seconds) ) ).protocols(httpProtocol)

This works except that I have to hardcode pause:

`
setUp(
scnBuilder.inject(
atOnceUsers(1),
nothingFor(5 seconds),
rampUsers(nbUsers) over (15 seconds)
)
).protocols(httpProtocol)

`

What is the best solution for this in your opinion?

Thanks.

The best solution I see is to manually perform the warm up in the before { } hook. You won’t be able to use Gatling DSL here, you’d have to rely on a client, like UrlConnection, or AsyncHttpClient (shipped with Gatling).