jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: percentage distibution of sampler
Date Thu, 15 Dec 2005 23:42:05 GMT
On 15/12/05, Christensen, Alan <alan.christensen@hp.com> wrote:
> Could you use an interleave controller with the appropriate percentage
> of samplers of each type contained within it? Or a random order
> controller?

Yes, or you can use the Switch Controller.

Create the switch value using a Random value, and scale the random
value accordingly. This can be done with a JavaScript or BeanShell
function.

Pseudocode:

rand=random(0-100);
if rand < 5 return 1;
if rand < 20 return 2;
return 0;

User Defined Variable: set VAR as above

Switch Controller ${VAR}:
+ Small message
+ Medium message
+ Large Message

> -----Original Message-----
> From: Brunner Michael [mailto:michael.brunner@winterthur.ch]
> Sent: Thursday, December 15, 2005 5:39 AM
> To: jmeter-user@jakarta.apache.org
> Subject: percentage distibution of sampler
>
> Hi,
> I like to distibute the runs on certain samplers, e.g. in 80% send a
> small message, in 15% a mid message and in 5% a big message.
> I tried to use the "Throughput Controller". At the first test it works
> fine.
> My config is 10 users (threads) with a loop count of 10 (100 runs).
> First problem is, that not every time the disribution is correct, e.g.
> the 5%-case wasn't accessed.
> Second problem is, that sometimes two cases are accessed in one user
> run, e.g the 80% and the 15% case.
>
> Is it the correct way?

No, the Throughput Controller is not suitable.

> And if yes, how can I ensure that per user run only one case is
> accessed?

This is not possible with 10 threads, as 5% of 10 is 0.5.

With 20 threads, you could achieve this by setting the switch variable
according to the thread number (rather than a random number).

S.

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


Mime
View raw message