Re: Simulate Think Time

2022-07-01 Thread Dmitri T
If you're simulating "Think Time" usingJMeter Timers 
 
be aware that they:


1. Obey JMeter Scoping Rules
   
2. Are executed *before* each Sampler
   in
   their Scope

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

 * either use Flow Control Action sampler
   
(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
   
with
   a very simple Groovy code
    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!


Re: Simulate Think Time

2022-07-01 Thread Malachi Mcintosh
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 
Sent: Saturday, July 2, 2022 4:58 AM
To: JMeter Users List 
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

2022-07-01 Thread Tong Sun
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: Need help with User Defined Variables

2022-07-01 Thread Robin D. Wilson
Thank you all. I am following your advice, and it is working for me.

--
Robin D. Wilson
CELL: 512-426-3929
rwils...@gmail.com


On Fri, Jul 1, 2022 at 1:29 AM Dmitri T  wrote:

> As per documentation
> <
> https://jmeter.apache.org/usermanual/component_reference.html#User_Defined_Variables
> >:
>
> Also, the variables are not available for use until after the element
> has been processed, so *you cannot reference variables that are defined
> in the same element*. You can reference variables defined in earlier
> UDVs or on the Test Plan.
>
> and
>
> UDVs are processed in the order they appear in the Plan, *from top to
> bottom*.
>
> so if you want to reference an already defined variable you need to add
> another UDV element below the "initial" one and it should start working.
>
> More information: Using User Defined Variables
> <
> https://guide.blazemeter.com/hc/en-us/articles/207421395-Using-User-Defined-Variables
> >
>
>
> On 6/30/2022 6:58 PM, Robin D. Wilson wrote:
> > I'm trying to setup a test with User Defined Variables.
> >
> > I want to define a variable "ENV" that specifies whether the test will
> run
> > in the 'dev' environment, or not. (Basically, if set it will modify all
> of
> > the 'hosts' I hit with '-dev' on their hostnames.)
> >
> > So I want to setup the following type of variables:
> >
> > ENV = "-dev"
> > HOSTNAME = "myhost${ENV}"
> >
> > Then when the test runs, if "ENV" = "-dev", the HOSTNAME would be
> > "myhost-dev", but if I change "ENV" to "" (null), the HOSTNAME would be
> > "myhost".
> >
> > But the User Defined Variables apparently don't use previously set
> > variables in the config? Because what I am getting for "HOSTNAME" is
> > "myhost${ENV}"...
> >
> > --
> > Robin D. Wilson
> > CELL: 512-426-3929
> > rwils...@gmail.com
> >


Re: Need help with User Defined Variables

2022-07-01 Thread Dmitri T
As per documentation 
:


Also, the variables are not available for use until after the element 
has been processed, so *you cannot reference variables that are defined 
in the same element*. You can reference variables defined in earlier 
UDVs or on the Test Plan.


and

UDVs are processed in the order they appear in the Plan, *from top to 
bottom*.


so if you want to reference an already defined variable you need to add 
another UDV element below the "initial" one and it should start working.


More information: Using User Defined Variables 




On 6/30/2022 6:58 PM, Robin D. Wilson wrote:

I'm trying to setup a test with User Defined Variables.

I want to define a variable "ENV" that specifies whether the test will run
in the 'dev' environment, or not. (Basically, if set it will modify all of
the 'hosts' I hit with '-dev' on their hostnames.)

So I want to setup the following type of variables:

ENV = "-dev"
HOSTNAME = "myhost${ENV}"

Then when the test runs, if "ENV" = "-dev", the HOSTNAME would be
"myhost-dev", but if I change "ENV" to "" (null), the HOSTNAME would be
"myhost".

But the User Defined Variables apparently don't use previously set
variables in the config? Because what I am getting for "HOSTNAME" is
"myhost${ENV}"...

--
Robin D. Wilson
CELL: 512-426-3929
rwils...@gmail.com