Jmeter - ${__P(var)} 在远程(分布式)测试期间不起作用

Dev*_*ang 3 jmeter load-testing

我使用${__P(users,2)}在运行时指定线程数(用户)

当我在单机上执行脚本时它工作正常。

但是当我在分布式环境中执行相同的脚本时它不起作用

正确。它采用默认值 2 。

我还尝试删除默认值,例如${__P(users)}

Dmi*_*i T 6

-J您可以通过命令行参数传递本地属性,例如

jmeter -Jusers=50
Run Code Online (Sandbox Code Playgroud)

如果您在分布式模式下运行测试,则需要用-Gswitch 来替换它,您可以在其中提供单个属性或 .properties 文件,在这种情况下,全局属性将被推送到远程 JMeter 服务器

    -J, --jmeterproperty <argument>=<value>
            Define additional JMeter properties
    -G, --globalproperty <argument>=<value>
            Define Global properties (sent to servers)
            e.g. -Gport=123
             or -Gglobal.properties**
    -D, --systemproperty <argument>=<value>
            Define additional system properties
    -S, --systemPropertyFile <argument>                                                                                                                                 
            additional system property file(s)  
Run Code Online (Sandbox Code Playgroud)

有关更多选项的说明,请参阅如何在非 GUI 模式下运行 JMeter 。