不管前面是地雷阵还是万丈深渊,我都将勇往直前,义无反顾,鞠躬尽瘁,死而后已。
--朱总理
一、官方文档
The Throughput Controller allows the user to control how often it is executed. There are two modes:
percent execution
total executions
Percent executions
causes the controller to execute a certain percentage of the iterations through the test plan.
Total executions
causes the controller to stop executing after a certain number of executions have occurred.
Like the Once Only Controller, this setting is reset when a parent Loop Controller restarts.
This controller is badly named, as it does not control throughput. Please refer to the Constant Throughput Timer for an element that can be used to adjust the throughput.
Control Panel
The Throughput Controller can yield very complex behavior when combined with other controllers - in particular with interleave or random controllers as parents (also very useful).
Parameters
AttributeDescriptionRequired
NameDescriptive name for this controller that is shown in the tree.No
Execution StyleWhether the controller will run in percent executions or total executions mode.Yes
ThroughputA number. For percent execution mode, a number from 0-100 that indicates the percentage of times the controller will execute. "50" means the controller will execute during half the iterations through the test plan. For total execution mode, the number indicates the total number of times the controller will execute.Yes
Per UserIf checked, per user will cause the controller to calculate whether it should execute on a per user (per thread) basis. If unchecked, then the calculation will be global for all users. For example, if using total execution mode, and uncheck "per user", then the number given for throughput will be the total number of executions made. If "per user" is checked, then the total number of executions would be the number of users times the number given for throughput.
The Throughput Controller allows the user to control how often it is executed. There are two modes
第一段就说的很清楚,控制执行频率。
·Total Executions
执行一定数量停止
·Percent Executions
按照百分比执行
和仅一次控制器一样,当父循环控制器重新启动时,此设置将重置
·Per User
如果选中,则每个用户将导致控制器计算是否应按每个线程执行
如果未选中,则计算是所有线程的全局计算
例如:选择Total Executions,取消选择Per User,则吞吐量给定的数字是执行的总数;选择Per User,执行的总数是线程数*吞吐量的给定数
二、实践
吞吐量控制器通常在组合业务场景中,例如:容量性能场景、稳定性能场景中非常实用。
线程组配置:5s内启动100线程,循环1次
Throughput Controller_success 选择百分比控制方式 20%
Throughput Controller_debug 选择百分比控制方式 30%
Throughput Controller_error 选择百分比控制方式 50%
聚合报告展示:
Response Times Over Time 展示:
Transactions per Second展示:
从聚合报告展示中便可看出其分配比例。
分别将吞吐量控制器修改为Total Executions
线程组循环数改为2,其余不变
Throughput Controller_success 100
Throughput Controller_debug 50
Throughput Controller_error 50
选择Per User
Response Times Over Time
欢迎任何形式的转载,但请务必注明出处。 限于本人水平,如果文章和代码有表述不当之处,还请不吝赐教。 ---紫陌花间客
网友评论