Timers in JMeter pause threads for simulated think times between interactions to mimic real user behavior. The document describes several timer types:
- Constant Timer pauses each thread for the same think time using a random function.
- Uniform Random Timer and Gaussian Random Timer delay threads with random think times distributed in a pseudo-random or Gaussian manner.
- BeanShell, Poisson Random, and JSR223 Timers allow custom scripted think time distributions and algorithms.
- Synchronizing Timer coordinates threads to reach specific points concurrently.
2. Points on Timers in J Meter
• Purpose of “Timer” Test Element in J meter is to Pause Thread(Virtual
Users) for a particular time period.
• Objective of timers is simulation of virtual users think time.
• Think time is real user behavior that is where people wait between
interactions with a web application.
• In Real Life users do not hammer web application constantly. Real Users
need some time think for their action .
• The whole idea of timers is to provide load test simulating real user’s
behavior as close as possible.
3. Constant Timers
• Constant timer is used to pause each thread for the same “think
time” between requests.
• One of the most commonly used timer.
• J meter sends request can be applied using Random function.
• ${__Random(2000,4000)}
4.
5.
6. Uniform Random Timer
• URT Delays each request for a random amount of time.
• Distribution of time can be pseudo random manner in range between
0.0 (inclusive) and 2.0 (exclusive)
• Multiplying it by “Random Delay Maximum” + “Constant Delay
Offset”
• Therefore, default configuration is 200 Random Delay Maximum & 0
Constant Delay Offset.
• This means pause of samplers can be by a random number of
milliseconds in range from 0 to 199 as per the formula
(0.x * 100 + 0)Here, x can be any digit between 0 to 9 inclusively.
7.
8.
9. Gaussian Random Timer
• GRT also delays thread(user) request for a Random Period of Time.
• Gaussian curve distribution it is the main concept for random deviation
around the Constant Delay Offset. Deviation Value is in milliseconds.
• For Example: Suppose Deviation Value: 200 milliseconds (Parameter of
Gaussian Distribution Function)
• Constant Delay Offset Value: 400 milliseconds (Additional value in ms)
• Constant Delay Offset – Deviation = 200 ms
• Constant Delay Offset + Deviation = 600 ms
Delays will be in between (200-600)milliseconds
10.
11.
12. Bean Shell Timer
• Bean Shell Timer delays on edge condition & is a scripting based timer.
• BST is applied to scripting language.
• Bernoulli distribution or Rademacher distribution
• Functionality like Pending status in the application retries for delay can
be for some more time . In this case sampler needs to wait for particular
time period .
• We need to implement a distribution which is not covered by existing
timers, i.e. Bernoulli distribution or Rademacher distribution which are
not covered by the existing timers.
13.
14.
15. Poisson Random Timer
• Poisson Random Timer is used to generate the random delay.
• PRT is based on the Poisson Distribution Function.
• Timer in Poisson’s Random Timer works on delay (think) time as the
sum of the Poisson distributed value and the offset value.
• PRT has following attributes
• Name: Name of the timer
• Lambda (in ms): Number that shows deviation in delay from the given
offset ranges from higher and lower.
• Constant Delay Offset (in ms): Number that shows a constant delay by
adding to the random number generated by Poisson Function in the
range of given deviation value.
• Comments: Required comments can be provided.
16.
17.
18. JSR223 Timer
• JSR223 Timer is a scripting-based timer.
• JSR is an acronym for Java Specification Requests similar to BeanShell
timer where thread logic is implemented by itself
• Scripting Languages supported it are like Groovy, BeanShell, java,
JavaScript, jexl etc.
• It is mainly used to define think times based on some unique
algorithm Own Algorithm can be created your own implementation of
the algorithm using the JSR223 timer.
19. Synchronizing Timer
• Synchronizing Timer wait for users to reach on specific point so that all
users(threads) can send next request concurrently.
• Suppose x no. of threads are not passing then before x threads does not
pass it will be other threads it can be no. of y
• Let’s take example e commerce application
if X = Login Page then Y = Products page.
Synchronizing Timer Parameters
• No. of Simulated users to Group by –> No. of Threads released at once
• Timeout in Milliseconds -> Max time to reach given no. of threads.