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

问题描述

在JMeter中,当我右键单击线程/控制器"时,我有一个选项:Add Think Time to children功能,当我单击它时,会在每个采样器Test Action暂停后出现,其中Uniform Random Timer暂停,随机延迟为100,常数延迟为1000. /p>

我在文档中没有找到任何有关它以及为什么/如何使用它的参考.它是可配置的,如何配置?是否有一种特殊情况,还是应该将其用于最佳实践?

您还可以添加多次思考时间,我不确定是否是故意的(在请求后添加更多延迟)

编辑

可使用jmeter.properties配置:

# Default implementation that create the Timer structure to add to Test Plan
# Implementation of interface org.apache.jmeter.gui.action.thinktime.ThinkTimeCreator
#think_time_creator.impl=org.apache.jmeter.thinktime.DefaultThinkTimeCreator

# Default Timer GUI class added to Test Plan by DefaultThinkTimeCreator
#think_time_creator.default_timer_implementation=org.apache.jmeter.timers.gui.UniformRandomTimerGui

# Default constant pause of Timer 
#think_time_creator.default_constant_pause=1000

# Default range pause of Timer
#think_time_creator.default_range=100
解决方案

此功能旨在简化Think Times的添加,它将它们添加到计划中的方式导致每个采样器之间的暂停,而如果您只是添加一个Timer,它会进行范围划分,从而在范围内的所有采样器之前应用.

它是一个助手,它添加了默认的1秒钟暂停,可以通过调整您提到的属性来配置这些暂停,并记录在文档中:-):

您可以调整:

  • 您要创建的计时器类型
  • 恒定和可变的暂停范围

您甚至可以创建自己的类,以不同的方式工作.

In JMeter when I right click Thread/Controller I have an option: Add Think Time to children feature , when I click on it I get after every Sampler Test Action Pause with Uniform Random Timer with Random Delay 100 and Constant Delay 1000.

I didn't find in documentation any reference to it and why/how it should be used.Is it configurable and how? is there a special case for it or should it be used for loading best practice ?

Also you can add several times think times I'm not sure is it on purpose (add more delays after request)

EDIT

Configurable using jmeter.properties:

# Default implementation that create the Timer structure to add to Test Plan
# Implementation of interface org.apache.jmeter.gui.action.thinktime.ThinkTimeCreator
#think_time_creator.impl=org.apache.jmeter.thinktime.DefaultThinkTimeCreator

# Default Timer GUI class added to Test Plan by DefaultThinkTimeCreator
#think_time_creator.default_timer_implementation=org.apache.jmeter.timers.gui.UniformRandomTimerGui

# Default constant pause of Timer 
#think_time_creator.default_constant_pause=1000

# Default range pause of Timer
#think_time_creator.default_range=100
解决方案

This feature is made to simplify addition of Think Times, the way it adds them to plan lead to pause between every sampler while if you just add a Timer it will be scoped and thus be applied before all samplers in scope.

As it's a helper, it adds default Pause of 1 second that are configurable by tuning the properties you have mentioned and which are documented :-) :

You can adjust:

  • The type of Timers you want to create
  • The constant and variable pause range

You can even create your own class that would work differently.

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

09-22 06:08