无头JMeter-如何在输出文件中打印响应数据 [英] Headless JMeter -How to get printed the response data in the output file

查看:628
本文介绍了无头JMeter-如何在输出文件中打印响应数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在以非GUI模式使用jmeter脚本运行负载测试.

I am running a load test by using a jmeter script in non gui mode.

我使用以下命令以非GUI模式运行JMeter,结果存储在文件Test.jtl中

I use the following command to run the JMeter in non gui mode and result is stored in a file Test.jtl

sh jmeter.sh -n -t ThreadGroup.jmx -l Test.jtl

写入Test.jtl的样本数据如下,在此不打印响应数据.是否可以通过更改jmeter脚本或以上命令来获取打印响应数据的方法?

Sample data written to Test.jtl is as below and there it does not print response data. Is there a way to get printed the response data as well may be by altering jmeter script or above command?

任何帮助将不胜感激.

1453272193899,231,HTTP Request-staging-qqq-customer1,200,OK,Thread Group two 1-6,text,true,466,231
1453272193927,227,HTTP Request-staging-TT2-customer1,503,Service Unavailable,Thread Group two 1-1,text,false,751,227
1453272193963,222,HTTP Request-staging-TT2-customer1,503,Service Unavailable,Thread Group two 1-2,text,false,604,222
1453272194026,238,HTTP Request-staging-TT1-customer1,200,OK,Thread Group two 1-3,text,true,448,238
1453272194131,233,HTTP Request-staging-qqq-customer2,200,OK,Thread Group two 1-6,text,true,466,233

谢谢

推荐答案

默认情况下,JMeter不会将响应数据存储为:

By default JMeter does not store response data as:

  1. 由于磁盘IO高,它增加了执行开销
  2. .jtl文件的大小大大增加了
  3. 无法以默认格式(CSV)存储响应数据,因为响应数据肯定会至少具有一个定界符

您仍然可以将JMeter配置为存储响应数据,但请记住上述限制.为此,请传递以下额外的命令行参数:

You can still configure JMeter to store response data, but keep in mind above constraints. In order to do so pass the following extra command line arguments:

sh jmeter.sh -Jjmeter.save.saveservice.output_format=xml -Jjmeter.save.saveservice.response_data=true -n -t ThreadGroup.jmx -l Test.jtl

另一种选择是将下两行添加到 user.properties 文件(位于JMeter安装的/bin文件夹中)

another option is adding next 2 lines to user.properties file (located in /bin folder of your JMeter installation)

jmeter.save.saveservice.output_format=xml
jmeter.save.saveservice.response_data=true

有关JMeter属性和方式的更多信息,请参见 Apache JMeter属性自定义指南.与他们合作

See Apache JMeter Properties Customization Guide for more information on JMeter properties and ways of working with them

这篇关于无头JMeter-如何在输出文件中打印响应数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆