• info@helpingtesters.com
  • helpingtesters

Timers in JMeter

September 10, 2017 JMeter Tutorial
Timers in JMeter, Constant Timers in Jmeter, timers in jmeter with examples

We have covered about creating a Test plan and adding Thread group, Controllers, and Samplers to it. When the test run is initiated then requests which are added through Samplers hit the servers without any delay. This is unrealistic behavior as in real time every user does take a pause between performing actions on the website. It may not be possible to note the exact delay that each user takes but we can assume a delay based on workflow and desired behavior. Many times a request is hit to the server after receiving the response from the first request. Timers are added in JMeter to add some delay to the requests. One needs to be very careful in adding value to Timers in Jmeter as underestimating and overestimating it will give false results. 

→Complete list of JMeter Tutorial Series

Adding Timers in JMeter

Timers can be added at the Global level or as part of the specific request.

  • Adding Global Timers in JMeter : Right click on Thread group > Add > Timers > Select any Timer
  • Adding Local Timers : Right click on Any Request/Sampler > Add > Timers > Select any Timer

Note: If the Timers in Jmeter is set as global then it will be applicable to all the requests in particular thread group. However, a timer added to “Request A” will add delay only to that request. In case, there is a global timer of 1000ms and there is a local timer added to “Request A” of 2000ms in a thread group then total time for Request A will be global + local time i.e. 1000 + 2000 = 3000 ms in this case. Now, Let’s look at different type of Timers in JMeter one by One :

 

⇒ Constant Timers in JMeter

It is delay added in milliseconds. If added to any particular request it will cause the delay of time added, for example, 300 ms in this case.

 

  • Name: This is any logical name given to the timer
  • Thread Delay (in milliseconds): It is the time that request will take before hitting the server.

 

⇒ Gaussian Random Timers in JMeter

This timer will add a delay between a specific range

  • Name: Any logical name
  • Deviation (in milliseconds): Gaussian distribution function variable
  • Constant delay offset (in milliseconds): Value of delay

The range of delay is calculated as using the formula :

  • Value in Constant Delay Offset –   Value in Deviation = 300 – 100 =  200 ms
  • Value in Constant Delay Offset +   Value in Deviation =  300 + 100 = 400 ms

Using above formula we get 2 values 200 and 400. Hence, 70% of delays will be between 200 to 400 ms. It won’t be possible to choose which requests should have more delay and which requests can have less delay. However, the range of time can be set using this timer.

 

⇒ Uniform Random Timers in JMeter

Uniform Random Timer is used to add Think time in each request for random time. Below is the image for Uniform Random Timer

  • Name: Any logical name
  • Random Delay Maximum (in ms): Maximum time for which JMeter should wait before sending the request. Here it is set as 100 ms
  • Constant Delay Offset (in ms) : This is the time to be added to Random Delay Maximum Time to set the upper limit.

for example, The time of requests will vary from “100” to “100+0” here.100 being “Random delay maximum” and 0 is “Constant Delay Maximum”.

Ankita has worked on different types of testing like Manual, Automation, Performance testing.  She likes to learn about new tools in market that help to make testing easier and interesting. Testing is her passion due to versatile areas it offers.

About the author

Ankita Dawar author

Ankita has worked on different types of testing like Manual, Automation, Performance testing.  She likes to learn about new tools in market that help to make testing easier and interesting. Testing is her passion due to versatile areas it offers.

Leave a Reply

Your email address will not be published.