代码之家  ›  专栏  ›  技术社区  ›  paul

jmeter:测试后生成html报告

  •  0
  • paul  · 技术社区  · 6 年前

    以下是生成报告所遵循的步骤:

    1. 我有 .jtl 文件
    2. 我复制给定的粘贴 sample configuration 对我 user.properties 文件位于 apache-jmeter-5.0\bin
    3. 我皈依 JTL 使用 CMDRunner.jar

      java -jar CMDRunner.jar --tool Reporter --generate-csv Demo17Results.csv --input-jtl Demo17Results.jtl --plugin-type AggregateReport
      
    4. 转换 csv 从步骤3到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仪表板报告时做错了什么?

    1 回复  |  直到 6 年前
        1
  •  0
  •   Dmitri T    6 年前
    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/
      

    如果没有任何帮助,请重新检查您没有修改所需的 results file configuration settings increase JMeter logs verbosity for report.dashboard package 通过将下一行添加到 log4j2.xml文件 文件:

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