jmeter非gui运行,jtl生成了,但是html报告没有生成,查看log,内容如下:
22:45:00,913 ERROR o.a.j.JMeter: Error generating dashboard: org.apache.jmeter.report.dashboard.GenerationException: Error while processing samples:Mismatch between expected number of columns:17 and columns in CSV file:13, check your jmeter.save.saveservice.* configuration or check line is complete
org.apache.jmeter.report.dashboard.GenerationException: Error while processing samples:Mismatch between expected number of columns:17 and columns in CSV file:13, check your jmeter.save.saveservice.* configuration or check line is complete
at org.apache.jmeter.report.dashboard.ReportGenerator.generate(ReportGenerator.java:247) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.JMeter$ListenToTest.generateReport(JMeter.java:1324) [ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.JMeter$ListenToTest.run(JMeter.java:1308) [ApacheJMeter_core.jar:5.1.1 r1855137]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_211]
Caused by: org.apache.jmeter.report.core.SampleException: Mismatch between expected number of columns:17 and columns in CSV file:13, check your jmeter.save.saveservice.* configuration or check line is complete
at org.apache.jmeter.report.core.CsvSampleReader.nextSample(CsvSampleReader.java:189) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.report.core.CsvSampleReader.readSample(CsvSampleReader.java:205) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.report.processor.CsvFileSampleSource.produce(CsvFileSampleSource.java:180) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.report.processor.CsvFileSampleSource.run(CsvFileSampleSource.java:238) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.report.dashboard.ReportGenerator.generate(ReportGenerator.java:245) ~[ApacheJMeter_core.jar:5.1.1 r1855137]
... 3 more
22:45:00,921 INFO o.a.j.r.ResultCollector: Shutdown hook started
22:45:00,923 INFO o.a.j.r.ResultCollector: Shutdown hook ended
通过聚合报告打开jtl,结果内容正常
那么,我们可以通过jtl生成html报告,执行:jmeter -g .\res.jtl -e -o .\res\
最后成功生成html报告