Building load test for unique users for open workload model

Hi team! I need to build a load test for the open workload model. I must follow the following requirements:

  • each user must go through scenario 1 time only
  • load must have users rump (5 minutes) and then constant users for the duration (30 minutes)
    Gatling version is 3.3.1

Can you help me with it? I found a solution to build this load, but in this case, the same users are running in a loop. I need unique users.

val duration = 30
val rump = 5
val users = 10
val httpProtocol = http.baseUrl(apiUrl).headers(headers)

val scn = scenario(“load test”)
.during(duration minutes) {
// test scenario

setUp(scn.inject(rampUsers(users) during (rump minutes)
).protocols(httpProtocol)).maxDuration(duration minutes)

Could you please explain what you want in terms of user arrival rate?

Sure, Stephane!
I expected the following load, but the number of users is going to be different
For example, I expect that the first 5 users from CSV file go through a scenario, then the other 5 go through it.

I have already built this scenario for the workload model. The same I need for open if it is possible. Let’s I share with you my workload scenario for a better understanding of what I need
val scn = scenario(“load”)

val setUp = scn.inject(
rampConcurrentUsers(concurrentInitialUsers) to(concurrentUsers) during (rumpUpTime minutes),
constantConcurrentUsers(concurrentUsers) during(durationTime minutes)

setUp(setUp).maxDuration(testDuration minutes)

Hi Stephane! Can you help me with this?

Sorry, I don’t get it and it seems you’re trying to attach an image but it’s broken.

No problem, Stephane!

I expect the following load:

The requirements are:

  • 1 unique user goes to a scenario once! Instead of using 200 users and run them in a loop (.during()) I have a huge number of users. The must replace each other during a scenario.
  • open workload model
  • rump up
    I need smth like
     rampUsers(200) over (5 minutes),
     atOnceUsers(200) during (25 minutes)

Please let me know if it can be emulated for open model.
Thaks in a advance!

With an open model, what you control is the arrival rate. The number of concurrent users at a given point in time depends on the injection profile and the journey duration.

If your users were to loop for 30 minutes, you would have what you want with “rampUsers(200) over (5 minutes)”.

Yes, I did so. But in this case, the same 200 users are running in a loop. I need to use unique users for each iteration. Is it possible?

Then, sorry, but it doesn’t make sense.
Open workload is about controlling the arrival rate and number of concurrent users are just a consequence you have no control over.
Closed workload is the exact opposite.

You can’t have both.

I think what you are trying to achieve is 1 unique user per iteration.
If so, feed the user data in the scenario level and use the sequential feeder. You should have enough unique user data in your feeder.

Hello Stéphane,

I guess what Dasha is asking if it’s possible to implement in open model arriving of concurrent unique users every test scenario iteration. I guess this is pretty common real use case when we aren’t requesting, for instance,
a test scenario for the same user again and again.

I’ll provide an example:
We seeded 1000 unique users with the unique test data into DB.
Load test scenario includes: login a user, api call A, api call B for 200 concurrent users for 30 minutes. (lets exclude a ramp up period from the example )

What should be implemented:

  1. First test scenario iteration: user1 to user200 from seeded users pool are going through test scenario: login, A, B calls.
  2. Second test scenario iteration: user200-user400 from seeded users pool iterate through test scenario
  3. N test scenario iteration: users1000 - user200(circular) from seeded users pool iterate through test scenario.

and thats for 30 mins.

So the question if the case above is something supported in the Open workload model.

Thank you!

Hi! Pujitha! I have the following code. Do you mean smth like that?

val csvFeeder = csv("users.csv").circular

val spendingScn = scenario("load test")
  .exec(some code)