-1

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) }

This is my actual output: Actual output for 2 vusers

I am expecting a graph like this. Expected graph

Looks like I am half way through the expected output but not sure how to rampdown. Any help is appreciated.

Thanks

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
  • I don't know. it is likely karate does not support ALL the specific syntax of gatling. so I suggest do some research and contribute code. also if you want to help, please follow this process so that this "problem" can be replicated: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue - and then the community can figure out a solution. else try to make do with simpler scenarios. the linked question may help also in case you are not having enough capacity on the local machine. example of how to submit an issue: https://github.com/intuit/karate/issues/845 – Peter Thomas Apr 22 '21 at 05:25
  • 1
    Thanks for the reply Peter. I will do some research and contribute the code. – Sudha Sathya Apr 22 '21 at 06:55
  • have you tried with a pause for a good amount of time say `.pause(20)`? and then the way users ramped up, the same way they will go out from the system. – simpleApp Apr 22 '21 at 15:27
  • Can you please help me where to add .pause(20) in my code? – Sudha Sathya Apr 23 '21 at 06:24
  • @ Sudha Sathya sorry, i don't have karate setup so excuse for syntax error, pls try at ` CustomerProfileService/SearchCustomerSummaryWithContact.feature@SRI"))).pause(20)}` – simpleApp Apr 24 '21 at 02:39
  • Thanks for the response. I tried this already and still I didn't get the ramp down – Sudha Sathya Apr 28 '21 at 09:50

1 Answers1

3

have you tried something like rampUsersPerSec(10).to(0).during(10.minutes) basically this is just like reverse in numbers as Gatling don't have ramp down as such

deb
  • 145
  • 1
  • 2
  • 11
  • 1
    Need more detail than "not working" if you want additional help. You can also try posting in Gatling's google group, as that is the only place I know of they offer support. This is really a Gatling question, not a Karate question. https://groups.google.com/g/gatling?pli=1 – anutter Apr 22 '21 at 17:20
  • Hi Anutter. Thanks for your suggestion. Posted the same in google groups. – Sudha Sathya Apr 23 '21 at 06:26