百度上這方面資料很少,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版本))