【问题标题】:The format of the XML JMeter jtl results file is not correct when running in distributed mode在分布式模式下运行时,XML JMeter jtl 结果文件的格式不正确
【发布时间】:2016-07-12 08:24:09
【问题描述】:

当我使用以下命令在非 GUI 模式下运行 JMeter 性能测试时:/jmeter -n -t TC_001_01.jmx -l result.jtl 会生成以下格式的 XML 文件:

<?xml version="1.0" encoding="UTF-8"?>
<testResults version="1.2">
<sample t="2045" it="3927" lt="0" ts="1468310751311" s="true" lb="Access Home Page Transaction" rc="200" rm="Number of samples in transaction : 1, number of failing samples : 0" tn="Thread Group 1-1" ng="1" na="1">
<httpSample t="2045" it="0" lt="914" ts="1468310755221" s="true" lb="https://www.myserver.es" rc="200" rm="OK" tn="Thread Group 1-1" ng="1" na="1">
<assertionResult>
  <name>Response Assertion</name>
  <failure>false</failure>
  <error>false</error>
</assertionResult>
<httpSample t="914" it="0" lt="914" ts="1468310755221" s="true" lb="https://www.myserver.es/" rc="302" rm="Moved Temporarily" tn="Thread Group 1-1" ng="1" na="1"/>
<httpSample t="1129" it="0" lt="386" ts="1468310756137" s="true" lb="https://www.myserver.es/home" rc="200" rm="OK" tn="Thread Group 1-1" ng="1" na="1"/>
</httpSample>
</sample>
...

当我运行相同的测试时,添加选项 -r:/jmeter -n -t TC_001_01.jmx -l result.jtl -r 以使用主从(分布式)模式启动它,遵循Performance Testing in the Cloud with JMeter & AWS,输出 XML 文件的格式不一样:

<?xml version="1.0" encoding="UTF-8"?>
<testResults version="1.2">
<statSample>
<saveConfig>
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
.........
.........
</saveConfig>
<responseData></responseData>
<responseCode></responseCode>
.........
.........
</statSample>

当 JMeter 在分布式模式下运行时,如何让 JMeter 发出第一种格式的 XML 文件? (我有一个 XSLT 模板来生成 HTML 报告。)

我已经查看了 jmeter.properties 和 user.properties 文件,但没有成功。我正在使用 jmeter 3.0 和 jmeter-plugins-manager-0.8。

【问题讨论】:

  • 据我了解,这是预期的输出。分布式模式和简单模式生成的报告格式预计会有所不同。分布式模式报告为每个 JMeter 从站提供附加信息。类似地,如果您在测试计划中使用多个线程组,那么您还需要更新此变量(对于分布式模式)jmeter.save.saveservice.print_field_names=true
  • 我已经使用我的笔记本电脑作为从属和主控运行了相同的测试,并且我得到了正确的 xml 格式。所以,似乎与我正在使用的 AWS 配置有关,可能与 ssh 隧道、rmi 端口...
  • 您在本地网络中尝试过同样的方法吗?使用两台不同的机器?结果应该是一样的。我曾与 AWS 合作过,从未遇到过任何不同的行为。分布式模式的报告应该相同。不管是在 AWS 还是本地网络上。
  • 在同一个子网中运行时格式相同,在不同子网中运行时格式不同。 1-A)在AWS中启动一个slave,添加到jmeter.properties:server_port=24001 server.rmi.localhostname=127.0.0.1 server.rmi.localport=26001 1-B)启动slave:./jmeter-server -Djava .rmi.server.hostname=127.0.0.1 2.对于master: 2.A) 打开ssh隧道,在jmeter.properties中添加:remote_hosts=127.0.0.1:24001 client.rmi.localport=25000 mode=Statistical 2. B) 运行:export JVM_ARGS="-Djava.rmi.server.hostname=localhost" 运行测试:"jmeter -n -t TC.jmx -r -l output.jtl"

标签: jmeter jmeter-plugins


【解决方案1】:

好的,最后我明白了。我没有使用 mode=Statistical,而是将其设置为 mode:Standard 并解决了我的问题。

谢谢!!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-06
    • 1970-01-01
    • 2021-06-09
    相关资源
    最近更新 更多