jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1648205 - /jmeter/trunk/src/core/org/apache/jmeter/reporters/Summariser.java
Date Sun, 28 Dec 2014 13:59:38 GMT
Author: pmouawad
Date: Sun Dec 28 13:59:38 2014
New Revision: 1648205

URL: http://svn.apache.org/r1648205
Log:
BUG 57346 Summariser : The + (difference) reports show wrong elapsed time and throughput
Impact removal of useless index field in SummariserRunningSample
Add javadocs
Rename some variables to make code clear
Bugzilla Id: 57346

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/reporters/Summariser.java

Modified: jmeter/trunk/src/core/org/apache/jmeter/reporters/Summariser.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/reporters/Summariser.java?rev=1648205&r1=1648204&r2=1648205&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/reporters/Summariser.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/reporters/Summariser.java Sun Dec 28 13:59:38
2014
@@ -146,9 +146,9 @@ public class Summariser extends Abstract
         /** Time of last summary (to prevent double reporting) */
         private long last = 0;
 
-        private final SummariserRunningSample delta = new SummariserRunningSample("DELTA",0);
+        private final SummariserRunningSample delta = new SummariserRunningSample("DELTA");
 
-        private final SummariserRunningSample total = new SummariserRunningSample("TOTAL",0);
+        private final SummariserRunningSample total = new SummariserRunningSample("TOTAL");
 
         /**
          * Add the delta values to the total values and clear the delta
@@ -234,11 +234,13 @@ public class Summariser extends Abstract
     }
 
     /**
-     * @param myTotal
-     * @param string
-     * @return the sunnary information
+     * Formats summariserRunningSample
+     * @param name Summariser name
+     * @param summariserRunningSample {@link SummariserRunningSample}
+     * @param type Type of summariser (difference or total)
+     * @return the summary information
      */
-    private static String format(String name, SummariserRunningSample s, String type) {
+    private static String format(String name, SummariserRunningSample summariserRunningSample,
String type) {
         DecimalFormat dfDouble = new DecimalFormat("#0.0"); // $NON-NLS-1$
         StringBuilder tmp = new StringBuilder(20); // for intermediate use
         StringBuilder sb = new StringBuilder(100); // output line buffer
@@ -246,9 +248,9 @@ public class Summariser extends Abstract
         sb.append(" ");
         sb.append(type);
         sb.append(" ");
-        sb.append(longToSb(tmp, s.getNumSamples(), 6));
+        sb.append(longToSb(tmp, summariserRunningSample.getNumSamples(), 6));
         sb.append(" in ");
-        long elapsed = s.getElapsed();
+        long elapsed = summariserRunningSample.getElapsed();
         long elapsedSec = (elapsed + 500) / 1000; // rounded seconds
         if (elapsedSec > 100       // No point displaying decimals (less than 1% error)
          || (elapsed - elapsedSec * 1000) < 50 // decimal would be zero
@@ -260,20 +262,20 @@ public class Summariser extends Abstract
         }
         sb.append("s = ");
         if (elapsed > 0) {
-            sb.append(doubleToSb(dfDouble, tmp, s.getRate(), 6, 1));
+            sb.append(doubleToSb(dfDouble, tmp, summariserRunningSample.getRate(), 6, 1));
         } else {
             sb.append("******");// Rate is effectively infinite
         }
         sb.append("/s Avg: ");
-        sb.append(longToSb(tmp, s.getAverage(), 5));
+        sb.append(longToSb(tmp, summariserRunningSample.getAverage(), 5));
         sb.append(" Min: ");
-        sb.append(longToSb(tmp, s.getMin(), 5));
+        sb.append(longToSb(tmp, summariserRunningSample.getMin(), 5));
         sb.append(" Max: ");
-        sb.append(longToSb(tmp, s.getMax(), 5));
+        sb.append(longToSb(tmp, summariserRunningSample.getMax(), 5));
         sb.append(" Err: ");
-        sb.append(longToSb(tmp, s.getErrorCount(), 5));
+        sb.append(longToSb(tmp, summariserRunningSample.getErrorCount(), 5));
         sb.append(" (");
-        sb.append(s.getErrorPercentageString());
+        sb.append(summariserRunningSample.getErrorPercentageString());
         sb.append(")");
         if ("+".equals(type)) {
             ThreadCounts tc = JMeterContextService.getThreadCounts();



Mime
View raw message