我必须通过java编码生成Jmeter仪表板报告。在java代码下面,我曾经用来生成一个普通的jmeter报告。我必须通过java生成仪表板报告。
public class JMeterFromExistingJMX {
public static void main(String[] argv) throws Exception {
// JMeter Engine
StandardJMeterEngine jmeter = new StandardJMeterEngine();
// Initialize Properties, logging, locale, etc.
// JMeterUtils.loadJMeterProperties
("/path/to/your/jmeter/bin/jmeter.properties");
JMeterUtils.setJMeterHome("/path/to/your/jmeter");
JMeterUtils.initLogging();// log
JMeterUtils.initLocale();
// Initialize JMeter SaveService
SaveService.loadProperties();
// Load existing .jmx Test Plan
FileInputStream in = new
FileInputStream
("/path/to/your/jmeter/extras/Test.jmx");
HashTree testPlanTree = SaveService.loadTree(in);
in.close();
// Run JMeter Test
jmeter.configure(testPlanTree);
jmeter.run();
}
}
}
相关分类