0

我曾经使用以下命令从 Jmeter jtl 文件创建汇总报告:

java -Djava.awt.headless=false -jar cmdrunner-2.2.jar --tool Reporter --generate-csv locust.csv --input-jtl 'kpi.jtl' --plugin-type AggregateReport

它适用于以下 kpi.jtl 文件

timeStamp,elapsed,label,responseCode,responseMessage,threadName,success,bytes,grpThreads,allThreads,Latency,Hostname,Connect
1589039402858,2795,jmeter_login_and_view_dashboard,200,"Number of samples in transaction : 11, number of failing samples : 0",Jira 1-1,true,53150,8,8,0,macbook718,0
1589039403878,2256,jmeter_login_and_view_dashboard,200,"Number of samples in transaction : 11, number of failing samples : 0",Jira 1-2,true,53091,11,11,0,macbook718,0
1589039403901,2243,jmeter_login_and_view_dashboard,200,"Number of samples in transaction : 11, number of failing samples : 0",Jira 1-3,true,52959,11,11,0,macbook718,0
1589039403923,2226,jmeter_login_and_view_dashboard,200,"Number of samples in transaction : 11, number of failing samples : 0",Jira 1-4,true,53092,11,11,0,macbook718,0
1589039404954,2230,jmeter_login_and_view_dashboard,200,"Number of samples in transaction : 11, number of failing samples : 0",Jira 1-5,true,53211,15,15,0,macbook718,0
1589039404970,2220,jmeter_login_and_view_dashboard,200,"Number of samples in transaction : 11, number of failing samples : 0",Jira 1-6,true,53142,15,15,0,macbook718,0
1589039404986,2233,jmeter_login_and_view_dashboard,200,"Number of samples in transaction : 11, number of failing samples : 0",Jira 1-7,true,52923,15,15,0,macbook718,0
1589039405004,2259,jmeter_login_and_view_dashboard,200,"Number of samples in transaction : 11, number of failing samples : 0",Jira 1-8,true,53176,15,15,0,macbook718,0
1589039406157,1645,jmeter_view_issue,200,"Number of samples in transaction : 9, number of failing samples : 0",Jira 1-2,true,40847,15,15,0,macbook718,0

但是几乎相同的jtl内容:

timeStamp,label,elapsed,bytes,responseCode,responseMessage,success,allThreads,Latency
1589039402858,locust_login_and_view_dashboard,2219,0,200,OK,true,3,0
1589039403878,locust_login_and_view_dashboard,2418,0,200,OK,true,4,0
1589039403901,locust_login_and_view_dashboard,2103,0,200,OK,true,5,0

我有 Jmeter Reporter 错误:

2020-05-10 17:34:54,704 INFO o.a.j.s.CSVSaveService: timeStamp did not match yyyy/MM/dd HH:mm:ss.SSS, trying next date format
2020-05-10 17:34:54,704 INFO o.a.j.s.CSVSaveService: timeStamp did not match yyyy/MM/dd HH:mm:ss, trying next date format
2020-05-10 17:34:54,705 INFO o.a.j.s.CSVSaveService: timeStamp did not match yyyy-MM-dd HH:mm:ss.SSS, trying next date format
2020-05-10 17:34:54,705 INFO o.a.j.s.CSVSaveService: timeStamp did not match yyyy-MM-dd HH:mm:ss, trying next date format
2020-05-10 17:34:54,705 INFO o.a.j.s.CSVSaveService: timeStamp did not match MM/dd/yy HH:mm:ss, trying next date format
2020-05-10 17:34:54,705 WARN o.a.j.s.CSVSaveService: Error parsing field 'timeStamp' at line 1. java.text.ParseException: No date-time format found matching timeStamp
2020-05-10 17:34:54,705 WARN o.a.j.r.ResultCollector: Problem reading JTL file: kpi.jtl
org.apache.jorphan.util.JMeterError: java.text.ParseException: No date-time format found matching timeStamp

似乎第二个 JTL 文件中的所有标题都是正确的。和相同的时间戳。为什么我有这个令人筋疲力尽的错误?也许我错过了 jtl 文件中一些必需的标题?

UPD。我发现问题出在标题的顺序中。你知道一些命令行键可以跳过聚合器报告中的 ORDER 检查吗?

现在的问题是:

2020-05-10 18:26:09,745 WARN o.a.j.u.JMeterUtils: Exception 'null' occurred when fetching String property:'sampleresult.default.encoding', defaulting to: ISO-8859-1
2020-05-10 18:26:09,757 WARN o.a.j.u.JMeterUtils: Exception 'null' occurred when fetching String property:'jmeterPlugin.prefixPlugins'
2020-05-10 18:26:09,758 INFO k.a.j.PluginsCMDWorker: Using JMeterPluginsCMD v. N/A
2020-05-10 18:26:09,761 INFO o.a.j.u.JMeterUtils: Setting Locale to en_UA
2020-05-10 18:26:09,766 INFO k.a.j.JMeterPluginsUtils: Loading user properties from: /Users/smoro/.bzt/jmeter-taurus/5.2.1/bin/user.properties
2020-05-10 18:26:09,766 INFO k.a.j.JMeterPluginsUtils: Loading system properties from: /Users/smoro/.bzt/jmeter-taurus/5.2.1/bin/system.properties
2020-05-10 18:26:10,606 WARN o.a.j.g.ObjectTableModel: Header count=13 but classes count=11
2020-05-10 18:26:10,606 WARN o.a.j.g.ObjectTableModel: Header count=13 but writeFunctor count=11
2020-05-10 18:26:10,755 INFO o.a.j.s.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2
2020-05-10 18:26:10,766 INFO o.a.j.s.SaveService: Using SaveService properties file encoding UTF-8
2020-05-10 18:26:10,769 INFO o.a.j.s.SaveService: Using SaveService properties version 5.0
2020-05-10 18:26:10,777 INFO o.a.j.s.SampleResult: Note: Sample TimeStamps are START times
2020-05-10 18:26:10,777 INFO o.a.j.s.SampleResult: sampleresult.default.encoding is set to ISO-8859-1
2020-05-10 18:26:10,777 INFO o.a.j.s.SampleResult: sampleresult.useNanoTime=true
2020-05-10 18:26:10,777 INFO o.a.j.s.SampleResult: sampleresult.nanoThreadSleep=5000
2020-05-10 18:26:10,778 WARN o.a.j.s.CSVSaveService: Insufficient columns to parse field 'Latency' at line 2
4

1 回答 1

0

根据JMeter 5.2.1 , jtl 结果文件中列的顺序是固定的,您只能使用结果文件配置添加/删除特定指标

因此,除非您想修补CSVSaveService并修改那里的列顺序,否则您在 JMeter 方面无能为力。

如果您尝试从Locust测试结果生成 HTML 报告仪表板,则使用 Grafana 可能更容易,请参阅在 15 分钟内使用 Grafana监控 Locust 以获得全面的说明

于 2020-05-11T16:56:23.363 回答