![](https://i0.wp.com/automationsolutions.org/wp-content/uploads/2013/03/10.jpg?fit=300%2C188)
Jmeter is an excellent tool for performance testing, especially given the price. It does however have a small number of limitations. One of those is the lack of a decent analysis, results and reporting engine – which I guess is why a lot of companies use Blazemeter as their testing component.
Another limitation in my eyes is the lack of a flexible iteration pacing controller.
If we build a load model allowing 45 seconds for an iteration, but that iteration takes 15 seconds, there’s is no built-in method to tell jMeter to wait 30 seconds on this thread. This is compounded by additional threads since they either all have to wait an arbitrary length of think-time which minimises the concurrent activity, or they don’t wait and the system is under higher loads than specified for the test.
There is a solution presented here using Groovy.
![](https://i0.wp.com/automationsolutions.org/wp-content/uploads/2021/10/image-1.png?resize=443%2C49)
In a Pre-processor on the first action of an iteration – which is not necessarily the first action, but rather the first action we loop upon – put a snippet to capture the time of iterationStart.
![](https://i0.wp.com/automationsolutions.org/wp-content/uploads/2021/10/image-2.png?resize=444%2C45)
In a post-processor capture the time of iterationEnd.
In a transaction controller, outside the loop but inside the thread group. Add a flow control action to pause for “${myDelay}”
![](https://i0.wp.com/automationsolutions.org/wp-content/uploads/2021/10/image-4.png?resize=977%2C284)
Attached to the flow control action, a pre-processor will calculate the value of the myDelay variable with the code shown here:
![](https://i0.wp.com/automationsolutions.org/wp-content/uploads/2021/10/image.png?resize=1015%2C632)
“iterationPacing” in this example is coming from a user defined variable at the moment, but will eventually be coming from a Yml file using a taurus implementation.
The final structure could be something like this:
![](https://i0.wp.com/automationsolutions.org/wp-content/uploads/2021/10/image-3.png?resize=336%2C254)