Jmeter:测试后生成HTML报告 [英] Jmeter: HTML report generation after tests
问题描述
这些是我生成报告所遵循的步骤:
These are the steps that I followed to generate reports:
- 我有
.jtl
文件 - 我将给出示例配置的粘贴复制到我的
user.properties
位于apache-jmeter-5.0\bin
的文件
-
我使用
CMDRunner.jar
- I have the
.jtl
file - I copy paste given sample configuration to my
user.properties
file located atapache-jmeter-5.0\bin
I convert
.jtl
to aggregate report usingCMDRunner.jar
java -jar CMDRunner.jar --tool Reporter --generate-csv Demo17Results.csv --input-jtl Demo17Results.jtl --plugin-type AggregateReport
将步骤3中获取的csv
文件转换为HTML报告
Convert csv
file got from step#3 to HTML reports
我尝试了(1) jmeter -g Demo17Results.csv -o htmlReports/
Error: csv' does not contain the field names header, ensure the jmeter.save.saveservice.* properties are the same as when the CSV file was created or the file may be read incorrectly when generating report
An error occurred: Mismatch between expected number of columns:17 and columns in CSV file:11, check your jmeter.save.saveservice.* configuration or check line is complete
Error: csv' does not contain the field names header, ensure the jmeter.save.saveservice.* properties are the same as when the CSV file was created or the file may be read incorrectly when generating report
An error occurred: Mismatch between expected number of columns:17 and columns in CSV file:11, check your jmeter.save.saveservice.* configuration or check line is complete
我尝试了(2) jmeter -n -t Demo17Run.jmx -l Demo17Results.csv -e -o htmlReports/
Creating summariser <summary>
Error in NonGUIDriver java.lang.IllegalArgumentException: Results file:Demo17Results.csv is not empty
Creating summariser <summary>
Error in NonGUIDriver java.lang.IllegalArgumentException: Results file:Demo17Results.csv is not empty
清空csv文件后
Creating summariser <summary>
Created the tree successfully using Demo17Run.jmx
Starting the test
Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
summary = 0 in 00:00:00 = ******/s Avg: 0 Min: 9223372036854775807 Max: -9223372036854775808 Err: 0 (0.00%)
Tidying up ...
Error generating the report: org.apache.jmeter.report.core.SampleException: Could not read metadata !
... end of run
Creating summariser <summary>
Created the tree successfully using Demo17Run.jmx
Starting the test
Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
summary = 0 in 00:00:00 = ******/s Avg: 0 Min: 9223372036854775807 Max: -9223372036854775808 Err: 0 (0.00%)
Tidying up ...
Error generating the report: org.apache.jmeter.report.core.SampleException: Could not read metadata !
... end of run
生成Jmeter HTML仪表板报告时我做错了什么?
What am I doing wrong to generate Jmeter HTML dashboard reports?
推荐答案
- 您不需要步骤2,JMeter的默认配置就可以用于仪表板生成
- 您不需要执行第3步,就需要从
Demo17Results.jtl
文件创建仪表板,该文件包含完整的原始结果,而不是统计信息表 -
尝试使用强制删除通过
-f
参数的上一个结果文件:
- You don't need step 2, JMeter default configuration is just fine for dashboard generation
- You don't need step 3, the dashboard needs to be created from the
Demo17Results.jtl
file which contains full raw results, not statistics table Try re-running your test scenario with forcing deletion of the previous result file via
-f
argument:
jmeter -n -f -t Demo17Run.jmx -l Demo17Results.jtl -e -o htmlReports/
如果没有任何帮助再次检查您是否尚未修改必需的结果文件配置设置和提高report.dashboard
软件包的JMeter日志详细程度通过将下一行添加到 log4j2.xml 文件中:
If nothing helps double check you have not modified required results file configuration settings and increase JMeter logs verbosity for report.dashboard
package by adding the next line to log4j2.xml file:
<Logger name="org.apache.jmeter.report.dashboard" level="debug" />
这篇关于Jmeter:测试后生成HTML报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!