jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1661016 - in /jmeter/trunk: src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java xdocs/changes.xml
Date Thu, 19 Feb 2015 22:29:04 GMT
Author: pmouawad
Date: Thu Feb 19 22:29:03 2015
New Revision: 1661016

URL: http://svn.apache.org/r1661016
Log:
Bug 57607 - Constant Throughput Timer : Wrong throughput computed in shared modes due to rounding
error 
Bugzilla Id: 57607

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java?rev=1661016&r1=1661015&r2=1661016&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/timers/ConstantThroughputTimer.java Thu
Feb 19 22:29:03 2015
@@ -31,8 +31,8 @@ import org.apache.jmeter.testelement.Abs
 import org.apache.jmeter.testelement.TestStateListener;
 import org.apache.jmeter.testelement.property.JMeterProperty;
 import org.apache.jmeter.testelement.property.StringProperty;
-import org.apache.jmeter.threads.JMeterContextService;
 import org.apache.jmeter.threads.AbstractThreadGroup;
+import org.apache.jmeter.threads.JMeterContextService;
 import org.apache.jmeter.util.JMeterUtils;
 import org.apache.jorphan.logging.LoggingManager;
 import org.apache.log.Logger;
@@ -177,15 +177,15 @@ public class ConstantThroughputTimer ext
         double msPerRequest = (MILLISEC_PER_MIN / getThroughput());
         switch (mode) {
         case AllActiveThreads: // Total number of threads
-            delay = (long) (JMeterContextService.getNumberOfThreads() * msPerRequest);
+            delay = Math.round(JMeterContextService.getNumberOfThreads() * msPerRequest);
             break;
 
         case AllActiveThreadsInCurrentThreadGroup: // Active threads in this group
-            delay = (long) (JMeterContextService.getContext().getThreadGroup().getNumberOfThreads()
* msPerRequest);
+            delay = Math.round(JMeterContextService.getContext().getThreadGroup().getNumberOfThreads()
* msPerRequest);
             break;
 
         case AllActiveThreads_Shared: // All threads - alternate calculation
-            delay = calculateSharedDelay(allThreadsInfo,(long) msPerRequest);
+            delay = calculateSharedDelay(allThreadsInfo,Math.round(msPerRequest));
             break;
 
         case AllActiveThreadsInCurrentThreadGroup_Shared: //All threads in this group - alternate
calculation
@@ -199,12 +199,12 @@ public class ConstantThroughputTimer ext
                     groupInfo = previous; // so use the existing one
                 }
             }
-            delay = calculateSharedDelay(groupInfo,(long) msPerRequest);
+            delay = calculateSharedDelay(groupInfo,Math.round(msPerRequest));
             break;
 
         case ThisThreadOnly:
         default: // e.g. 0
-            delay = (long) msPerRequest; // i.e. * 1
+            delay = Math.round(msPerRequest); // i.e. * 1
             break;
         }
         return delay;

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1661016&r1=1661015&r2=1661016&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Thu Feb 19 22:29:03 2015
@@ -168,6 +168,7 @@ See  <bugzilla>56357</bugzilla> for deta
 
 <h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>
 <ul>
+<li><bug>57607</bug>Constant Throughput Timer : Wrong throughput computed
in shared modes due to rounding error </li>
 </ul>
 
 <h3>Functions</h3>
@@ -268,7 +269,8 @@ See  <bugzilla>56357</bugzilla> for deta
 We also thank bug reporters who helped us improve JMeter. <br/>
 For this release we want to give special thanks to the following reporters for the clear
reports and tests made after our fixes:
 <ul>
-<li>Chaitanya Bhatt (bhatt.chaitanya@gmail.com) for his thorough testing of new BackendListener
and Graphite Client implementation.</li>
+<li>Chaitanya Bhatt (bhatt.chaitanya at gmail.com) for his thorough testing of new
BackendListener and Graphite Client implementation.</li>
+<li>Marcelo Jara (marcelojara at hotmail.com) for his clear report on <bugzilla>57607</bugzilla>.</li>
 </ul>
 
 Apologies if we have omitted anyone else.



Mime
View raw message