JMeter-如何记录失败响应的完整请求? [英] JMeter - how to log the full request for a failed response?

查看:210
本文介绍了JMeter-如何记录失败响应的完整请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JMeter命令行对我们的网站api进行压力测试.现在,这是我返回的示例结果:

i'm using JMeter command line to stress test our website api. Now, here's a sample result i'm getting back:

Creating summariser <summary>
Created the tree successfully using street_advisor.jmx
Starting the test @ Sat Oct 03 15:22:59 PDT 2009 (1254608579848)
Waiting for possible shutdown message on port 4445
summary +     1 in   0.0s =   37.0/s Avg:    27 Min:    27 Max:    27 Err:     1 (100.00%)
<snip a few more lines>
<then i break it>

所以我遇到了错误.

当前,所有错误都将写入文件.当我检查该文件时,它说它是404.无论如何,我可以准确地看到 JMeter的请求是什么吗?

Currently, all errors are going to a file. When i check that file, it's saying it's a 404. Er.. ok. Is there anyway i can see exactly what the request JMeter tried?

这是我的配置文件的片段...

here's a snippet of my config file...

<ResultCollector guiclass="SimpleDataWriter" testclass="ResultCollector" testname="Error Writer" enabled="true">
          <boolProp name="ResultCollector.error_logging">true</boolProp>
          <objProp>
            <name>saveConfig</name>
            <value class="SampleSaveConfiguration">
              <time>true</time>
              <latency>true</latency>
              <timestamp>false</timestamp>
              <success>true</success>
              <label>true</label>
              <code>true</code>
              <message>true</message>
              <threadName>false</threadName>
              <dataType>true</dataType>
              <encoding>false</encoding>
              <assertions>true</assertions>
              <subresults>true</subresults>
              <responseData>false</responseData>
              <samplerData>false</samplerData>
              <xml>true</xml>
              <fieldNames>false</fieldNames>
              <responseHeaders>true</responseHeaders>
              <requestHeaders>true</requestHeaders>
              <responseDataOnError>false</responseDataOnError>
              <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
              <assertionsResultsToSave>0</assertionsResultsToSave>
              <bytes>true</bytes>
            </value>
          </objProp>
          <stringProp name="filename">./error.jtl</stringProp>
        </ResultCollector>

现在,在有人说检查Web服务器日志文件"之前,我知道我可以做到这一点,是的,我找到了404 ..但我希望看看是否有可能不访问它们..特别是如果它们在另一台服务器上和/或我无法访问它们. 请帮忙!

Now, before someone says 'Check the webserver log files', I know I can do this and yep, I've found the 404 .. but i'm hoping to see if it's possible without accessing them .. especially if they are on another server and/or I can't get access to them. Please help!

推荐答案

查看结果树 组件显示所有样本响应的树,使您可以查看任何样本的请求和响应.

The View Results Tree component shows a tree of all sample responses, allowing you to view both the request and response for any sample.

进行负载测试时(始终处于非GUI模式),请填写文件名"字段,然后选择以仅将响应"保存为错误:

When load testing (Always in NON GUI mode), fill in "Filename" field and select to only save Responses in Error:

正如您在上面看到的,我们单击配置"以选择除CSV字段以外的所有字段.

As you can see above we clicked on Configure to select all fields except CSV ones.

您还可以使用将响应保存到文件中,将整个响应保存到文件中:

这篇关于JMeter-如何记录失败响应的完整请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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