JMeter。如何确定线程组何时完成

Ale*_*ndr 1 jmeter threadgroup

我需要运行两个单独的线程组(第二组有无限循环计数)。当第一组完成后,停止第二组。如何确定第一组何时完成?

Ale*_*ndr 5

这对我有用:

  • 带有以下代码的克里特岛“BeanShell PreProcessor”:
    props.put("DONE", "FALSE");
  • 使用以下代码创建“BeanShell PostProcessor”:
    int activeThreadCount = org.apache.jmeter.threads.JMeterContextService.getNumberOfThreads(); if (activeThreadCount <= 1) { props.put("DONE", "TRUE"); }

添加 If 控制器:
${__BeanShell( props.get("DONE") != null && props.get("DONE")=="TRUE")}

停止 If 控制器内的当前线程。