JMeter 在 CLI 中给出错误百分比,但在 GUI 中没有
JMeter giving Error percentage in CLI but not in GUI
我在 docker 容器中有一个小型微服务 运行ning,我试图获取使用 JMeter CLI 的延迟。我使用 JMeter GUI 进行了测试,运行 首先进行了测试。然后错误百分比为 0。但是当我 运行 使用 CLI 进行相同的测试时,我得到了错误百分比的值。我收到以下警告:
Creating summariser <summary>
Created the tree successfully using /Users/sulekahelmini/Documents/fyp/jmeter_scripts/factorial.jmx
Starting standalone test @ Tue Feb 18 02:20:35 IST 2020 (1581972635848)
Waiting for possible Shutdown/StopTestNow/HeapDump/ThreadDump message on port 4445
summary = 50 in 00:00:02 = 25.0/s Avg: 50 Min: 4 Max: 323 Err: 0 (0.00%)
Tidying up ... @ Tue Feb 18 02:20:38 IST 2020 (1581972638095)
... end of run
2020-02-18 02:20:39,012 WARN o.a.j.u.JMeterUtils: Exception 'null' occurred when fetching String property:'sampleresult.default.encoding', defaulting to: ISO-8859-1
2020-02-18 02:20:39,022 WARN o.a.j.u.JMeterUtils: Exception 'null' occurred when fetching String property:'jmeterPlugin.prefixPlugins'
2020-02-18 02:20:39,022 INFO k.a.j.PluginsCMDWorker: Using JMeterPluginsCMD v. N/A
2020-02-18 02:20:39,025 INFO o.a.j.u.JMeterUtils: Setting Locale to en_LK
2020-02-18 02:20:39,030 INFO k.a.j.JMeterPluginsUtils: Loading user properties from: /Users/sulekahelmini/Documents/fyp/apache-jmeter-5.2.1/bin/user.properties
2020-02-18 02:20:39,030 INFO k.a.j.JMeterPluginsUtils: Loading system properties from: /Users/sulekahelmini/Documents/fyp/apache-jmeter-5.2.1/bin/system.properties
2020-02-18 02:20:40,083 WARN o.a.j.g.ObjectTableModel: Header count=13 but classes count=11
2020-02-18 02:20:40,083 WARN o.a.j.g.ObjectTableModel: Header count=13 but writeFunctor count=11
2020-02-18 02:20:40,210 INFO o.a.j.s.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2
2020-02-18 02:20:40,215 INFO o.a.j.s.SaveService: Using SaveService properties file encoding UTF-8
2020-02-18 02:20:40,217 INFO o.a.j.s.SaveService: Using SaveService properties version 5.0
2020-02-18 02:20:40,224 INFO o.a.j.s.SampleResult: Note: Sample TimeStamps are START times
2020-02-18 02:20:40,224 INFO o.a.j.s.SampleResult: sampleresult.default.encoding is set to ISO-8859-1
2020-02-18 02:20:40,225 INFO o.a.j.s.SampleResult: sampleresult.useNanoTime=true
2020-02-18 02:20:40,225 INFO o.a.j.s.SampleResult: sampleresult.nanoThreadSleep=5000
2020-02-18 02:20:40,226 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2020-02-18 02:20:40,450 INFO k.a.j.v.AggregateReportGui: Saving CSV to /Users/sulekahelmini/Documents/fyp/fyp_work/MLscripts/agg_test.csv
这是我用来 运行 测试并将结果转换为 csv 的代码:
#run test
cd /Users/sulekahelmini/Documents/fyp/apache-jmeter-5.2.1/bin && sh jmeter -n -t /Users/sulekahelmini/Documents/fyp/jmeter_scripts/factorial.jmx -l /Users/sulekahelmini/Documents/fyp/fyp_work/MLscripts/jmeter_results.jtl
#convert result to csv
cd /Users/sulekahelmini/Documents/fyp/apache-jmeter-5.2.1/bin && ./JMeterPluginsCMD.sh --generate-csv /Users/sulekahelmini/Documents/fyp/fyp_work/MLscripts/agg_test.csv --input-jtl /Users/sulekahelmini/Documents/fyp/fyp_work/MLscripts/jmeter_results.jtl --plugin-type AggregateReport
下面显示的是生成的汇总报告(使用 jtl 文件)。请注意,那里有一个错误百分比。
另外,请注意我的 JMeter 不在容器内。我在这里做错了什么?在 GUI 中 运行ning 时,如何不显示错误百分比?
我没看到你从哪里得到 a value for error percentage
因为它似乎是零:
summary = 50 in 00:00:02 = 25.0/s Avg: 50 Min: 4 Max: 323 Err: 0 (0.00%)
如果您在生成的 /Users/sulekahelmini/Documents/fyp/fyp_work/MLscripts/agg_test.csv
中看到错误,则可能是该文件以前存在并且包含 "old" 结果失败。
此外,我认为您正在使用 Aggregate Report 侦听器向该文件写入一些内容,然后使用 JMeter 插件命令行工具将最后的结果附加到同一文件中。
为了获得"clean"和有效结果:
- 删除
/Users/sulekahelmini/Documents/fyp/fyp_work/MLscripts/agg_test.csv
文件
- 删除
/Users/sulekahelmini/Documents/fyp/fyp_work/MLscripts/jmeter_results.jtl
文件
- 从您的测试计划中删除汇总报告侦听器(和所有其他侦听器)作为 listeners don't add any value and only consume resources
- 在终端中重复你的 2 个命令
- 您应该看到
agg_test.csv
文件没有任何错误
我在 docker 容器中有一个小型微服务 运行ning,我试图获取使用 JMeter CLI 的延迟。我使用 JMeter GUI 进行了测试,运行 首先进行了测试。然后错误百分比为 0。但是当我 运行 使用 CLI 进行相同的测试时,我得到了错误百分比的值。我收到以下警告:
Creating summariser <summary>
Created the tree successfully using /Users/sulekahelmini/Documents/fyp/jmeter_scripts/factorial.jmx
Starting standalone test @ Tue Feb 18 02:20:35 IST 2020 (1581972635848)
Waiting for possible Shutdown/StopTestNow/HeapDump/ThreadDump message on port 4445
summary = 50 in 00:00:02 = 25.0/s Avg: 50 Min: 4 Max: 323 Err: 0 (0.00%)
Tidying up ... @ Tue Feb 18 02:20:38 IST 2020 (1581972638095)
... end of run
2020-02-18 02:20:39,012 WARN o.a.j.u.JMeterUtils: Exception 'null' occurred when fetching String property:'sampleresult.default.encoding', defaulting to: ISO-8859-1
2020-02-18 02:20:39,022 WARN o.a.j.u.JMeterUtils: Exception 'null' occurred when fetching String property:'jmeterPlugin.prefixPlugins'
2020-02-18 02:20:39,022 INFO k.a.j.PluginsCMDWorker: Using JMeterPluginsCMD v. N/A
2020-02-18 02:20:39,025 INFO o.a.j.u.JMeterUtils: Setting Locale to en_LK
2020-02-18 02:20:39,030 INFO k.a.j.JMeterPluginsUtils: Loading user properties from: /Users/sulekahelmini/Documents/fyp/apache-jmeter-5.2.1/bin/user.properties
2020-02-18 02:20:39,030 INFO k.a.j.JMeterPluginsUtils: Loading system properties from: /Users/sulekahelmini/Documents/fyp/apache-jmeter-5.2.1/bin/system.properties
2020-02-18 02:20:40,083 WARN o.a.j.g.ObjectTableModel: Header count=13 but classes count=11
2020-02-18 02:20:40,083 WARN o.a.j.g.ObjectTableModel: Header count=13 but writeFunctor count=11
2020-02-18 02:20:40,210 INFO o.a.j.s.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2
2020-02-18 02:20:40,215 INFO o.a.j.s.SaveService: Using SaveService properties file encoding UTF-8
2020-02-18 02:20:40,217 INFO o.a.j.s.SaveService: Using SaveService properties version 5.0
2020-02-18 02:20:40,224 INFO o.a.j.s.SampleResult: Note: Sample TimeStamps are START times
2020-02-18 02:20:40,224 INFO o.a.j.s.SampleResult: sampleresult.default.encoding is set to ISO-8859-1
2020-02-18 02:20:40,225 INFO o.a.j.s.SampleResult: sampleresult.useNanoTime=true
2020-02-18 02:20:40,225 INFO o.a.j.s.SampleResult: sampleresult.nanoThreadSleep=5000
2020-02-18 02:20:40,226 INFO o.a.j.s.SampleEvent: List of sample_variables: []
2020-02-18 02:20:40,450 INFO k.a.j.v.AggregateReportGui: Saving CSV to /Users/sulekahelmini/Documents/fyp/fyp_work/MLscripts/agg_test.csv
这是我用来 运行 测试并将结果转换为 csv 的代码:
#run test
cd /Users/sulekahelmini/Documents/fyp/apache-jmeter-5.2.1/bin && sh jmeter -n -t /Users/sulekahelmini/Documents/fyp/jmeter_scripts/factorial.jmx -l /Users/sulekahelmini/Documents/fyp/fyp_work/MLscripts/jmeter_results.jtl
#convert result to csv
cd /Users/sulekahelmini/Documents/fyp/apache-jmeter-5.2.1/bin && ./JMeterPluginsCMD.sh --generate-csv /Users/sulekahelmini/Documents/fyp/fyp_work/MLscripts/agg_test.csv --input-jtl /Users/sulekahelmini/Documents/fyp/fyp_work/MLscripts/jmeter_results.jtl --plugin-type AggregateReport
下面显示的是生成的汇总报告(使用 jtl 文件)。请注意,那里有一个错误百分比。
另外,请注意我的 JMeter 不在容器内。我在这里做错了什么?在 GUI 中 运行ning 时,如何不显示错误百分比?
我没看到你从哪里得到 a value for error percentage
因为它似乎是零:
summary = 50 in 00:00:02 = 25.0/s Avg: 50 Min: 4 Max: 323 Err: 0 (0.00%)
如果您在生成的 /Users/sulekahelmini/Documents/fyp/fyp_work/MLscripts/agg_test.csv
中看到错误,则可能是该文件以前存在并且包含 "old" 结果失败。
此外,我认为您正在使用 Aggregate Report 侦听器向该文件写入一些内容,然后使用 JMeter 插件命令行工具将最后的结果附加到同一文件中。
为了获得"clean"和有效结果:
- 删除
/Users/sulekahelmini/Documents/fyp/fyp_work/MLscripts/agg_test.csv
文件 - 删除
/Users/sulekahelmini/Documents/fyp/fyp_work/MLscripts/jmeter_results.jtl
文件 - 从您的测试计划中删除汇总报告侦听器(和所有其他侦听器)作为 listeners don't add any value and only consume resources
- 在终端中重复你的 2 个命令
- 您应该看到
agg_test.csv
文件没有任何错误