Bug 59448

Summary: Allow Constant Throughput Controller to be disabled by specifying negative value
Product: JMeter Reporter: olivernz <jmeter>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: NEW ---    
Severity: enhancement    
Priority: P2    
Version: 2.13   
Target Milestone: ---   
Hardware: All   
OS: All   

Description olivernz 2016-05-10 02:18:42 UTC
In order to be able to programatically (i.e. through a variable) disable a Constant Throughput Timer it should be possible to enter a negative taget throughput, which would switch off the functionality of this element. This is congruent with the behaviour of Loop Count and Duration in the Thread Group.
Comment 1 olivernz 2016-05-10 02:30:03 UTC
I'd add something like this in the file ConstantThroughputTimer.java. Please note though that I am not a Java dev by any interpretation. So might be totally off. And I don't (yet) have a JMeter dev environment so can't do a feature.

   // Calculate the delay based on the mode
   private long calculateDelay() {
      long delay = 0;
      if (throughput < 0.0) {
          return delay;
          break;
      }
Comment 2 Sebb 2016-05-10 09:44:26 UTC
Might make more sense to check for <= 0, as zero results in an extremely high delay. The thread runs once then waits for a very long time. Not sure there is a use case for this behaviour, though of course it would be a chnage.
Comment 3 olivernz 2016-05-12 00:42:03 UTC
Personally I think 0.0  should be left as is. But it does have quite weird effects whn you run the test so there is a reason for actually disabling the timer. So yeah changing the behaviour of 0.0 would be good but would need to be announced as some people might actually be using it.