JMeter - 在分布式测试中添加锁

JMeter - add Lock in a Distributed testing

我在我的 jmx 中使用 Critical Section Controller,我想在分布式环境中使用 jmx,但是有一个警告说它不能完成:

Critical Section Controller takes locks only within one JVM, so if using Distributed testing ensure your use case does not rely on all threads of all JVMs blocking.

当使用主从执行时,如何仍然阻止多线程访问同一个块?

我可以通过 OS Process Sampler 使用文件系统进行阻塞吗?

我宁愿选择 HTTP Simple Table Server as in case of creating a lock file you will need to set up some form of shared folder via CIFS or NFS 并且 HTTP Simple Table 服务器可用于从单个主机(即 JMeter Master 实例)编排所有远程引擎

您可以使用 JMeter Plugins Manager

安装 HTTP 简单 Table 服务器


另一个更简单的选项是 If Controller in conjunction with __machineName() or __machineIP() 函数,因此 "critical" 部分将仅由一个指定的从属执行。