Pace for whole scenario

Hello,

I’m playing with pace option and would like to know which option will be better. I would like to prepare simulation (open model) when from the very beginning I will start with rampUsersPerSec, and after some time keep constantUsersPerSec

It should shape a traffic like this (more or less):

During scenario I’m using WebSockets (two different) so each of them is using unique name.

When I create injection profile like this:

    this.setUp(someScenario.injectOpen(
      rampUsersPerSec(1).to(5).during(60),
      constantUsersPerSec(0.1).during(120)).protocols(protocolBuilder)
    );

With this approach it is working fine.

I also tried to add forever loop and pace at the very beginning of scenario (ofc with changes at .injectOpen method) and I found some issue. Issue is related to that, user is reusing name of WebSocket - perhaps it is easy to fix, adding some random ID to name but I wonder which approach is better to achieve traffic shape mentioned above

BR
Mateusz

What are the axis units in your chart?

It doesn’t matter, chart is showing only how I would like to inject users.
Let’s say during first 5 minutes I would like to use Ramp Up from 1 to 5 users per second. After That, I would like to keep arrival time at level of 5 users per second (Constant Users Per Sec).

Basically this injection:

    this.setUp(someScenario.injectOpen(
      rampUsersPerSec(1).to(5).during(Duration.ofMinutes(5)),
      constantUsersPerSec(5).during(Duration.ofMinutes(15))).protocols(protocolBuilder)
    );

is working fine. I’m just curious which method is better

pace is a pause whose duration is computed based on the last time a given virtual user passed here.

It cannot control the arrival rate of virtual users. That’s what the injection profile is about. Stick to your original approach.

Thanks!
I saw many examples where the scenario starts with .forever() loop, and then a .pace() was added. That’s why I asked if this is a proper way

pace in a loop is for having the same users loop at a given pace :slight_smile:
eg employees using all day long an intranet application.

You wanted new users, so the injection profile is better suited.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.