Grouping on user injection level

Hi Community

I’m currently using Gatling version 3.0.3 and was wondering whether there’s any possibility to group (based) on the injection profiles.
Our project has the need to extend the performance simulations’ duration from 1 to 3 hours, each hour increasing the active amount of users by X amount.
Furthermore, the desire is to visually report this, based on the amount of active users for the respective hour of the test cycle.

Theoretically, we could schedule 3 individual jobs from within our CI pipeline, but this would not be the cleanest way to go and could cause some overlap between the individual test runs.
This seems overkill given the fact that the script itself can perfectly facilitate such a ramp-up scenario and this way we would produce the most relevant output (reporting/number wise, compared to having 3 separate runs and reports).

Current Setup:

TypeAUser.inject(rampConcurrentUsers(0) to (Threshhold1stHourTypeA) during (10 minutes),constantConcurrentUsers(Threshhold1stHourTypeA) during (50 minutes)),

TypeBUser.inject(rampConcurrentUsers(0) to (Threshhold1stHourTypeB) during (10 minutes),constantConcurrentUsers(Threshhold1stHourTypeB) during (50 minutes))

Desired Setup:

TypeAUser.inject(
rampConcurrentUsers(0) to (Threshhold1stHourTypeA) during (10 minutes),constantConcurrentUsers(Threshhold1stHourTypeA) during (50 minutes),

rampConcurrentUsers(Threshhold1stHourTypeA) to (Threshhold1stHourTypeA * 2) during (10 minutes),constantConcurrentUsers(Threshhold1stHourTypeA *2) during (50 minutes)

rampConcurrentUsers(Threshhold1stHourTypeA * 2) to (Threshhold1stHourTypeA * 3) during (10 minutes),constantConcurrentUsers(Threshhold1stHourTypeA *3) during (50 minutes)

),

TypeBUser.inject(
rampConcurrentUsers(0) to (Threshhold1stHourTypeB) during (10 minutes),constantConcurrentUsers(Threshhold1stHourTypeB) during (50 minutes),
rampConcurrentUsers(Threshhold1stHourTypeB) to (Threshhold1stHourTypeB * 2) during (10 minutes),constantConcurrentUsers(Threshhold1stHourTypeB *2) during (50 minutes)
rampConcurrentUsers(Threshhold1stHourTypeB * 2) to (Threshhold1stHourTypeB * 3) during (10 minutes),constantConcurrentUsers(Threshhold1stHourTypeB *3) during (50 minutes)
)

The only thing I’m currently lacking is a way to group the scenario globally on the number of active users (i.e. the sum of Threshhold1stHourTypeA & Threshhold1stHourTypeB for the 1st hour, sum of (Threshhold1stHourTypeA * 2) & (Threshhold1stHourTypeB * 2) and so on).

I’ve tried something in the individual scenarios as follows: group(concurrentUsers + " users."){ … code … , but this won’t help me out past the first hour as I can’t multiply the val concurrentUsers for the grouping.
Any other suggestions?

Thanks in advance!

Hi there,

On the top of my head, the best solution that comes to my mind is waiting for gatling 3.4 that will support sequential scenarios, and use FrontLine that can filter stats by scenarios.

Cheers,

Hi Stéphane

Thank you for the very quick reply.

Unfortunately, I do not see how sequential scenarios would solve my current issue, as the simulations won’t functionally differ per hour of the run, only the injection (amount).
What we could do with that setup is to copy every individual scenario multiple times, each with a separate group (indicating the number of users) around them: TypeAUser200, TypeAUser400, TypeBUser200, TypeBUser400, …). Then we could run those sequentially, invoking the scenario with the relevant grouping around it. But this seems rather an obsolete duplication of code for such a purpose.

Frontline might be worth looking into on the other hand.
Thanks once again and enjoy your weekend!

Kind regards
Jillian

Why copy?

val scnContent = exec(???)…

setUp(
scenario(“step1”).exec(scnContent).inject(injectionProfile1),
scenario(“step2”).exec(scnContent).inject(injectionProfile2WithSomeDelay)
)

or

setUp(
scenario(“step1”).exec(scnContent).inject(injectionProfile1)
.andThen(scenario(“step2”).exec(scnContent).inject(injectionProfile2ThatWouldStartOnceStep1Terminates)
)
)