【问题标题】:Jmeter: HTML report generation after testsJmeter:测试后生成 HTML 报告
【发布时间】:2020-09-24 11:38:47
【问题描述】:

这些是我生成报告所遵循的步骤:

  1. 我有.jtl 文件
  2. 我将给定sample configuration 的粘贴复制到我位于apache-jmeter-5.0\binuser.properties 文件中
  3. 我使用CMDRunner.jar.jtl 转换为汇总报告

    java -jar CMDRunner.jar --tool Reporter --generate-csv Demo17Results.csv --input-jtl Demo17Results.jtl --plugin-type AggregateReport
    
  4. 将从第 3 步得到的 csv 文件转换为 HTML 报告

    我试过(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

我试过(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

清空 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

生成 Jmeter HTML 仪表板报告我做错了什么?

【问题讨论】:

    标签: jmeter report jmeter-plugins


    【解决方案1】:
    1. 您不需要第 2 步,JMeter 默认配置即可生成仪表板
    2. 您不需要第 3 步,需要从包含完整原始结果而非统计表的Demo17Results.jtl 文件创建仪表板
    3. 尝试使用forcing deletion of the previous result file via -f argument 重新运行您的测试场景:

      jmeter -n -f -t Demo17Run.jmx -l Demo17Results.jtl -e -o htmlReports/
      

    如果没有任何帮助,请通过将下一行添加到 log4j2.xml 文件来仔细检查您是否修改了所需的 results file configuration settingsincrease JMeter logs verbosity for report.dashboard package

    <Logger name="org.apache.jmeter.report.dashboard" level="debug" />
    

    【讨论】:

    • 如果我将它与 -f 参数一起使用,则 index.html (报告已创建)创建为空白且没有错误,但如果我从命令中跳过 -f 参数,它会给出一条消息:@ 987654333@ 并且未创建报告。
    • 日志是怎么说的?
    • 日志非常大,所以添加到这个打开的链接中。请查收。docs.google.com/document/d/…
    • Test failed! java.lang.IllegalArgumentException: File csv1.csvmust exist and be readable。您的仪表板是空的,因为由于无法找到 csv1.csvcsv2.csv 文件而未执行测试,请仔细检查您的 CSV Data Set Config 设置并确保文件存在于适当的位置。
    • 它运行良好。我正在使用相同的.jtl 文件来提取汇总报告。请参阅我使用CMDRunner.jar 的步骤#3。但是,我不明白您所说的make sure that the files are present in appropriate places 是什么意思。 Jmeter 在环境变量中,对于文件,我在命令中输入了正确的路径。
    【解决方案2】:

    我在测试运行后尝试生成 HTML 仪表板报告时遇到了类似的错误。即使 .jtl 文件的路径是正确的(并且目录名称中没有空格),我仍然收到错误“预期列数之间不匹配......”我将命令指向 .我在另一个目录中创建的 jtl 文件。我更改了命令以获取 JMeter\bin 中的 .jtl 文件,并且该文件有效……不再出现错误,并且生成了报告。因此,有效的命令(从 JMeter\bin 运行)是:jmeter –g log.jtl –o C:\HTML_Reports。

    此外,指定的输出文件夹不得存在(JMeter 将创建它),如果存在,则必须为空。

    【讨论】:

      猜你喜欢
      • 2016-10-09
      • 2020-05-28
      • 1970-01-01
      • 1970-01-01
      • 2013-09-03
      • 2020-10-27
      • 2021-12-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多