You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Jun Zhuang <th...@yahoo.com.INVALID> on 2024/02/22 21:56:25 UTC

Throughput Controller:

Hi,
I am trying to create variable throughput using throughput controller with a variable like this


but it keeps throwing the following exception, just wonder if it's not designed to be used like that? But using variable with a loop controller works without any problem.



Following is how I set the variable:import java.util.Random

int iRand = new Random().nextInt(3);
vars.putObject('sRandomThroughput', (float)iRand);


Thanks,Jun


Re: Throughput Controller:

Posted by Dmitri T <gl...@live.com>.
Jun Zhuang wrote:
> Hi,
>
> I am trying to create variable throughput using throughput controller 
> with a variable like this
>
> Inline image
>
> but it keeps throwing the following exception, just wonder if it's not 
> designed to be used like that? But using variable with a loop 
> controller works without any problem.
>
> Inline image
>
> *
> *
> *Following is how I set the variable:*
> importjava.util.Random
>
> intiRand=newRandom().nextInt(3);
> vars.putObject('sRandomThroughput',(float)iRand);
>
>
>
> Thanks,
> Jun
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:user-unsubscribe@jmeter.apache.org
> For additional commands, e-mail:user-help@jmeter.apache.org
It should be "designed to be used like that", according to JMeter Test 
Elements Execution Order 
<https://jmeter.apache.org/usermanual/test_plan.html#executionorder>:

Logic Controllers and Samplers are processed in the order in which they 
appear in the tree.

So despite the warning in the log it will apply the throughput you 
calculate beforehand

If you want to get rid of the warning you can decrease logging verbosity 
for the Throughput Controller, it can be done by adding the next line to 
log4j2.xml file:

<Logger name="org.apache.jmeter.control.ThroughputController" 
level="info" additivity="false"/>

You might also want to raise an improv



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