JMeter 思考时间 [英] JMeter Think Time

查看:29
本文介绍了JMeter 思考时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果此请求与其他请求类似,我深表歉意 - 我是 JMeter 的新手,并搜索了其他相关帖子但找不到任何内容 - 或者我可能只是不理解它们!

Apologies if this request is similar to others - I am new to JMeter and have searched for other relevants posts but couldn't find anything - or maybe I just didn't understand them!

我正在使用基于 Web 的应用程序对系统进行性能测试.前端系统将处理通过 MQ 提交到系统的记录 - 前端允许用户从队列中提取记录,验证一些细节,进行更改并提交更改.

I'm performance testing a system with a web based application. The front end system will be processing records submitted into the system via MQ - the front end allows the user to pick up a record from the queue, validate some detail, make changes and submit the changes.

会有20个用户使用前端来做这个消息的验证、更新和提交.每个用户预计需要 30 秒从队列中挑选一条消息,进行更改并重新提交 - 所以我们预计 1 个用户每小时处理 120 条记录,因此预计 20 个用户每小时处理 2400 条记录

There will be 20 users using the front end to do this message validation, update and submission. Each user is expected to need 30 seconds to pick a message from queue, make changes and resubmit - so we are expecting 1 user to process 120 records/hour, so 20 users will be expected to process 2400 records/hour

从队列中取出记录、更改它并提交更改将通过 3 个单独的网页完成.

The picking up the record off the queue, changing it and submitting the changes will be done via 3 individual web pages.

SO - 跨 3 个页面的思考时间已定义为 24 秒(保留 30 秒限制中的 6 秒用于渲染、服务器响应、数据库调用等)
但是我不知道如何在 JMeter 中指定它.从我的阅读中,我可以看到我可以将 Timer 作为父级添加到采样器中,并且我假设我可以将 Timer 添加为 Recording Controller 的父级?- 但我需要能够指定 24 秒的思考时间分布在这 3 个不同的页面上.

SO - think time across the 3 pages has been defined as 24 seconds (leaving 6 of the 30 second limit for rendering, server responses, db calls etc.)
However I don't know how to specify this within JMeter. From my reading I can see that I can add a Timer in as a parent to a sampler and I assume I can add a Timer in as a parent of the Recording Controller? - but I need to be able to specify that the 24 second think time is spread across those 3 different pages.

我在别处读过一篇文章,建议如果我在将高斯随机计时器添加为测试计划的子项(其他所有内容的父项)后使用代理进行记录,则 http 代理会将思考时间记录为 ${T高斯随机计时器中的变量 - 我试过这个,但这没有用(我也不想依赖这个 - 我希望能够理解并做出改变以正确思考时间而不是依赖 JMETER为我做.)

I read a post elsewhere suggesting that if I record using the proxy after adding the Gaussian Random Timer in as a child of the Test Plan (parent to everything else) then the http proxy will record the think time as a ${T} variable in the Gaussian Random Timer - I tried this and this didn't work (also I don't want to rely on this - I'd like to be able to understand and make changes to think time properly rather than relying on JMETER to do it for me.)

重申 - 20 个用户,1 个用户需要 30 秒完成交易,TT 定义为 24 秒 - 我正在努力使用 Timer,将它放在哪里,以便思考时间分布在相等的采样器中到与用户将浏览的 3 个页面相关联的 GETS.

To reiterate - 20 users, 30 seconds for 1 user to complete a transaction, TT defined as 24 seconds - I am struggling what Timer to use, where to put it so that the think-time is spread across the samplers that equate to the GETS associated with the 3 pages the user will navigate through.

为这篇冗长的帖子道歉 - 我只是想简洁明了.

Apologies for the lengthy post - I just wanted to be clear and concise.

非常感谢,

推荐答案

根据 JMeter Timers 文档

As per JMeter Timers documentation

请注意,定时器在其所在范围内的每个采样器之前被处理;如果同一范围内有多个定时器,则在每个采样器之前处理所有定时器.计时器仅与采样器一起处理.与采样器不在同一范围内的计时器将根本不会被处理.

Note that timers are processed before each sampler in the scope in which they are found; if there are several timers in the same scope, all the timers will be processed before each sampler. Timers are only processed in conjunction with a sampler. A timer which is not in the same scope as a sampler will not be processed at all.

要将计时器应用于单个采样器,请将计时器添加为采样器的子元素.计时器将在执行采样器之前应用.要在采样器之后应用计时器,请将其添加到下一个采样器,或将其添加为 测试操作 采样器.

To apply a timer to a single sampler, add the timer as a child element of the sampler. The timer will be applied before the sampler is executed. To apply a timer after a sampler, either add it to the next sampler, or add it as the child of a Test Action Sampler.

现在关于使用什么计时器"

Now regarding "what timer to use"

有两种情况:

  1. 面向虚拟用户的场景 - 当您尝试模拟 N 个用户一起工作时
  2. 面向目标的场景 - 当您尝试每秒产生 N 次加载时.

在场景 1 的情况下,即使 Constant Timer 也足够了,此外它将提供结果的可重复性.有关将计时器放在哪里的信息,请参阅以上报价

In case of scenario 1 even Constant Timer can be quite enough, besides it will provide repeatability of results. See above quote for information on where to put your timer(s)

在场景 2 的情况下,您需要 Constant Throughput Timer.如果 20 个用户每小时处理 2400 条记录,并且每条记录假设 3 次网页调用,则意味着将在一小时内发出 7200 个请求,这又代表每分钟 120 个请求(这是您应该输入计时器的吞吐量"的内容)" 区域)或每秒 2 个请求.

In case of scenario 2 you'll need Constant Throughput Timer. If 20 users process 2400 records per hour and each record assumes 3 web page calls, it means that 7200 requests will be made in one hour which in its turn stands for 120 requests per minute (this is what you should enter into the timer's "throughput" area) or 2 requests per second.

这篇关于JMeter 思考时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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