if (setupIter.hasNext()) { log.info("Starting setUp thread groups"); while (running && setupIter.hasNext()) {//for each setup thread group AbstractThreadGroupgroup= setupIter.next(); groupCount++; StringgroupName= group.getName(); log.info("Starting setUp ThreadGroup: {} : {} ", groupCount, groupName); startThreadGroup(group, groupCount, setupSearcher, testLevelElements, notifier); if (serialized && setupIter.hasNext()) { log.info("Waiting for setup thread group: {} to finish before starting next setup group", groupName); group.waitThreadsStopped(); } } log.info("Waiting for all setup thread groups to exit"); //wait for all Setup Threads To Exit waitThreadsStopped(); log.info("All Setup Threads have ended"); groupCount=0; JMeterContextService.clearTotalThreads(); }
groups.clear();
在 setup thread group 完成一些初始化的工作后,会主动出发一次 JMeterUtils.helpGC(); GC 的动作,后面就是执行测试的Thread Group 和 最后的Post Thread Group ,这些操作和setup thread group 的调用都差不多的,以为实际执行发送请求和并发线程的管理都在 ThreaeGroup 中