Jmeter - 吞吐量控制器下“每用户”复选框的功能是什么?

Jmeter - What is the functioning of “Per User” checkbox under Throughput Controller?

我需要按一定比例分配应用程序的负载,即登录模块 - 60%、帐户 - 10%、其他模块 - 30%。经过一些研究,我在 jmeter 的 Throughput Controller 部分下找到了一个选项,我可以使用它来控制这些百分比。我在那里找到一个名为 "per user" 的复选框。现在我没有得到这个复选框。

根据这里的 blazemeter 博客,我尝试了一种情况,如下所示,带有 "Per user" 复选框 checked

现在,根据博客,特定事务应执行 400 次。但是该交易的执行为零。

我尝试了另一种情况 "Per user" 复选框 选中

现在,根据博客,特定事务应执行 600 次。但它执行了10次。

那里的任何专家都可以分享我在这里做错了什么吗?或者需要更清楚地说明此复选框的工作原理。

要理解Throughput Controller(TC),只需添加一个TC和一个采样器(在TC内)和Aggregate Report组合。然后,使用 Throughput Controller.

中的所有参数

来自官方文档:

Total executions: causes the controller to stop executing after a certain number of executions have occurred.

Per User: If 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.

多次仔细阅读这两个陈述。

在您指定的两种情况下,您的最大执行次数为 10。(线程数 * 循环数)。尽管您指定了 Total Executions 为 40 或 60,但首先,您应该提供超过 60 次,以便查看所有 40/60 次迭代都已执行。因此,始终指定比总执行次数更多的迭代次数(使用线程计数和循环计数)。

You have to consider Percentage Executions instead of Total Executions to match your requirements。同样,我建议模拟一个样本并通过改变百分比来理解行为。


以下是一些场景和预期行为 (EB)。

场景:1

线程组 - 10,循环计数 - 1,吞吐量 - 40(总执行),每个用户 - 已选中。

EB:采样器将 运行 仅 10 次。

场景:2

线程组 - 40,循环计数 - 1,吞吐量 - 40(总执行),每个用户 - 已检查

EB:采样器将 运行 仅 40 次。

场景:3

线程组 - 40,循环计数 - 1,吞吐量 - 40(总执行),每个用户 - 未选中

EB:采样器将 运行 仅 40 次。

场景:4

线程组 - 100,循环计数 - 1,吞吐量 - 40(总执行),每个用户 - 已检查

EB:Sampler 只会 运行 100 次。计算每个用户是否执行了40次。由于未达到限制,它执行所有 100 次迭代。

场景:5

线程组 - 100,循环计数 - 1,吞吐量 - 40(总执行),每个用户 - 未选中

EB:采样器只会 运行 40 次。在全球范围内计算。当所有线程的采样器达到 40 次时,停止执行它。

场景:6

线程组 - 100,循环计数 - 40,吞吐量 - 40(总执行),每个用户 - 已检查

EB:Sampler 将运行 400 次(每个用户 -> 40 次,100*40)。计算每个用户是否执行了40次。在这里,甚至每个用户限制也达到了 40 之后不再执行。

场景:7

线程组 - 100,循环计数 - 1,吞吐量 - 40(总执行),每个用户 - 未选中

EB:采样器只会 运行 40 次。在全球范围内计算。当所有线程的采样器达到 40 次时,停止执行它。