Raveendra
Raveendra

Reputation: 31

How to do load test of multiple requests with a single user in gatling

I have seen in gatling, the scenarios and inject concept revolves around users.

But lets say my REST API is using client credentials workflow , and has an application account which is shared by users of a REST client application.

so the question is , how can i simulate multiple requests concurrently with single user (or) with no user concept, in gatling.

for ex: i should be able to start with 100 requests initially , rampup to 500 request over 10 minutes, ramp up to 1000 over next 10 minutes and so on. The main point i am saying here is , there is no user concept involved.

how can we achieve this in gatling.

Upvotes: 3

Views: 3402

Answers (1)

James Warr
James Warr

Reputation: 2604

In gatling, a user is just a single execution of a scenario from start to finish.

so your scenario doesn't necessarily have to handle a 'user' as in 'a user of your system'.

so you have a scenario that makes your rest call(s)

val scn: ScenarioBulider = scenrio("your scenario"
  .exec(http("rest call")
      .get("http://rest.com/endpoint")
      .check(status.is(200))
  )

then you create a simulation that models how many times that scenario gets executed over what timeframe eg:

setUp(
    scn.inject(atOnceUsers(10))
)

would perform 10 concurrent executions of the defined scenario.

read the introductory documentation for more

Upvotes: 3

Related Questions