Course
JMeter Tutorial for Beginners: Learn in 7 Days
JMeter Training Summary Apache Jmeter is a popular open-source performance testing tool. This...
By default, JMeter sends the request without pausing between each request. In that case, JMeter could overwhelm your test server by making too many requests in a short amount of times.
Let imagine that you send thousands request to a web server under test in a few seconds. This is what happens!
Timers allow JMeter to delay between each request which a thread makes. A timer can solve the server overload problem.
Also, in real life visitors do not arrive at a website all at the same time, but at different time intervals. So Timer will help mimic the real-time behavior.
In this tutorial, you will learn
Following are some common types of a timer in JMeter
Constant timer delays each user request for the same amount of time.
Gaussian random timer delays each user request for a random amount of time.
| Attribute | Description |
|---|---|
| Name | Descriptive name for this timer that is shown in the tree |
| Deviations (milliseconds) | A parameter of Gaussian Distribution Function |
| Constant Delay Offset (milliseconds) | Additional value in milliseconds |
So the total delay is described as below figure:
Uniform random timer delays each user request for a random amount of time.
Attribute | Description |
|---|---|
Name | Descriptive name for this timer that is shown in the tree |
Random Delay Maximum | Maximum random number of milliseconds to delay. |
Constant Delay Offset (milliseconds) | Additional value in milliseconds |
The total delay is the sum of the random value and the offset value.
The BeanShell Timer can be used to generate a delay time between each user request.
The BSF Timer can be used to generate a delay between each user request using a BSF scripting language.
The JSR223 Timer can be used to generate a delay between each user request using a JSR223 scripting language
In this example, you will use Constant Timer to set a fixed delay between user requests to google.com.
Let start with a simple test script
Here is the roadmap for this practical example:
We re-use the Step 1 and Step 2 in tutorial JMeter Performance Testing.
Right click on the Test Plan and add a new thread group: Add-> Threads (Users) ->Thread Group
In Thread Group control panel, enter Thread Properties as following
This setting lets JMeter create one user request to http://www.google.com in 100 times
Right-click Thread Group -> Timer -> Constant Timer
Configuring Thread Delay of 5000 milliseconds
View Results in Table displays the test result in table format.
Right click Add -> Listener -> View Result in Table
View Results in Table displays as below figure
When you ready to run a test, click the Run button on the menu bar, or short key Ctrl+R
This is the result of this test
For example, in the above figure, let analyze the Sample 2
So the Sample 3 should start at the time is 22:05:07.039 ( As shown in the above figure)
The delay of each sample is 5000 ms
If you change the Constant Timer is zero, you will see the result is changed
Let analyze the Sample 1
So the Sample 2 should start at the time is 22:17:39.512 (Shown in the above figure)
If you face the issue while running the above scenario ... do the following
JMeter Training Summary Apache Jmeter is a popular open-source performance testing tool. This...
{loadposition top-ads-automation-testing-tools} JMeter is an open source load and performance...
Guidelines to overcome limitations of JMeter in a distributed environment: Limit the Number of...
What is JMeter? Why it is used? The Apache JMeter TM is pure Java open source software, which was...
$20.20 $9.99 for today 4.6 (115 ratings) Key Highlights of JMeter PDF 128+ pages eBook Designed for...
What is the Logic Controller? Logic Controllers let you define the order of processing request in...