JMeter在CLI中提供错误百分比,但在GUI中不提供

问题描述 投票:0回答:1

我在docker容器中运行了一个小型微服务,试图获取使用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文件)。请注意,那里有一个错误百分比。

enter image description here

[另外,请注意,我的JMeter不在容器内。我在这里做错了什么?在GUI中运行时如何获得错误百分比?

java jmeter command-line-interface microservices latency
1个回答
0
投票

我似乎看不到a value for error percentage,因为它似乎是零,所以从哪里得到它:

摘要= 0 in 00:00:02 = 25.0 / s平均:50最小值:4最大值:323 错误:0(0.00%)

如果在生成的/Users/sulekahelmini/Documents/fyp/fyp_work/MLscripts/agg_test.csv中看到错误,则可能是文件先前存在并且包含带有失败的“旧”结果的情况。

[此外,我认为您正在使用Aggregate Report侦听器向该文件中写入内容,稍后使用JMeter插件命令行工具将最后的结果附加到同一文件中。

为了获得“干净的”和有效的结果:

  1. 删除/Users/sulekahelmini/Documents/fyp/fyp_work/MLscripts/agg_test.csv文件
  2. 删除/Users/sulekahelmini/Documents/fyp/fyp_work/MLscripts/jmeter_results.jtl文件
  3. 将测试报告中的聚合报告侦听器(和所有其他侦听器)从listeners don't add any value and only consume resources中删除
  4. 在终端中重复您的2条命令
  5. 您应该看到agg_test.csv文件没有任何错误
最新问题
© www.soinside.com 2019 - 2024. All rights reserved.