I’m playing with Gatling api for a several days. Several questions so far:
How can I execute exactly 1k requests? I just want my POST request to be executed 1k times. How my simulation setUp should look like?
I want to execute as many requests as possible for certain POST request for some period of time. How can I achieve that? The problem is not about time (maxDuration or throttling can help here), the problem is “as fast as possible” behavior.
use repeat in scenario
e.g. val scenario_name =scenario(“sc01”).
repeat(1000){ exec(event.event)}
2 use above script with multiple users in scenario setup.
e.g.
. setUp(
scenario_name.inject(rampUsers(userscount#) during (1))
).protocols(httpProtocol).disablePauses
calculate users using the little law.
Above two will help you to get the desired results
I think you can use atOnceUsers, something like this (and in yourPostSimulation define only one POST without any repeats or loops)
class yourPostSimulation extends Simulation {
setUp(
yourSimulationScn.inject(
atOnceUsers(1000) // each user does one POST and then stops
)
).protocols(httpConf)
}
To simulate as many requests as possible I would use rampUsers