0
votes

I have the following scenario to be load tested for a service and it does not seem to work as expected. My scenario is as follows.

  • Test with rampUsers(100) over 15 minutes duration
  • Hold the users for about 10 minutes holdFor(10 minutes)
  • Then again rampUsers(200) over 15 minutes duration
  • Hold the users for about 10 minutes holdFor(10 minutes)
  • Then again rampUsers(200) over 15 minutes duration

I am trying to use throttle option for this but it does not seem to work as expected here is my code snippets combinations that I have tried so far

//NUM_USERS = 300
//DURATION = 15 minutes
//CONSTANT_DURATION = 5 minutes
// Tried with different combinations of NUM_USERS and DURATION but not helpful

scn.inject(
      rampUsers(NUM_USERS*1) during DURATION,
      constantUsersPerSec(1) during CONSTANT_DURATION,
      rampUsers(NUM_USERS*2) during DURATION,
      constantUsersPerSec(2) during CONSTANT_DURATION,
      rampUsers(NUM_USERS*3) during DURATION,
      constantUsersPerSec(3) during CONSTANT_DURATION
)

scn.inject(
          rampUsers(NUM_USERS) during DURATION
        ).throttle(
          reachRps(NUM_USERS/4) in (CONSTANT_DURATION),
          holdFor(CONSTANT_DURATION),
          jumpToRps(NUM_USERS/3),
          holdFor(CONSTANT_DURATION),
          jumpToRps(NUM_USERS/2),
          holdFor(CONSTANT_DURATION)
)

scn.inject(
      rampUsers(NUM_USERS) during DURATION
    ).throttle(
        holdFor(CONSTANT_DURATION),
        reachRps(NUM_USERS+NUM_USERS) in (DURATION+DURATION),
        holdFor(CONSTANT_DURATION)
)

Can any one help on this which one works in this case. I would like to have a graph like this enter image description here

1
your graph is in requests per second, but your initial description seems to be in relation to users - what are you after?James Warr
The graph is just for easy understanding.. no relationship with the use case.. you can ignore the labelsVinod Krishnan
so you want to target concurrent users? Your script doesn't reflect thatJames Warr
I want to hold the user not the concurrent user scenario.. Want to reach to some level of users and maintain that level for some time..Vinod Krishnan

1 Answers

0
votes

To target injection rate as you stated you want in the comments, you need something like this

scn.inject(
  rampUsersPerSec(0) to (300) during DURATION,
  constantUsersPerSec(300) during CONSTANT_DURATION,
  rampUsersPerSec(300) to (600) during DURATION,
  constantUsersPerSec(600) during CONSTANT_DURATION,
  ...
)