Sequential and parallel execution with different number of users

67 views
Skip to first unread message

David Leonhartsberger

unread,
Apr 20, 2018, 3:54:15 AM4/20/18
to Gatling User Group
I have the following use case

For my load test I need to setup my system state, I do this with gatling because its quite handy.

First 1 users needs to setup the global system state, this takes approx 20 seconds
Now I want to setup different sub parts of the system in parallel, this should also be done by just 1 user, in the graphic below this are the "Setup Data A" and "Setup Data B" parts. Setup Data A takes ~3 min and Setup Data B takes ~15 min (a lot of requests)
After the Data setup for A or B is done, more users can start to load test, those users should of course only start after all the setup for the specific part was done.

How would I model such a setup with gatling?

    |
                    |
                  Setup 
          Global System State
                  1 User
                    |
                    |
                   / \
                  /   \
                 /     \
                /       \
               /         \
              /           \
             /             \
          Setup           Setup
         Data A           Data B
          1 user          1 user
           |                |
           |                |
       Load Test A      Load Test B
        30 users         50 users

What I currently have is this:

val authorizationSmall = scenario("Authorization Small")
.doIf(s => s.userId == 1) {
exec(Entities.setupEntityTypes) // should actually be done first before all other steps, but where to put this?
.exec(setupSmallCompartment)
}
.pause(5 seconds)
.rendezVous(TestData.Compartment_Small.subjects)
.exec(checkSmallCompartment)

val authorizationMedium = scenario("Authorization Medium")
.doIf(s => s.userId == 1) {
exec(setupMediumCompartment)
}
.pause(5 seconds)
.rendezVous(TestData.Compartment_Medium.subjects)
.exec(checkMediumCompartment)

val authorizationLarge = scenario("Authorization Large")
.doIf(s => s.userId == 1) {
exec(setupLargeCompartment)
}
.pause(5 seconds)
.rendezVous(TestData.Compartment_Large.subjects)
.exec(checkLargeCompartment)

setUp(
Entities.setupEntityTypes.inject(atOnceUsers(1)), // should actually be done first before the next 3 steps, but not in parallel, but where to put this?
authorizationSmall.inject(atOnceUsers(TestData.Compartment_Small.subjects)),
authorizationMedium.inject(atOnceUsers(TestData.Compartment_Medium.subjects)),
authorizationLarge.inject(atOnceUsers(TestData.Compartment_Large.subjects))
).protocols(httpConf)


Reply all
Reply to author
Forward
0 new messages