Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difficult to understand the Gaussian Random Timer?

I have read the Gaussian Random Timer info in jmeter user manual but it is difficult to understand. any one have idea related to this please explain with example highly appreciated. Thanks in advance.

like image 361
Chetan Avatar asked Jul 12 '13 13:07

Chetan


People also ask

In what all scenarios Gaussian random timer is used?

Gaussian Random Timer element is used to delay each user request for a random period of time. It has a random deviation around the Constant Delay Offset based on Gaussian curve distribution.

How can we avoid timer delay in calculating the response time in JMeter?

You can add Constant Delay Offset and Deviation time and rest will be calculated automatically. For Constant Delay Offset of 3000 ms and Deviation time of 300 ms, each thread of JMeter would execute after {3000+(0-300 ms (could be any value between 0-300 ms)}.

What is the aim of constant timer in JMeter?

The Constant Timer can be used to pause each thread for the same “think time” between requests. The above configuration will add a 5-second delay before the execution of each sampler, which is in the Constant Timer's scope. You can also use a JMeter Function or Variable in the “Thread Delay” input.

How can you add random thinking time time spent by a user while on a particular Web page to a JMeter test plan?

Solution : Right click on the “Thread Group” and select “Add Think Times to children” option. Jmeter will add think time after each transaction in the script.It will add a “uniform Random Timer” as a child to “Test Action” element.


1 Answers

I'll try to explain it with one of the examples already posted:

  • Constant delay offset: 1000 ms
  • Deviation: 500 ms

Approximately 68% of the delays will be between [500, 1500] ms (=[1000 - 500, 1000 + 500] ms).

According to the docs (emphasis mine):

The total delay is the sum of the Gaussian distributed value (with mean 0.0 and standard deviation 1.0) times the deviation value you specify, and the offset value

Apache JMeter invokes Random.nextGaussian()*range to calculate the delay. As explained in the Wikipedia, the value ofnextGaussian() will be between [-1,1] only for about 68% of the cases. In theory, it could have any value (though the probability to get values outside of this interval decreases very quickly with the distance to it).

As a proof, I have written a simple JMeter test that launches one thread with a dummy sampler and a Gaussian Random Timer: 3000 ms constant delay, 2000 ms deviation:

Gaussian Timer Configuration

To rule out cpu load issues, I have configured an additional concurrent thread with another dummy sampler and a Constant Timer: 5000 ms:

Constant Timer

The results are quite enlightening:

JMeter test results

Take for instance samples 10 and 12: 9h53'04.449" - 9h52'57.776" = 6.674", that is a deviation of 3.674" in contrast to the 2.000" configured! You can also verify that the constant timer only deviates about 1ms if at all.

I could find a very nice explanation of these gaussian timers in the Gmane jmeter user's list: Timer Question.

like image 101
Alberto Avatar answered Oct 13 '22 23:10

Alberto