I am using karate- Gatling for load testing. I have a requirement from client like I need to rampUsers from 1 to 76 for the duration of 8 mins, then I should run the scripts with 76 vusers for the duration of 1 hour and then rampdown from 76 to 1 for the duration of 8 mins.
I tried with 2 vusers first. Listed below is my code:
class CustomerProfileSimulation extends Simulation {
val apis = karateProtocol( )
apis.nameResolver = (req, ctx) => req.getHeader("karate-name")
val RetrieveCustomerProfile = scenario("RetrieveCustomerProfile").forever(){ exec(karateFeature("classpath:features/CustomerProfileService/RetrieveCustomerProfile.feature@CO")).pause(duration = 2 seconds).exec(karateFeature("classpath:features/CustomerProfileService/RetrieveCustomerProfile.feature@SRI"))}
val SearchCustomerSummaryWithContact =
scenario("CO_SearchCustomerSummaryWithContact").forever(){ exec(karateFeature("classpath:features/CustomerProfileService/SearchCustomerSummaryWithContact.feature@CO")).pause(duration = 2 seconds).exec(karateFeature("classpath:features/CustomerProfileService/SearchCustomerSummaryWithContact.feature@SRI")))}
setUp(RetrieveCustomerProfile.inject(rampUsers(2) during(30
seconds)).protocols(apis),
SearchCustomerSummaryWithContact.inject(rampUsers(2) during(30 seconds)).protocols(apis))
.maxDuration(duration = 2 minutes) }
I am expecting a graph like this.
Looks like I am half way through the expected output but not sure how to rampdown. Any help is appreciated.
Thanks