jmeter5.0生成html報告 快速入門
JMeter效能測試5.0時代之-多維度的圖形化HTML報告
快速入門
1.確認基本配置
- 在jmeter.properties或者user.properties確認如下配置項:
-
jmeter.save.saveservice.bytes = true
jmeter.save.saveservice.label = true
jmeter.save.saveservice.latency = true
jmeter.save.saveservice.response_code = true
jmeter.save.saveservice.response_message = true
jmeter.save.saveservice.successful = true
jmeter.save.saveservice.thread_counts = true
jmeter.save.saveservice.thread_name = true
jmeter.save.saveservice.time = true
# the timestamp format must include the time and should include the date.
# For example the default, which is milliseconds since the epoch:
jmeter.save.saveservice.timestamp_format = ms
# Or the following would also be suitable
jmeter.save.saveservice.timestamp_format = yyyy/MM/dd HH:mm:ss
jmeter.save.saveservice.assertion_results_failure_message = true
2.生成報告
a. 在壓力測試結束時報告
-
- 基本命令格式:
jmeter -n -t <test JMX file> -l <test log file> -e -o <Path to output folder>
- 樣例: java -jar ApacheJMeter.jar -Jjmeter.save.saveservice.output_format=xml -n -t test.jmx -l test.jtl -e -o report
- 基本命令格式:
jmeter -g <log file> -o <Path to output folder>
- 樣例:
jmeter -g testLogFile -o ./report
- 兩個樣例都會在\apache-jmeter-5.0\bin\output目錄下產生如下檔案(夾)
-
用瀏覽器開啟index.html檔案,即可檢視各種圖形化報告:
注:在3.0版本,由於原始碼中字元編碼的問題,可能會遇到生成的報告中,中文標籤展示為亂碼的問題
- bin目錄下放待執行指令碼,jtl已存在的需要剪下到其他位置,report資料夾測試前要清空(report資料夾是自己建立的儲存報告的位置)
- 參考來源:https://blog.csdn.net/huodoubi/article/details/60956124?utm_source=itdadao&utm_medium=referral
- 參考來源2:https://blog.csdn.net/qq_34021712/article/details/78697671
-
b. 使用已有的壓力測試CSV日誌檔案生成報告
- 基本命令格式: