我正在使用JMeter命令行来测试我们的网站api.现在,这是我回来的示例结果:
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>
Run Code Online (Sandbox Code Playgroud)
所以我收到了一个错误.
目前,所有错误都将转到文件中.当我检查那个文件时,它说它是404.呃..好吧.无论如何,我可以确切地看到JMeter的请求是什么?
这是我的配置文件的片段...
<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>
Run Code Online (Sandbox Code Playgroud)
现在,在有人说'检查网络服务器日志文件'之前,我知道我可以做到这一点,是的,我已经找到了404 ..但我希望看看它是否有可能没有访问它们......特别是如果他们在另一台服务器和/或我无法访问它们.请帮忙!
rod*_*oap 68
" 查看结果树"组件显示所有样本响应的树,允许您查看任何样本的请求和响应.
加载测试时(始终处于非GUI模式),填写"文件名"字段并选择仅保存错误中的响应:
如上所示,我们单击"配置"以选择除CSV之外的所有字段.
har*_*dsv 21
我发现这个线程只在采样器出现故障时才搜索记录响应的解决方案,因此接受的解决方案对我不利.我偶尔会在涉及数十万个样本的非常高的负载下出现样本故障,因此树监听器对我来说完全不切实际(它的大小将达到几千兆字节),所以这就是我想出来的(这应该对我有用) OP的情景也是如此):
添加一个[JSR223 Assertion][1](应该在所有其他断言之后)并将下面的代码放入其中:
if (Boolean.valueOf(vars.get("DEBUG"))) {
for (a: SampleResult.getAssertionResults()) {
if (a.isError() || a.isFailure()) {
log.error(Thread.currentThread().getName()+": "+SampleLabel+": Assertion failed for response: " + new String((byte[]) ResponseData));
}
}
}
Run Code Online (Sandbox Code Playgroud)
这将导致整个响应记录到jmeter日志文件,这在我的情况下很好,因为我知道响应非常小,但是对于大响应,可以进行更智能的处理.
| 归档时间: |
|
| 查看次数: |
65035 次 |
| 最近记录: |