Re: Throughput Controller:

Dmitri T <[email protected]> Fri, 23 Feb 2024 09:17:42 +0100
Newsgroups gmane.comp.jakarta.jmeter.user
Message-ID <PH7PR12MB7139D368FF57A7AB56E07CA4C0552@PH7PR12MB7139.namprd12.prod.outlook.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:[email protected]
> For additional commands, e-mail:[email protected]
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