Finish and start with other Threadgroup

偶尔善良 提交于 2021-02-20 05:11:35

问题


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?


回答1:


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,)}

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:



来源:https://stackoverflow.com/questions/63353408/finish-and-start-with-other-threadgroup

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!