gpt4 book ai didi

java - Jmeter中的RemoteJMeterEngineImpl类,如何创建实例并调用rconfigure

转载 作者:行者123 更新时间:2023-12-02 12:44:14 26 4
gpt4 key购买 nike

议程 - 从本地主机 Java 类调用远程区域的 JMeter

我发现RemoteJMeterEngineImpl类有助于调用远程区域的JMeter

问题 - 由于私有(private)构造函数,无法创建 RemoteJMeterEngineImpl 类的实例

如果有人知道如何使用 RemoteJMeterEngineImpl 类,请帮忙

最佳答案

你正在做一些奇怪的事情并且绝对不受支持。通常,您应该启动并运行远程从站,如果您需要以编程方式启动测试,我相信 DistributedRunner class是你可以使用的东西。

示例代码:

List<JMeterEngine> engines = new LinkedList<>();
Properties remoteProps = new Properties();
//set properties you want to send to remote clients here
DistributedRunner distributedRunner=new DistributedRunner(remoteProps);

List<String> hosts = new LinkedList<>();
//add your JMeter slaves here
hosts.add("remote_host_1");
hosts.add("remote_host_2");
distributedRunner.setStdout(System.out);
distributedRunner.setStdErr(System.err);
distributedRunner.init(hosts, testPlanTree);
engines.addAll(distributedRunner.getEngines());
distributedRunner.start();

参见Five Ways To Launch a JMeter Test without Using the JMeter GUI文章和jmeter-from-code示例项目以了解有关 JMeter 测试的编程创建和执行的更多信息。

关于java - Jmeter中的RemoteJMeterEngineImpl类,如何创建实例并调用rconfigure,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44826203/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com