在非GUI模式下运行JMeter时配置结果文件数据

时间:2013-09-18 23:03:26

标签: java jmeter

我目前通过以下方式在非GUI模式下运行JMeter:

"apache-jmeter/bin/jmeter -n -t $testPlan.jmx -l results.jtl"

当测试完成运行时,results.jtl文件包含如下内容:

1379545163610,186,HTTP Request,403,Forbidden,Service 1-30,text,false,239,186

看来它正在使用默认配置来输出什么,但如果我只想看到每行的延迟而不是这个大的csv值怎么办?我知道当你在GUI模式下使用JMeter时,当你添加一个新的监听器,如“查看表中的结果”时,你可以配置应该写入生成的jtl文件的内容,例如响应代码,延迟,线程名称,等

但我只想要延迟数据。如何通过此命令行而不是通过GUI进行配置?

谢谢!

2 个答案:

答案 0 :(得分:13)

在jmeter.properties中查看以下一组属性。

#---------------------------------------------------------------------------
# Results file configuration
#---------------------------------------------------------------------------

# This section helps determine how result data will be saved.
# The commented out values are the defaults.

# legitimate values: xml, csv, db.  Only xml and csv are currently supported.
#jmeter.save.saveservice.output_format=csv

...
...
# Only applies to CSV format files:
jmeter.save.saveservice.print_field_names=true

print_field_names默认为false。将其设置为true以确定哪个列是什么?

timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,bytes,Latency
1379564790444,652,jp@gc - Dummy Sampler,200,OK,Thread Group 1-1,text,true,87,78
1379564791099,1,Debug Sampler,200,OK,Thread Group 1-1,text,true,1175,0

顺便说一句,大值是时代的时间戳,如果你的意思是big value的第一个字段。

答案 1 :(得分:1)

默认情况下,JMeter不会将任何摘要结果保存到文件中。您必须保存为JTL并稍后在摘要侦听器中查看它或使用摘要侦听器运行。我宁愿建议第一个选项,因为第二个选项是JMeter的开销。 此外,我还阅读了一篇文章,了解在非GUI模式下运行时,在控制台上记录的摘要数量很少。请阅读 - http://developer.amd.com/community/blog/using-apache-jmeter-in-non-gui-mode/

相关问题