Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JMeter. How to determine when thread group is finished

I need two separate thread groups to be run(Second group have infinite loop count). And when the first group is done stop the second one. How can I determine when the first group is done?

like image 567
Alexandr Avatar asked Sep 12 '25 13:09

Alexandr


1 Answers

That's work for me:

  • Crete "BeanShell PreProcessor" with this code:
    props.put("DONE", "FALSE");
  • Create "BeanShell PostProcessor" with this code:
    int activeThreadCount = org.apache.jmeter.threads.JMeterContextService.getNumberOfThreads(); if (activeThreadCount <= 1) { props.put("DONE", "TRUE"); }

Add If Controller with:
${__BeanShell( props.get("DONE") != null && props.get("DONE")=="TRUE")}

Stop Current Thread inside If Controller.

like image 108
Alexandr Avatar answered Sep 14 '25 15:09

Alexandr