Software testing skills, JMeter stress testing tutorial, uniform random timer/Gaussian random timer (19)

Table of contents

foreword

1. Unified random timer

1. Uniform Random Timer

2. Set the delay time

2. Gaussian Random Timer

1. Gaussian Random Timer

2. Set the delay time


foreword

If you want to add a random waiting time, you can use the uniform random timer (Uniform Random Timer) in jmeter,
and some say it is called a uniform random timer (Uniform Random Timer).

Adding a uniform random timer can generate a random value that has an equal probability of occurring. The probability of occurrence of random values ​​​​in real life is not equal, but conforms to a normal distribution or a Gaussian random distribution

So what are Gaussian random numbers?
A Gaussian random number is a random number with a mean of 0 and a variance of 1.

1. Unified random timer

1. Uniform Random Timer

The scope of the timer:
1. The timer is executed before each sampler (sampler), not after (regardless of whether the timer position is before or below the sampler)

2. Before executing a sampler, all timers in the current scope will be executed

3. If you want the timer to be applied to only one of the samplers, add the timer as a child node to the
unified random timer is executed before each sampler (sampler), if we want to add a random before the second request The delay time is added to the child node

2. Set the delay time

The role of Gaussian random timer is not much different. The difference is that the delay time is within the specified range and the value probability of each time is the same, and each time interval has the same probability of occurrence. The total delay time is the random value and bias The sum of shifted values.
This timer can set a random delay between requests, each random delay has an equal probability of occurrence.

Random Delay Maximum(in milliseconds): The maximum time unit of random delay in milliseconds

Constant Delay Offset(in milliseconds): fixed delay time in milliseconds

Calculation formula for delay time

总的延时 = 固定延迟时间 + 随机生成的延时

 For example, set the Constant Delay Offset to 2000 milliseconds, and set the Random Delay Maximum to 500 milliseconds

Then the total delay time range is a value between 2000 milliseconds and 2500 milliseconds . If one thread is set to loop 3 times, the interval time in each loop is a random value, and the range is 2000 to 2500 milliseconds. If three threads are set 1 cycle, the interval between each thread is a random value, the range is 2000~2500 milliseconds

The uniform random timer delay time is within the specified range, and the value probability of each time is the same, and each time interval has the same probability of occurrence

2. Gaussian Random Timer

1. Gaussian Random Timer

The scope of the timer:
1. The timer is executed before each sampler (sampler), not after (regardless of whether the timer position is before or below the sampler)

2. Before executing a sampler, all timers in the current scope will be executed

3. If you want the timer to be applied to only one of the samplers, then add the timer as a child node
Gaussian random timer is executed before each sampler (sampler), if we want to add a random before the second request The delay time is added to the child node

The random number generated by the Gaussian random timer does not have the same probability of occurrence, and its probability conforms to the Gaussian random number distribution

2. Set the delay time

The timer can set a random delay between requests, and the probability of each random delay conforms to the Gaussian random number distribution

Deviation value Deviation (in milliseconds): Deviation value, which is a floating range

Constant Delay offset (in milliseconds): fixed delay time

Calculation formula for delay time

总的延时 = 固定延迟时间 + 高斯随机生成的偏差值

The units are all milliseconds, the fixed delay is 300ms, and the deviation is 100ms, which means that the time delay between 300-400ms is the same as the previous uniform random timer function, but the probability of random numbers is different.


              [The following is the most complete software test engineer learning knowledge architecture system diagram in 2023 that I compiled]


1. From entry to mastery of Python programming

2. Interface automation project actual combat

3. Actual Combat of Web Automation Project


4. Actual Combat of App Automation Project

5. Resume of first-tier manufacturers


6. Test and develop DevOps system

7. Commonly used automated testing tools


Eight, JMeter performance test

9. Summary (little surprise at the end)

life is long so add oil. Every effort will not be let down, as long as you persevere, there will be rewards in the end. Cherish your time and pursue your dreams. Don't forget the original intention, forge ahead. Your future is in your hands!

Life is short, time is precious, we cannot predict what will happen in the future, but we can grasp the present moment. Cherish every day and work hard to make yourself stronger and better. Firm belief, persistent pursuit, success will eventually belong to you!

Only by constantly challenging yourself can you constantly surpass yourself. Persist in pursuing your dreams and move forward bravely, and you will find that the process of struggle is so beautiful and worthwhile. Believe in yourself, you can do it!

Guess you like

Origin blog.csdn.net/NHB456789/article/details/131490811