You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by bgordon <bb...@yahoo.com> on 2006/03/15 20:23:48 UTC

Randomizing Throughput Controller HELP please

Here’s a simplified view of what I want
   
  Aggregate Thread Group
  -Txn A throughput controller 20%
  --txn A HTTP Request
  -Txn B throughput  controller  80%
  --txn B HTTP Request
   
  I want A to be run ~20% of the time, and B to be run ~80%. I don’t want the system to have all threads run A, then all Threads run B- I want them to be random, yet work out to the percentages specified.
   
  What is a good practice for this? I’m unsure if having a parent Random Controller will help (and I’m further confused by the difference between Random Controller and Random Order Controller).
   
  Thanks, Bruce

Re: Randomizing Throughput Controller HELP please

Posted by sebb <se...@gmail.com>.
Functions are shared across threads.

Each occurrence of a function in the test plan is handled by a
separate instance of the function.

S.
On 25/03/06, bgordon <bb...@yahoo.com> wrote:
> If I run many threads, say 20, will the various threads be in lock step? I do want all the threads to use the same random number generator so that the next value is relatively random. I'm concerned that if I have 20 random number generators, and they're all seeded with the current time, they may all have the same seed and generate the same random numbers. Using JMeter's architecture and JavaScript Random() function, will I get 20 instances of the Random() Function (which I don't want)? Or alternatively, how can I indirectly control the seeding by starting each thread with a delay?
>
> Thanks,  Bruce
>
> sebb <se...@gmail.com> wrote: Rather than use the IF controller, the Switch Controller can be
> combined with a suitable variable (N).
>
> Just define the variable to have the values 0,1,2 for the relevant
> percentage of the time.
>
> Basic procedure:
>
> r=random integer, 1-100
> N=0 if   0 < r <= 80
> N=1 if 80 < r
>
> This can be done in a JavaScript or BeanShell function.
>
> On 25/03/06, bgordon  wrote:
> > Thanks Praveen. Does anyone else have advice on the parent of the throughput controllers being a RandomController? -Bruce
> >
> > Praveen Kallakuri
>  wrote: I meant if (rand(0,9) < 8) below.
> >
> > On 3/21/06, Praveen Kallakuri
> >  wrote:
> > >
> > > Not sure if this is the best solution, but you could use an if controller
> > > containing javascript like ... if (rand(0,9) <= 8). Send HTTP Request B only
> > > if this evaluates to true and also set a user defined variable to indicate
> > > that this B has been sent. In the next if controller, send A only if the
> > > variable indicates that B has not been sent.
> > >
> > >
> > > On 3/15/06, bgordon  wrote:
> > > >
> > > > Here's a simplified view of what I want
> > > >
> > > >   Aggregate Thread Group
> > > >   -Txn A throughput controller 20%
> > > >   --txn A HTTP Request
> > > >   -Txn B throughput  controller  80%
> > > >   --txn B HTTP Request
> > > >
> > > >   I want A to be run ~20% of the time, and B to be run ~80%. I don't
> > > > want the system to have all threads run A, then all Threads run B- I want
> > > > them to be random, yet work out to the percentages specified.
> > > >
> > > >   What is a good practice for this? I'm unsure if having a parent Random
> > > > Controller will help (and I'm further confused by the difference between
> > > > Random Controller and Random Order Controller).
> > > >
> > > >   Thanks, Bruce
> > > >
> > > >
> > >
> > >
> > > --
> > >
> > >                                                        k.p.
> > >
> >
> >
> >
> > --
> >
> >                                                        k.p.
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Randomizing Throughput Controller HELP please

Posted by bgordon <bb...@yahoo.com>.
If I run many threads, say 20, will the various threads be in lock step? I do want all the threads to use the same random number generator so that the next value is relatively random. I'm concerned that if I have 20 random number generators, and they're all seeded with the current time, they may all have the same seed and generate the same random numbers. Using JMeter's architecture and JavaScript Random() function, will I get 20 instances of the Random() Function (which I don't want)? Or alternatively, how can I indirectly control the seeding by starting each thread with a delay? 

Thanks,  Bruce

sebb <se...@gmail.com> wrote: Rather than use the IF controller, the Switch Controller can be
combined with a suitable variable (N).

Just define the variable to have the values 0,1,2 for the relevant
percentage of the time.

Basic procedure:

r=random integer, 1-100
N=0 if   0 < r <= 80
N=1 if 80 < r

This can be done in a JavaScript or BeanShell function.

On 25/03/06, bgordon  wrote:
> Thanks Praveen. Does anyone else have advice on the parent of the throughput controllers being a RandomController? -Bruce
>
> Praveen Kallakuri 
 wrote: I meant if (rand(0,9) < 8) below.
>
> On 3/21/06, Praveen Kallakuri
>  wrote:
> >
> > Not sure if this is the best solution, but you could use an if controller
> > containing javascript like ... if (rand(0,9) <= 8). Send HTTP Request B only
> > if this evaluates to true and also set a user defined variable to indicate
> > that this B has been sent. In the next if controller, send A only if the
> > variable indicates that B has not been sent.
> >
> >
> > On 3/15/06, bgordon  wrote:
> > >
> > > Here's a simplified view of what I want
> > >
> > >   Aggregate Thread Group
> > >   -Txn A throughput controller 20%
> > >   --txn A HTTP Request
> > >   -Txn B throughput  controller  80%
> > >   --txn B HTTP Request
> > >
> > >   I want A to be run ~20% of the time, and B to be run ~80%. I don't
> > > want the system to have all threads run A, then all Threads run B- I want
> > > them to be random, yet work out to the percentages specified.
> > >
> > >   What is a good practice for this? I'm unsure if having a parent Random
> > > Controller will help (and I'm further confused by the difference between
> > > Random Controller and Random Order Controller).
> > >
> > >   Thanks, Bruce
> > >
> > >
> >
> >
> > --
> >
> >                                                        k.p.
> >
>
>
>
> --
>
>                                                        k.p.
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org




Re: Randomizing Throughput Controller HELP please

Posted by sebb <se...@gmail.com>.
Rather than use the IF controller, the Switch Controller can be
combined with a suitable variable (N).

Just define the variable to have the values 0,1,2 for the relevant
percentage of the time.

Basic procedure:

r=random integer, 1-100
N=0 if   0 < r <= 80
N=1 if 80 < r

This can be done in a JavaScript or BeanShell function.

On 25/03/06, bgordon <bb...@yahoo.com> wrote:
> Thanks Praveen. Does anyone else have advice on the parent of the throughput controllers being a RandomController? -Bruce
>
> Praveen Kallakuri <pr...@gallup.com> wrote: I meant if (rand(0,9) < 8) below.
>
> On 3/21/06, Praveen Kallakuri
>  wrote:
> >
> > Not sure if this is the best solution, but you could use an if controller
> > containing javascript like ... if (rand(0,9) <= 8). Send HTTP Request B only
> > if this evaluates to true and also set a user defined variable to indicate
> > that this B has been sent. In the next if controller, send A only if the
> > variable indicates that B has not been sent.
> >
> >
> > On 3/15/06, bgordon  wrote:
> > >
> > > Here's a simplified view of what I want
> > >
> > >   Aggregate Thread Group
> > >   -Txn A throughput controller 20%
> > >   --txn A HTTP Request
> > >   -Txn B throughput  controller  80%
> > >   --txn B HTTP Request
> > >
> > >   I want A to be run ~20% of the time, and B to be run ~80%. I don't
> > > want the system to have all threads run A, then all Threads run B- I want
> > > them to be random, yet work out to the percentages specified.
> > >
> > >   What is a good practice for this? I'm unsure if having a parent Random
> > > Controller will help (and I'm further confused by the difference between
> > > Random Controller and Random Order Controller).
> > >
> > >   Thanks, Bruce
> > >
> > >
> >
> >
> > --
> >
> >                                                        k.p.
> >
>
>
>
> --
>
>                                                        k.p.
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Randomizing Throughput Controller HELP please

Posted by bgordon <bb...@yahoo.com>.
Thanks Praveen. Does anyone else have advice on the parent of the throughput controllers being a RandomController? -Bruce 

Praveen Kallakuri <pr...@gallup.com> wrote: I meant if (rand(0,9) < 8) below.

On 3/21/06, Praveen Kallakuri 
 wrote:
>
> Not sure if this is the best solution, but you could use an if controller
> containing javascript like ... if (rand(0,9) <= 8). Send HTTP Request B only
> if this evaluates to true and also set a user defined variable to indicate
> that this B has been sent. In the next if controller, send A only if the
> variable indicates that B has not been sent.
>
>
> On 3/15/06, bgordon  wrote:
> >
> > Here's a simplified view of what I want
> >
> >   Aggregate Thread Group
> >   -Txn A throughput controller 20%
> >   --txn A HTTP Request
> >   -Txn B throughput  controller  80%
> >   --txn B HTTP Request
> >
> >   I want A to be run ~20% of the time, and B to be run ~80%. I don't
> > want the system to have all threads run A, then all Threads run B- I want
> > them to be random, yet work out to the percentages specified.
> >
> >   What is a good practice for this? I'm unsure if having a parent Random
> > Controller will help (and I'm further confused by the difference between
> > Random Controller and Random Order Controller).
> >
> >   Thanks, Bruce
> >
> >
>
>
> --
>
>                                                        k.p.
>



--

                                                       k.p.



Re: Randomizing Throughput Controller HELP please

Posted by Praveen Kallakuri <pr...@gallup.com>.
I meant if (rand(0,9) < 8) below.

On 3/21/06, Praveen Kallakuri <pr...@gallup.com> wrote:
>
> Not sure if this is the best solution, but you could use an if controller
> containing javascript like ... if (rand(0,9) <= 8). Send HTTP Request B only
> if this evaluates to true and also set a user defined variable to indicate
> that this B has been sent. In the next if controller, send A only if the
> variable indicates that B has not been sent.
>
>
> On 3/15/06, bgordon <bb...@yahoo.com> wrote:
> >
> > Here's a simplified view of what I want
> >
> >   Aggregate Thread Group
> >   -Txn A throughput controller 20%
> >   --txn A HTTP Request
> >   -Txn B throughput  controller  80%
> >   --txn B HTTP Request
> >
> >   I want A to be run ~20% of the time, and B to be run ~80%. I don't
> > want the system to have all threads run A, then all Threads run B- I want
> > them to be random, yet work out to the percentages specified.
> >
> >   What is a good practice for this? I'm unsure if having a parent Random
> > Controller will help (and I'm further confused by the difference between
> > Random Controller and Random Order Controller).
> >
> >   Thanks, Bruce
> >
> >
>
>
> --
>
>                                                        k.p.
>



--

                                                       k.p.

Re: Randomizing Throughput Controller HELP please

Posted by Praveen Kallakuri <pr...@gallup.com>.
Not sure if this is the best solution, but you could use an if controller
containing javascript like ... if (rand(0,9) <= 8). Send HTTP Request B only
if this evaluates to true and also set a user defined variable to indicate
that this B has been sent. In the next if controller, send A only if the
variable indicates that B has not been sent.

On 3/15/06, bgordon <bb...@yahoo.com> wrote:
>
> Here's a simplified view of what I want
>
>   Aggregate Thread Group
>   -Txn A throughput controller 20%
>   --txn A HTTP Request
>   -Txn B throughput  controller  80%
>   --txn B HTTP Request
>
>   I want A to be run ~20% of the time, and B to be run ~80%. I don't want
> the system to have all threads run A, then all Threads run B- I want them to
> be random, yet work out to the percentages specified.
>
>   What is a good practice for this? I'm unsure if having a parent Random
> Controller will help (and I'm further confused by the difference between
> Random Controller and Random Order Controller).
>
>   Thanks, Bruce
>
>


--

                                                       k.p.

Re: Randomizing Throughput Controller HELP please

Posted by bgordon <bb...@yahoo.com>.
What is the correct etiquette to get a response on this forum? Did I even ask the question in the correct forum? Was my question to obvious? Please help. Thanks, Bruce

bgordon <bb...@yahoo.com> wrote: Any help with this question? When I ran it with a parent random order controller I didn't seem to get the number of executions I expected. Thanks, Bruce

bgordon  wrote: Here�s a simplified view of what I want
   
  Aggregate Thread Group
  -Txn A throughput controller 20%
  --txn A HTTP Request
  -Txn B throughput  controller  80%
  --txn B HTTP Request
   
  I want A to be run ~20% of the time, and B to be run ~80%. I don�t want the system to have all threads run A, then all Threads run B- I want them to be random, yet work out to the percentages specified.
   
  What is a good practice for this? I�m unsure if having a parent Random Controller will help (and I�m further confused by the difference between Random Controller and Random Order Controller).
   
  Thanks, Bruce



Re: Randomizing Throughput Controller HELP please

Posted by bgordon <bb...@yahoo.com>.
Any help with this question? When I ran it with a parent random order controller I didn't seem to get the number of executions I expected. Thanks, Bruce

bgordon <bb...@yahoo.com> wrote: Here�s a simplified view of what I want
   
  Aggregate Thread Group
  -Txn A throughput controller 20%
  --txn A HTTP Request
  -Txn B throughput  controller  80%
  --txn B HTTP Request
   
  I want A to be run ~20% of the time, and B to be run ~80%. I don�t want the system to have all threads run A, then all Threads run B- I want them to be random, yet work out to the percentages specified.
   
  What is a good practice for this? I�m unsure if having a parent Random Controller will help (and I�m further confused by the difference between Random Controller and Random Order Controller).
   
  Thanks, Bruce