Certain amount of requests execution

Hi All,

I’m playing with Gatling api for a several days. Several questions so far:

  1. 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?
  2. 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.

Thx in advance,
Bogdan

  1. 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

Hi Bogdan,

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

Thx a lot. Works as desired

середа, 6 березня 2019 р. 07:23:20 UTC+1 користувач G Madhana Mohana Reddy написав: