How to achieve different exec TPS?

The scenario has multiple exec modules, how to achieve different exec TPS?

The reason is only a small percentage of users will finally check out.

val scn = scenario(“Test”)
.exec(login_part_code) // test for 10 TPS
.exec(check_out_code) // test for only 2 TPS

setUp(scn.inject(

constantUsersPerSec(10) during(600 seconds)

).protocols(httpConf))

The above code will cause check_out_code run as 10 TPS which is much higher than business requirement.

Thanks for your help.

Hi,

You can use randomSwitch (http://gatling.io/docs/2.1.7/general/scenario.html#randomswitch) to have only 20% of your user population to get the checkout phase.

Cheers,

Pierre

Cool. I will try that.

Thanks.

I tried randomSwitch and it works for the above situation. Now a follow up question is can it chain to next level?

val scn = scenario(“Test”)
.exec(login_part_code) // test for 10 TPS – step 1
.exec(randomSwitch(20.0 → check_out_code) // test for only 2 TPS
.exec(Save_Financial_Info_code) // is there a way to let only above check_out user pass to this step? and test for 1TPS? Normal flow is all users from step 1 will get to this step.

setUp(scn.inject(

constantUsersPerSec(10) during(600 seconds)

).protocols(httpConf))