欢迎访问『www.cnblogs.com/blog-ice』

String time = vars.get("nowtime");

String today = vars.get("today");
String todayTime = vars.get("todayTime");

 

log.info(time);
log.info(today);

 

String root = "E:\\xxx\\result\\";
String reportPath = root + today + "\\" + todayTime;
File dir = new File(reportPath);
if (!dir.exists()) {
dir.mkdir();
}
String report = root + "\\Aggregate-Report-" + vars.get("nowtime");
String jmeterPath = "E:\\00-xxx\\soft\\apache-jmeter-5.3\\bin\\jmeter.bat";
String cmd = jmeterPath + " -g " + report + ".jtl -o " + reportPath;

 

log.info(cmd);
log.info("Html Report Path is : [" + reportPath + "]");

 

try {
Runtime.getRuntime().exec(cmd);
} catch (Exception e) {
log.error(e.getMessage());
}

 

posted on 2021-12-17 18:27  仙路尽头谁为峰  阅读(30)  评论(0编辑  收藏  举报
这里是自由发挥的天堂