若是你想從頭學習Jmeter,能夠看看這個系列的文章哦html
https://www.cnblogs.com/poloyy/category/1746599.html學習
簡單介紹
自行調整該控制器下的子項的執行頻率spa
吞吐量控制器
![](http://static.javashuo.com/static/loading.gif)
吞吐量控制器界面介紹
![](http://static.javashuo.com/static/loading.gif)
有了兩個模式線程
- percent execution:按照百分比來執行
- total executions:按照次數來執行
字段說明
Throughput3d
- 對於 percent execution:0-100,表明執行次數的百分比,好比填 50,表明一半迭代中執行
- 對於 total executions:表明執行的總次數
Per Userhtm
- 若勾選,每一個線程會單獨計算執行頻率
- 若不勾選(默認),全部線程統一計算執行頻率
注意事項
雖然名叫吞吐量控制器,但並不控制控制器,只是控制子項的執行頻率(次數)blog
Total Executions 的栗子
線程組結構樹
![](http://static.javashuo.com/static/loading.gif)
線程組屬性
![](http://static.javashuo.com/static/loading.gif)
吞吐量控制器
![](http://static.javashuo.com/static/loading.gif)
只執行 2 次get
查看結果樹
![](http://static.javashuo.com/static/loading.gif)
取樣器111 只執行了 2 次it
Percent Executions 的栗子
線程組結構樹
![](http://static.javashuo.com/static/loading.gif)
線程組屬性
![](http://static.javashuo.com/static/loading.gif)
2 個線程,每一個線程循環 4 次io
吞吐量控制器
![](http://static.javashuo.com/static/loading.gif)
循環只執行 50%
查看結果樹
![](http://static.javashuo.com/static/loading.gif)
- 取樣器222執行了 8 次,每一個線程執行了 4 次
- 取樣器111只執行了 4 次,每一個線程執行了 2 次
勾選 per user 的栗子
線程組結構樹
![](http://static.javashuo.com/static/loading.gif)
線程組屬性
![](http://static.javashuo.com/static/loading.gif)
2 個線程,每一個線程循環 3 次
吞吐量控制器
![](http://static.javashuo.com/static/loading.gif)
只執行 2 次
查看結果樹
![](http://static.javashuo.com/static/loading.gif)
- 取樣器222執行了 6 次,每一個線程執行了 3 次
- 取樣器111只執行了 4 次,每一個線程執行了 2 次
- 控制器對每一個線程單獨生效
若是不勾選 Per User,結果樹會怎麼樣呢
![](http://static.javashuo.com/static/loading.gif)
- 取樣器222執行了 6 次,每一個線程執行了 3 次
- 取樣器111總共只執行了 2 次,由於線程 1 先執行,因此只有線程 1 能執行取樣器111,而線程 2 不能執行
- 吞吐量控制器全部線程共享
結合循環控制器的栗子
線程組結構樹
![](http://static.javashuo.com/static/loading.gif)
線程組屬性
![](http://static.javashuo.com/static/loading.gif)
2 個線程,每一個線程循環 2 次
循環控制器
![](http://static.javashuo.com/static/loading.gif)
吞吐量控制器
![](http://static.javashuo.com/static/loading.gif)
只執行 2 次
查看結果樹
![](http://static.javashuo.com/static/loading.gif)
- 每一個線程一共會執行 4 次
- sampler2 均會執行 4 次
- sampler1 均會執行 2 次,且都在線程第一次循環的時候,經過循環控制器循環兩次執行的