0
votes

I am trying to create a test plan that will run multiple iterations of stress test. The idea I'm trying to implement is to run 1 minute of HTTP requests to the server and maintain a constant throughput. Then increase the desired throughput and run the test again for 1 minute. I would like to increase the throughput by 100 Requests per Second on each iteration until I see that the actual throughput is much lower than the desired one.

I have successfully created a test plan that runs a constant throughput for a minute: I have a thread group with X threads, and I set the scheduler to duration of 60 seconds. In that thread group I have an HTTP Request Sampler and a Constant Throughput Timer which I set to a desired value.

However I would like to run that in a loop and increase the desired value in the Constant Throughput Timer on each iteration.

Also I would like to stop the loop (Or skip consecutive iteration ) when I see that the actual throughput as observed in Aggregate Report is much lower than the throughput I set in the Constant Throughput Timer for that iteration.

So basically when I reach the point that my server cannot keep up, I don't want to keep stressing it more.

How could I achieve the above described functionalities?

Thanks

1

1 Answers

0
votes
  • To increase the throughput by 100 each iteration

    • define it as a property in the Constant Throughput Timer using __P() function like ${__P(throughput)}
    • define throughput property initial value in user.properties file or via -J command-line argument (you can even do it outside JMeter using Beanshell server feature)
    • add Test Action sampler to the end of your Thread Group (it doesn't generate any sample result so it won't appear in the logs)
    • add JSR223 PreProcessor as a child of the Test Action sampler and put the following code into "Script" area:

      def throughput = Integer.parseInt(props.get('throughput'))
      throughput += 6000
      props.put('throughput', String.valueOf(throughput))
      

    This way each iteration throughput will be increased by 6000 requests per minute (100 requests per second)

  • You can use AutoStop Listener in order to stop overwhelming your server basing on various criteria.