假设现在一共会加载100个线程,期望聚合报告中分别展示1-20,20-40,40-60,60-80的四个阶段的线程并发性能数据,而不是总体的统计数据
beanshell脚本,具体内容:
import org.apache.jmeter.threads.JMeterContextService; int num = JMeterContextService.getNumberOfThreads(); System.out.println("当前活动线程数=" +num); if(num<=20){ System.out.println("线程区间1-20"); vars.put("Thread","线程数1-20"); } ? else if (num>20&&num<=40){ System.out.println("线程区间20-40"); vars.put("Thread","线程数20-40"); } else if(num>40&&num<=60){ System.out.println("线程区间40-60"); vars.put("Thread","线程数40-60"); } else { System.out.println("线程区间60-100"); vars.put("Thread","线程数60-100"); }
假设现在一共会加载100个线程,我期望聚合报告中分别展示1-20,20-40,40-60,60-80的四个阶段的线程并发性能数据,而不是一共总体的统计数据
import org.apache.jmeter.threads.JMeterContextService;int num = JMeterContextService.getNumberOfThreads();System.out.println("当前活动线程数=" +num);if(num<=20){System.out.println("线程区间1-20");vars.put("Thread","线程数1-20");}?else if (num>20&&num<=40){System.out.println("线程区间20-40");vars.put("Thread","线程数20-40");}else if(num>40&&num<=60){System.out.println("线程区间40-60");vars.put("Thread","线程数40-60");}else {System.out.println("线程区间60-100");vars.put("Thread","线程数60-100");}