Search code examples
loopsjmeterjmxjmeter-pluginsthreadgroup

How do I loop an ultimate thread group in JMeter?


I have a scenario of a 3 hour test case (see comment in the picture) in JMeter and I need it to be repeated for 20 times, until it reaches 60 hours. It goes as the picture shows. So I used an ultimate thread group, I configured the values for the times and counts for the 3 hour scenario.

How do I repeat it for 20 hours? enter image description here

I tried to use a different thread groups or a loop controller but didn't find a solution.


Solution

    1. The easiest solution is just running your test 20 times in command-line non-GUI mode and appending the results into the same .jtl results file.

    2. Your workload model can be expressed via threads_schedule special property

      For example if you put the next line to user.properties file:

      threads_schedule=spawn(50,0s,0s,3600s,200s) spawn(450,3600s,1800s,0s,0s) spawn(450,5400s,0s,3600s,0s) spawn(450,9000s,0s,0s,1800s) spawn(50,9000s,1800s,0s,0s)
      

      and add an empty Ultimate Thread Group to your test plan you will see your workload model despite the fact you didn't provide any numbers in the Ultimate Thread Group

      So if you replicate the above threads_schedule property 20 times adjusting "Initial delay" accordingly you will be able to achieve your desired workload model pattern.

      More information on JMeter Properties and ways of setting and overriding them: Apache JMeter Properties Customization Guide