如何在ThreadsGroups之间划分循环控制器中的请求jmeter



我在调用请求的时间上有一些问题。测试计划的结构如下:[1] :https://i.stack.imgur.com/zl1tX.png我直接从txt文件中读取ulr路径并将其发送我的代码

LineNumberReader lineReader = new LineNumberReader(new FileReader(new File("C:/tidaltv/LogsReplayer/LoggerReplaySTG_AllRegions/InputData/test.txt")));
String line = null;
int count = 0;
while ((line = lineReader.readLine()) != null) {
String[] values = line.split(" ");
for(int i = 0; i < values.length; i++)
{
if(values[i].startsWith("/ILogger.aspx?"))
{
props.put("path_" + count, values[i]);
log.info(props.get("path_" + count).toString());
}
}

count++;
}
props.put("LoopCounterValue", count.toString());
props.put("CounterValue", (count-1).toString());
log.info(count.toString());
lineReader.close();

但是,当我在一个线程中执行测试计划时,例如,20000请求需要花费很多时间。我可以在几个线程之间划分请求以使其更快的吗

不要在普通线程组中执行此操作并将值写入JMeter Properties,只需切换到setUp线程组并将值写到CSV文件即可。

通过这种方式,您将能够使用CSV数据集配置并在线程组中指定所需的线程数,这样请求将并行进行,每个JMeter线程(虚拟用户(将在每次迭代中从CSV文件中获取下一个值。

最新更新