Bug 59448 - Allow Constant Throughput Controller to be disabled by specifying negative value
Summary: Allow Constant Throughput Controller to be disabled by specifying negative value
Status: NEW
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.13
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-10 02:18 UTC by olivernz
Modified: 2016-05-12 00:42 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.