Description of Injection types

Hello,

I prepared scenarios for all my user journeys and now I want to focus on injections. I know that, all options are describer at official documentations but my “trials” does not cover my understanding of particular injection type.

Could you please describe it a little bit detailed?

setUp(
  scn.injectOpen(
    constantUsersPerSec(10).during(20), // 1
    rampUsersPerSec(10).to(20).during(10), // 2
  ).protocols(httpProtocol)
);
  1. In this case 1 user will be injected after every 2 seconds or after every 1 second 10 users will be injected up to 20 seconds - 200 users will be injected?
  2. In this case 10 users will be injected at the very beginning, and after every 1 second new user will be injected up to 20 users described as .to() call
setUp(
  scn.injectClosed(
    constantConcurrentUsers(10).during(20), // 1
    rampConcurrentUsers(10).to(20).during(10) // 2
  )
);
  1. In this case 1 user will be injected after every 2 seconds to inject 10 users as a total during provided time == 20 seconds?
  2. Similar to rampUsersPerSec() how exactly users will be distributed?

BR
Mateusz

  1. In this case 1 user will be injected after every 2 seconds or after every 1 second 10 users will be injected up to 20 seconds - 200 users will be injected?

During 20 seconds, it will inject ̀10 users per second.

  1. In this case 10 users will be injected at the very beginning, and after every 1 second new user will be injected up to 20 users described as .to() call

It will inject a ramp of users per second.
You stated that the ramp should begin at 10 and finish at 20. The ramp has a duration of 10 (seconds).

So, at time 0, it will inject 10 users per second, at time 10, it will inject 20 users per seconds.
It will progressively increase the amount of injected users per second during the ramp duration.

  1. In this case 1 user will be injected after every 2 seconds to inject 10 users as a total during provided time == 20 seconds?

In close model, the injected users will depend if the users in the system had finished their scenario.
In close model, you define the amount of users in the system (when one finish, another replace them).

  1. Similar to rampUsersPerSec() how exactly users will be distributed?

At the ramp here describe the amount of user concurrently in the system, the injection add more user that the amount being terminated.

Usually, the system under test is in open model. Only a few systems really manage a queue.

Perhaps our article about How easily can I perform a load test might help you.

1 Like

I would like to clarify one more thing related to injection profiles and injection model (open/closed).

My system under test is an open system. What I want to achieve is a Load test for 40 users which will take for example 1h.
I want to start by adding them 1 user per second and when I reach 40 users I want to keep them for 1h.

From injection’s profiles point of view, the best candidate is constantConcurrentUsers from closed model, but it will be good approach?

I checked link to blog which you provide but still Im confused about that. Could you describe why it is not proper solution to use injection from closed model for open system to cover load tests?

Thank you in advance

I want to start by adding them 1 user per second and when I reach 40 users I want to keep them for 1h.

You got it wrong.

If your system under test is open, you shouldn’t reason in terms of concurrent users which is for closed model. In your actual system, you absolutely have zero control over the number of concurrent users, so it shouldn’t be an input.

You should reason in terms of users arrival rate.

Your mental model/specs are not aligned with the architecture of your system.

Thank you very much for explanation