完成并从其他线程组开始 [英] Finish and start with other Threadgroup

查看:53
本文介绍了完成并从其他线程组开始的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Jmeter测试多个微服务. 基本思想是在微服务环境中测试断路器. 现在,我正在使用两个线程组,一个主线程和一个从属远程概念. 一个线程组创建使用100个迭代和1000个线程并创建 加载前端服务,该前端服务将请求发送到后端服务. 另一组通过100次迭代但有1个线程来探测后端服务. 如果我没记错的话,第二个线程组比第一个线程组更早完成. 可以以某种方式同步这两个吗?

I'm using Jmeter to test multiple microservice. The basic idea is to test a circuit breaker in a microservice environment. Right now, I'm using two threadgroups, a master and slave remote concept. One thread group creates uses 100 iterations and 1000 thread and creates load against a front-end service, which sends request to a backend service. The other group probes the backend service with 100 iterations but 1 thread. If I’m not wrong the second threadgroup finishes way more early than the first one. Is it somehow possible to sync those two?

还有另一个问题. 当我使用遥控器扩展线程时,第二个线程组也会扩展,是否有可能强制第二个线程组仅使用一个从属服务器?

And maybe another question. As I scale the threads with the remotes, also the second thread group scales, is it possible to force the second threadgroup to use only one slave?

推荐答案

为了执行探针",直到"main"线程组.线程组正在执行"probe"操作. 控制器下的请求,并使用以下

In order to execute "probe" thread group until "main" thread group is executing put the "probe" request under the While Controller and use the following __groovy() function as the condition:

${__groovy(org.apache.jmeter.threads.JMeterContextService.getThreadCounts().activeThreads > 1,)}

如果您想执行探针",请执行以下操作:线程组仅位于JMeter集群的一台计算机上-将整个结构放在 jexl3()函数作为条件:

If you want to execute the "probe" thread group only on one machine of the JMeter cluster - put the whole construction under the If Controller and use the following jexl3() function as the condition:

${__jexl3("${__machineIP()}" == "IP address of the slave",)}

整个线程组应如下所示:

The whole Thread Group should look like:

这篇关于完成并从其他线程组开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆