在jmeter汇总报告中查询与样本数相关的信息 [英] Query related to No.of samples in summary report of jmeter

查看:621
本文介绍了在jmeter汇总报告中查询与样本数相关的信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

线程数(用户):10 加速时间(以秒为单位):1 循环计数:2

Number of Threads (users): 10 Ramp-up Period (in seconds): 1 Loop Count : 2

结果-我运行测试时显示40个样本,而预期计数为20. 我想问问40个样本背后的原因是什么.

Result - When I ran the test it shows 40 samples rather expected count was 20 . I want to ask what could be the reason behind 40 samples .

线程数(用户):10 加速周期(以秒为单位):1 循环计数:1

Number of Threads (users): 10 Ramp-up Period (in seconds): 1 Loop Count : 1

结果-当我运行测试时,它显示20个样本,而预期计数是10个.

错误-我尝试进行计算,但是我不明白它是如何使用户计数每次翻倍

推荐答案

这只是意味着您的每个线程发送2个请求,而不是预期的1个.如果您使用HTTP请求采样器,那么我敢打赌,您已启用跟随重定向"选项,并将请求发送到使用3xx响应代码回答的资源. 将一些侦听器(如在树/表中查看结果")添加到测试计划中(至少在调试阶段)是一个好主意.确实有助于检查Jmeter确切发送/接收的内容.

It just means that every your thread sends 2 requests instead of 1 expected. If you use HTTP Request sampler, then I can bet that you have "Follow Redirects" option enabled and send requests to resource that answers with 3xx response code. Adding some listeners like View Results in Tree/Table to your Test Plan (on debugging phase at least) would be a good idea. It really helps to check what exactly Jmeter sends/receives.

更新: 使用 301响应代码的响应是建议您的客户端(浏览器,jmeter等)移动到由"Location:"响应头定义的资源.因此,所有流行的浏览器(默认情况下为Jmeter)都会自动转发到该位置.那正是您的加倍"请求.如果确实使用301代码进行响应,则可以执行以下两项操作之一:1.在输入路径的输入下方,禁用Jmeter HTTP请求采样器设置中显示的跟随重定向"复选框:

UPDATE: Response with 301 response code is a recommendation for your client (browser, jmeter, etc) to move to resource defined by "Location: " response header. So, all popular browsers (and Jmeter by default) automatically forward to this location. That's exactly your "doubled" request. If responses with 301 code is really your case, then you can do one of two things: 1. Disable "Follow Redirects" checkbox that displayed in Jmeter HTTP Request sampler settings right under the input where you enter Path:

但是在这种情况下,您将不请求在浏览器中为该URL最初显示的目标页面,因为301响应不包含正文,而仅包含标头.

But in this case you'll request not the destination page that originally displayed for this URL in your browser, because 301 responses don't contain body, only headers.

  1. 不是请求使用301代码回答的原始URL,而是请求最终位置(请检查响应标头并在Location标头中找到值).

第二个选项更好(在我看来),因为它会对您真正期望的对象产生负载.但是,当然,这取决于您的目标.

2nd option is better (by my mind) as it produces a load to an object you really expect. But, of course, it depends on your goals.

这篇关于在jmeter汇总报告中查询与样本数相关的信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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