You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by fernando castano <Fe...@Sun.COM> on 2008/03/11 19:30:12 UTC

switch controller with individual probabilities

Hi all,

  I'd need a controller similar to a switch controller, but I need to be 
able to define
the probability for selecting each of the childre controllers in each 
iteration.  for example,
if the switch controller has as children c1, c2 and c3 I'd like to be 
able to:

select c1 80% of the times
select c2 7% of the times
select c3 13% of the times

  what would be the best way to implement this? beanshell?  any examples 
available?

TIA,

fdo

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


Re: switch controller with individual probabilities

Posted by sebb <se...@gmail.com>.
On 11/03/2008, fernando castano <Fe...@sun.com> wrote:
>
> Hi all,
>
>  I'd need a controller similar to a switch controller, but I need to be
> able to define
> the probability for selecting each of the childre controllers in each
> iteration.  for example,
> if the switch controller has as children c1, c2 and c3 I'd like to be
> able to:
>
> select c1 80% of the times
> select c2 7% of the times
> select c3 13% of the times
>
>  what would be the best way to implement this? beanshell?  any examples
> available?

One way is to use the Switch Controller with a variable condition.

The condition value can be generated as a random number which is then
converted to 0,1,2 in the appropriate proportions. This can be done
with Beanshell or Jexl or Javascript functions.

This has been discussed before a few times; check the mail archives.

> TIA,
>
> fdo
>
> ---------------------------------------------------------------------
> 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