Back to Top

Controller & Timer in Jmeter

Updated 8 May 2023

What is JMeter?

JMeter is a popular open-source tool for load testing, performance testing, and functional testing of web applications. It provides various features and components to help you simulate real-world scenarios and test the performance and behavior of your application under different loads.

For more details regarding JMeter Performance Testing, you can check the blog.

For more details regarding Apache JMeter: Click here.

In this blog, we will discuss two important components of JMeter, the JMeter Controller & Timers.

Logic Controller in JMeter:

A JMeter Controller is the main component of the JMeter test plan. It is responsible for creating and managing the test plan and its various components. The controller allows you to organize your test plan by adding and grouping different elements. There are several types of controllers in JMeter, each with its own set of features and functionality.

Start your headless eCommerce
now.
Find out More

Types of Logic Controller:

Simple Controller:

It’s just a container for the user’s request. We can Add Simple Controller using the below steps.

right click on Thread Group >> Add >> Logic Controller >> Simple Controller

simplecontroller

Loop Controller:

The loop controller will run the samplers/requests stored in it for a definite number of times or forever. We can Add Loop Controller using the below steps.

right click on Thread Group >> Add >> Logic Controller >> Loop Controller

loop-controller

Transaction Controller:

It is used to group multiple sampler requests into one. We can Add a Transaction Controller using the below steps.

Right click on Thread Group >> Add >> Logic Controller >> Transaction Controller

transaction-controller

Random Controller:

Random Controller makes all the user requests run in a random order in each loop period. We can Add Random Controller using the below steps.

Right click on Thread Group >> Add >> Logic Controller >> Random Controller

random-controller

Interleave Controller:

It allows us to pick and execute a single child element out of multiple child in each loop iteration. We can Add Interleave Controller using the below steps.

Right click on Thread Group >> Add >> Logic Controller >> Interleave Controller

interleave

Throughput Controller:

It is used to control the processing of its child elements in terms of the total number of executions or the percentage of execution specified in its control panel. We can Add a Throughput Controller using the below steps.

Right click on Thread Group >> Add >> Logic Controller >> Throughput Controller

throughput-controller

If Controller:

If Controller works in a similar way an IF expression is treated in any programming language. The condition is validated first and then the components under this container execute if the condition is TRUE, otherwise, the elements outside the IF Controller will get executed.

We can Add the If Controller using the below steps.

Right click on Thread Group >> Add >> Logic Controller >> If Controller

if-controller

While Controller:

While Loop controller executes its samplers until the condition specified is not set to False. The condition can be any variable or function that eventually evaluates to the string false. We can Add a While Controller using the below steps.

Right click on Thread Group >> Add >> Logic Controller >> While Controller

while-controller

Timers in JMeter

  • The purpose of the ‘Timer’ element is to pause a JMeter Thread for a certain amount of time.
  • Timers allow JMeter to delay each request that a thread makes. A timer can solve the server overload problem.

Types Of Timer:

Constant Timers:

It delays each user request for the same amount of time.

constant-timer

Gaussian Random Timer:

The Gaussian random timer delays each user request for a random amount of time.

Gaussian Distribution of Deviation Value + Constant Delay Offset = Total Delay Time

gaussion-timer

Uniform Random Timer:

A uniform random timer delays each user request for a random amount of time.

Total amount of delay = Random Delay Maximum + Constant Delay Offset

uniform-random-timer

Synchronizing Timer:

It holds the threads until X number of threads have arrived, and then they are all released at once. It adds delays between requests such that all (defined) threads fire at the same time thus creating heavy load bursts on the application.

This timer is very useful to make users (threads) do simultaneous tasks.

Synchronizing-timer

Poisson random Timer:

It is similar to a Gaussian Random timer. It provides delay time between the requests for a random interval of time and the total delay in time is the sum of both Lambda (in milliseconds) and Constant Delay offset (in milliseconds).

Random number generation is based on Poisson distribution.

poisson-random-timer

That’s all about Controller & Timer in JMeter.

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home