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

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

问题描述

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

创建摘要器 使用 street_advisor.jmx 成功创建树开始测试 @ 周六 10 月 3 日 15:22:59 PDT 2009 (1254608579848)等待端口 4445 上可能的关闭消息摘要 + 1 in 0.0s = 37.0/s 平均:27 分钟:27 最大:27 错误:1 (100.00%)<多剪几行><然后我打破它>

所以我收到了一个错误.

目前,所有错误都将写入文件.当我检查该文件时,它说它是 404.呃……好吧.无论如何,我是否可以确切地看到 JMeter 尝试过的请求?

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

<boolProp name="ResultCollector.error_logging">true</boolProp><objProp><name>saveConfig</name><value class="SampleSaveConfiguration"><time>真</time><延迟>真</延迟><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>真</xml><fieldNames>false</fieldNames><responseHeaders>true</responseHeaders><requestHeaders>true</requestHeaders><responseDataOnError>false</responseDataOnError><saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage><assertionsResultsToSave>0</assertionsResultsToSave><bytes>true</bytes></objProp><stringProp name="文件名">./error.jtl</stringProp></ResultCollector>

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

解决方案

如上所示,我们单击配置"以选择除 CSV 字段之外的所有字段.

您还可以使用

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>

So i'm getting an error.

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>

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.

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

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

You can also save the entire response to a file using Save Responses to a file:

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

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