By default, JMeter sends request without stopping anywhere between each request.
Generally, user spends lots of time while browsing i.e. before submitting confidential form or reading important document. So, it is a good practice to involve some delay between requests. Here, at very short period of times, JMeter can overwhelm your test server by creating various requests. For example: To test web server, send thousands requests in few seconds and face overload issue.
Using Timers,JMeter delays each request while sending which is made by thread. Because of this reason, Timer resolves the server overload issue.
When you add more than one timer to a Thread Group, JMeter keeps the amount of the timers and pauses for that amount of time before executing the samplers to which the timers apply. Timers can be added as children of samplers or controllers in order to limit the samplers to which they are participated.
Types of Timers
- Constant Timer
- Constant Throughput Timer
- Uniform Random Timer
- Gaussian Random Timer
- BeanShell Timer
- Poisson Random Timer
- BSF Timer
- JSR223 Timer
- Synchronizing Timer
To delay every user request for the same amount of time use Constant Timer.
Constant Throughput Timer:
Constant Throughput Timer presents random delays between requests in a manner that a load/stress of necessary throughput is sent to the application. Figure shows, Constant Throughput Timer for 60 requests per minute.
Uniform Random Timer:
To delay every user request for random amount of time use Uniform Random Timer with every time interval having the same possibility of occurring.
In the above figure,
Random Delay Maximum Value: Maximum random number of milliseconds to delay
Constant Delay Offset Value: Additional value
Gaussian Random Timer:
To delay every user request for random amount of time use Gaussian Random Timer with most of the time intervals happening near a specific value.
Gaussian Random means with most of the time intervals arising near a specific value i.e. constant interval & varying between constant interval + deviation.
In the above figure,
Deviations (milliseconds): A parameter of Gaussian Distribution Function
Constant Delay Offset (milliseconds): Additional value
Between each user request, the BeanShell Timer can be used to create a delay time. (We will see each timer in detailed in upcoming articles with example.)
Poisson Random Timer:
To pause each and every thread request for random amount of time use Poisson Random Timer with most of the time intervals occurring close a specific value.
Sum of Poission Distributed Value and Offset Value generateTotal Delay value.
Between each user request, the BSF Timer can be used to create a delay time using BSF scripting language.
Between each user request, the JSR223 Timer can be used tocreate a delay time using a JSR223 scripting language.
Synchronizing Timer is used to synchronize requests of various threads, means; it will increase delays between requests. So that, all threads fire at the same time there for regenerating heavy load bursts on your application. It is same like Rendezvous Point in LoadRunner and create big load at various places in JMeter plan.
Today we have introduction to different Timers in JMeter. In upcoming articles we will see functionality of each and every Timer in detailed with example. In next JMeter tutorial series We will cover the “Assertions in JMeter”.