Jmeter定時器:Precise Throughput Timer使用


百度上這方面資料很少,google上有一些,我試着總結一下。

Precise Throughput Timer 是Jmeter4.0添加的新功能,直接摘錄一段英文:

The Precise Throughput Timer is a timer that enables users to determine the throughput (samplers per second/minute/hour/etc.) they want to run in their tests. Compared to the Constant Throughput Timer, the user is more flexible when deciding how to spread out the samples over time. In addition, execution is scheduled in a random way, enabling a constant load to build up. Finally, this timer uses the Poisson arrival schedule for its pauses, making it close to real-life scenarios.

(不是翻譯,就是說 Precise Throughput Timer 能讓使用者控制吞吐量更靈活(每小時每分鍾每秒等),並且如果定制了如一秒執行100次,那么這100次該如何分布(產生定制的恆定吞吐量的泊松分布(Poisson Distribution,二項式的隨機概率分布)),是更棒的算法來實現隨機分布,更接近實際情況。)

 

下面是一個例子:

Add a Precise Throughput Timer (Thread Group->Add->Timers->) .We have to achieve 100 requests by 5 users in 300 second. Setup the timers as per below setting:

a. Target throughout = 100

b.Throughput period (Seconds) = 300 (Total time to achieve the desired throughput).

c.Number of threads in the batch (threads)= 1

d.Use approximate throughput when sequence length exceeds (samples) = 100 (total no of requests)

e. Allowed throughput surplus (Percents) = 10

(不是翻譯,這個例子就是說,300秒內,會執行100次請求,那么每秒是 100/300  就是0.3333的 throughput。)

(注意Throughput period (Seconds)  不能小於5,要不然會報錯(Jmeter4.0版本))

 
 
 
 
這里有些配置沒說,因為我也無法解釋的很准確,google上資料也很少。(這個timer太少人用了)
我只能說是猜測:
Batched  departures 這部分是批處理的線程數,我傾向於理解是計算請求隨機分布的線程數,就是說隨機數的計算力。
Accuracy of generated delays  我理解是計算隨機分布的參數,如果超過了隊列,這個例子中是100個請求之后,會盈余10%。 我理解這個10%是泊松分布的一個參數,總體上還是  300/100 ,但是分布是由這個參數調整的。
Random seed 就不說了,是隨機數的取值種子。
 
所以,這個timer需要測試人對數學算法有了解了,這樣才能調出來更接近實際情況的throughput。
如果比如說是24小時,執行一億次,這一億次來個隨機分布,有高峰有低谷,那這個定時器確實就不簡單了。
 
當然性能測試工作很難這么理想化,性能測試到后期肯定是全公司通力合作的一件事,上面1天一億次的分布,是性能測試的探索方向,關鍵還是在於評價標准,要不然誰知道這么分布就對,那么分布就錯呢。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM