You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by se...@apache.org on 2010/03/12 00:00:44 UTC

svn commit: r922055 - /jakarta/jmeter/trunk/src/core/org/apache/jmeter/visualizers/SamplingStatCalculator.java

Author: sebb
Date: Thu Mar 11 23:00:43 2010
New Revision: 922055

URL: http://svn.apache.org/viewvc?rev=922055&view=rev
Log:
Simplify (and tweak accuracy) by using new addValue(T val, int count) method

Modified:
    jakarta/jmeter/trunk/src/core/org/apache/jmeter/visualizers/SamplingStatCalculator.java

Modified: jakarta/jmeter/trunk/src/core/org/apache/jmeter/visualizers/SamplingStatCalculator.java
URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/visualizers/SamplingStatCalculator.java?rev=922055&r1=922054&r2=922055&view=diff
==============================================================================
--- jakarta/jmeter/trunk/src/core/org/apache/jmeter/visualizers/SamplingStatCalculator.java (original)
+++ jakarta/jmeter/trunk/src/core/org/apache/jmeter/visualizers/SamplingStatCalculator.java Thu Mar 11 23:00:43 2010
@@ -150,20 +150,8 @@ public class SamplingStatCalculator {
         double throughput;
         boolean rbool;
         synchronized (calculator) {
-            long byteslength = res.getBytes();
-            // if there was more than 1 loop in the sample, we
-            // handle it appropriately
-            if (res.getSampleCount() > 1) {
-                long time = res.getTime() / res.getSampleCount();
-                long resbytes = byteslength / res.getSampleCount();
-                for (int idx = 0; idx < res.getSampleCount(); idx++) {
-                    calculator.addValue(time);
-                    calculator.addBytes(resbytes);
-                }
-            } else {
-                calculator.addValue(res.getTime());
-                calculator.addBytes(byteslength);
-            }
+            calculator.addValue(res.getTime(), res.getSampleCount());
+            calculator.addBytes(res.getBytes());
             setStartTime(res);
             eCount = getCurrentSample().getErrorCount();
             if (!res.isSuccessful()) {



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