You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Tong Sun <su...@gmail.com> on 2022/07/01 16:58:39 UTC

Re: Simulate Think Time

Hi,

Found a problem applying simulated Think Time --


   - I don't want the simulated Think Time be calculated/included in my
   response time
   - So I put it after my request, not under it
   - However, I put only one such Think Time but *every *single request is
   now delayed, because it is actually *at the thread group level*.
   - That in turn caused a bigger problem for me, as I only want Think Time
   delay *after *each of my *transactions*, but not the requests
*within  *those
   transactions.
   - I.e., if a single click of "submit" contains several requests, I want
   those requests executed without any delay, but only do Think Time after
   all those requests are done.

How to achieve all of the above please?


On Sun, Jun 5, 2022 at 12:15 PM Deepak Goel wrote:

> *Uniform Random Timer*
>
> Deepak...
>
> On Sun, Jun 5, 2022 at 8:25 PM Tong Sun wrote:
>
> > What's the best way to simulate Think Time?
> >
> > Say I need a random wait time between 2~8 seconds between each of my
> > transactions, what's the best control to do that?
> >
> > Thanks!
> >
>

Re: Simulate Think Time

Posted by Malachi Mcintosh <mm...@planittesting.com.INVALID>.
Hi Tong,

"
However, I put only one such Think Time but *every *single request is
   now delayed, because it is actually *at the thread group level*.
"

What element(s) are you using to simulate Think Time? You can not just use Timer elements on their own.

"
   - I.e., if a]] single click of "submit" contains several requests, I want
   those requests executed without any delay, but only do Think Time after
   all those requests are done.
"

All of those requests should be in a Transaction Controller, and then after that there should be a Flow Control Action (https://jmeter.apache.org/usermanual/component_reference.html#Flow_Control_Action) with a Timer (e.g. https://jmeter.apache.org/usermanual/component_reference.html#Uniform_Random_Timer) element inside. You can right click the Thread Group or a Controller and select "Add think time to children" to generate this for you. Then duplicate/move the Flow Control Action(s) to where they need to go (i.e. outside of/before/after the transaction controller). Ensure you've provided correct values for Random Delay Maximum and Constant Delay Offset

Thanks,
Malachi

________________________________
From: Tong Sun <su...@gmail.com>
Sent: Saturday, July 2, 2022 4:58 AM
To: JMeter Users List <us...@jmeter.apache.org>
Subject: Re: Simulate Think Time

Hi,

Found a problem applying simulated Think Time --


   - I don't want the simulated Think Time be calculated/included in my
   response time
   - So I put it after my request, not under it
   - However, I put only one such Think Time but *every *single request is
   now delayed, because it is actually *at the thread group level*.
   - That in turn caused a bigger problem for me, as I only want Think Time
   delay *after *each of my *transactions*, but not the requests
*within  *those
   transactions.
   - I.e., if a single click of "submit" contains several requests, I want
   those requests executed without any delay, but only do Think Time after
   all those requests are done.

How to achieve all of the above please?


On Sun, Jun 5, 2022 at 12:15 PM Deepak Goel wrote:

> *Uniform Random Timer*
>
> Deepak...
>
> On Sun, Jun 5, 2022 at 8:25 PM Tong Sun wrote:
>
> > What's the best way to simulate Think Time?
> >
> > Say I need a random wait time between 2~8 seconds between each of my
> > transactions, what's the best control to do that?
> >
> > Thanks!
> >
>

Re: Simulate Think Time

Posted by Dmitri T <gl...@live.com>.
If you're simulating "Think Time" usingJMeter Timers 
<https://jmeter.apache.org/usermanual/component_reference.html#timers> 
be aware that they:

 1. Obey JMeter Scoping Rules
    <https://jmeter.apache.org/usermanual/test_plan.html#scoping_rules>
 2. Are executed *before* each Sampler
    <https://jmeter.apache.org/usermanual/component_reference.html#samplers>in
    their Scope

If you want to introduce the delay **after** the Sampler you will need to:

  * either use Flow Control Action sampler
    <https://jmeter.apache.org/usermanual/component_reference.html#Flow_Control_Action>(you
    will need to copy and paste it after each Sampler where you want to
    add "think time")
  * or go for something like JSR223 PostProcessor
    <https://jmeter.apache.org/usermanual/component_reference.html#JSR223_PostProcessor>with
    a very simple Groovy code
    <https://www.blazemeter.com/blog/apache-groovy> like sleep(1000),
    like Timers this guy obeys JMeter scoping rules and the
    PostProcessor will be executed after each Sampler in its scope so
    single PostProcessor will be sufficient to add a delay after each
    Sampler


On 7/1/2022 6:58 PM, Tong Sun wrote:
> Hi,
>
> Found a problem applying simulated Think Time --
>
>
>     - I don't want the simulated Think Time be calculated/included in my
>     response time
>     - So I put it after my request, not under it
>     - However, I put only one such Think Time but *every *single request is
>     now delayed, because it is actually *at the thread group level*.
>     - That in turn caused a bigger problem for me, as I only want Think Time
>     delay *after *each of my *transactions*, but not the requests
> *within  *those
>     transactions.
>     - I.e., if a single click of "submit" contains several requests, I want
>     those requests executed without any delay, but only do Think Time after
>     all those requests are done.
>
> How to achieve all of the above please?
>
>
> On Sun, Jun 5, 2022 at 12:15 PM Deepak Goel wrote:
>
>> *Uniform Random Timer*
>>
>> Deepak...
>>
>> On Sun, Jun 5, 2022 at 8:25 PM Tong Sun wrote:
>>
>>> What's the best way to simulate Think Time?
>>>
>>> Say I need a random wait time between 2~8 seconds between each of my
>>> transactions, what's the best control to do that?
>>>
>>> Thanks!
>>>