DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modern Digital Website Security: Prepare to face any form of malicious web activity and enable your sites to optimally serve your customers.

Containers Trend Report: Explore the current state of containers, containerization strategies, and modernizing architecture.

Low-Code Development: Learn the concepts of low code, features + use cases for professional devs, and the low-code implementation process.

E-Commerce Development Essentials: Considering starting or working on an e-commerce business? Learn how to create a backend that scales.

Related

  • Navigating Challenges in Online Banking API Testing
  • How To Organize End-To-End Quality Assurance and Testing for E-Commerce Apps
  • The Art of Being Ready: Reliability in Extreme Conditions
  • How to Avoid Defect Leakages in Software Testing

Trending

  • How To Use KubeDB and Postgres Sidecar for Database Integrations in Kubernetes
  • CodeCraft: Agile Strategies for Crafting Exemplary Software
  • Evolution of Software Architecture: From Monoliths to Microservices and Beyond
  • Testing Swing Application
  1. DZone
  2. Software Design and Architecture
  3. Performance
  4. Advanced Load Testing Scenarios With JMeter (Part 3): Top 4 Timers

Advanced Load Testing Scenarios With JMeter (Part 3): Top 4 Timers

In part three of this series, see which four timers work well with JMeter for better control during your load testing.

Noga Cohen user avatar by
Noga Cohen
·
Aug. 27, 16 · Tutorial
Like (3)
Save
Tweet
Share
8.8K Views

Join the DZone community and get the full member experience.

Join For Free

Welcome to part three of the “Advanced Load Testing with JMeter” series. If you missed part two, which explained Data-Driven Testing and Assertions, check it out here.

In this part, we will go over the top four recommended Timers, as they are the most useful for common testing needs . Timers enable us to incorporate the natural delays users make into our tests.

JMeter offers many different timers. In this blog post we will go over the four types we recommend. For a more comprehensive list and explanations, see here.

To see the full JMeter Timer List, click on the Thread Group -> Add -> Timer.

timers list on jmeter

1. The Uniform Random Timer

We highly recommend using the Uniform Random Timer. This is also the timer the BlazeMeter chrome extension recorder adds. Its main advantage is that it can simulate different delay lengths. This helps simulate realistic user behaviour on the web page.

uniform random timer on jmeter

The Uniform Random Timer enables you to insert two parameters:

1. A constant delay that will always occur.

2. A random delay that occurs randomly.

Together the two parameters create a range of optional pauses that JMeter will incorporate into the test. In this example, the threads will pause anywhere between ~9 seconds to ~14 seconds before the request it’s placed under is sent.

While each sampler has its own Uniform Random Timer, you can turn them all off:

uniform random timer, thread group, jmeter

After turning them off, you can move the one you want above the thread group. Its parameters will now run for each sampler. A timer will be executed before all the requests in the scope it’s in.

uniform random timer, thread group, jmeter

2. The Constant Timer

The Constant Timer also simulates delays between requests, but it’s used for adding a permanent delay as opposed to a randomized delay.

In this example, the constant delay added is 300 milliseconds long.

constant timer on jmeter

This timer will apply to every single request. If requests include additional timers, the delays will add up.

3. The Constant Throughput Timer

The Constant Throughput Timer doesn’t measure user delays but rather limits the requests per second by adding delays between the requests. This timer enables you to see what the server does and how it functions under a specific request-per-second rate, which is another important way to discover bottlenecks.

constant throughput timer on jmeter

(Note that we have to adapt from requests per second to requests per minute).

This timer can also be modified on the fly, so if you monitor your test in real time and you notice that the server is handling X requests per second, then you can increase it to X+100 and see how it endures under the new hit rate. For detailed explanations on modifying the Constant Throughput timer on the fly, please refer to this article.

This timer can be applied for various threads configuration:

constant throughput timer threads configuration on jmeter

To view Throughput more accurately we need to add the Aggregate Listener.

aggregate listener on jmeter

aggregate report on jmeter

Now run the test. It might take some time to get to its target.

4. The Synchronizing Timer

The Synchronizing Timer stops all threads when hitting the tested Number of Virtual Users, and then has them all perform the same action at once. This Timer is useful for extra stress testing. In this example, we will test 20 users simultaneously purchasing a flight ticket.

synchronizing timer on jmeter

Add the ‘View Results in Table’ Listener. See how all the flight purchasing is occurring at approximately the same millisecond:

view results in table listener, jmeter

Congratulations! You are now ready to use Timers. Stay tuned for next time, for our final blog post in this series.

Load testing

Published at DZone with permission of Noga Cohen, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Navigating Challenges in Online Banking API Testing
  • How To Organize End-To-End Quality Assurance and Testing for E-Commerce Apps
  • The Art of Being Ready: Reliability in Extreme Conditions
  • How to Avoid Defect Leakages in Software Testing

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: