Some of the most versatile components in JMeter are timers. Without JMeter timers, elements of a JMeter test plan are executed sequentially without pausing. This can potentially overwhelm your target test application by generating too many requests in a short period of time. In this brief post, we will cover most of the available types of timers that can be used in JMeter test plans.
You can find all available timer elements under the “Timers” submenu when adding new elements to your test plan as illustrated below:
One caveat to using timers is knowing how JMeter applies the delay. For a given group of requests within the same scope, JMeter will apply the sum total duration for all timers in that scope before requests are made. This is an important concept when multiple timers are used, especially if they are intended to be interspersed between multiple subsequent requests. Below you will find a categorized list of the most common timer elements included with JMeter.
- Constant Timer → the most basic timer type which adds a simple delay to your test with no other parameters.
- Uniform Random Timer → similar to the Constant Timer except this element will add a random delay to a constant baseline delay each time it is executed.
- Gaussian Random Timer → nearly identical to Uniform Random Timer, except uses a different algorithm for random delay value generation.
- Poisson Random Timer → similar to the Gaussian Random Timer, however uses a Poisson distribution as its delay value generation algorithm.
- Precise Throughput Timer → this timer will vary its delay interval to keep requests at or below a certain threshold.
- Constant Throughput Timer → similar to the previous timer however will vary threads within a Thread Group to match a certain threshold. We cover this concept in more detail in another post on our blog.
- JSR223 and BeanShell Timers → these timers are unique in that they allow you to write a logical script to generate delays. Return values (expressed in milliseconds) from the Script section will govern how long JMeter will pause each time this element is executed.
- Synchronizing Timer → compared to the others the behavior of this timer is a little unusual in that it will block a specified number of threads up to a specified threshold, releasing those threads all at once. We go into more detail about the Synchronizing Timer in separate post.
In addition to these built-in timers, there are a number of other more advanced timers that can be installed as third-party plugins to JMeter. For instance, one that is part of a very common plugin package is the Throughput Shaping Timer , which is also discussed in this post on our blog. This element allows for a visually-created request profile that the timer fills in over a specified duration of time. Other elements exist as installable plugins that are timers or feature a timer component.
Did you know that RedLine13 offers a full-featured free trial? Sign up now and start testing today!