You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by fs...@apache.org on 2016/03/19 12:39:22 UTC

svn commit: r1735755 - /jmeter/trunk/src/core/org/apache/jmeter/reporters/Summariser.java

Author: fschumacher
Date: Sat Mar 19 11:39:22 2016
New Revision: 1735755

URL: http://svn.apache.org/viewvc?rev=1735755&view=rev
Log:
Extract writing to log-file into a private method.

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=1735755&r1=1735754&r2=1735755&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/reporters/Summariser.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/reporters/Summariser.java Sat Mar 19 11:39:22 2016
@@ -199,22 +199,12 @@ public class Summariser extends Abstract
         if (reportNow) {
             String str;
             str = format(myName, myDelta, "+");
-            if (TOLOG) {
-                log.info(str);
-            }
-            if (TOOUT) {
-                System.out.println(str);
-            }
+            writeToLog(str);
 
             // Only if we have updated them
             if (myTotal != null && myDelta != null &&myTotal.getNumSamples() != myDelta.getNumSamples()) {
                 str = format(myName, myTotal, "=");
-                if (TOLOG) {
-                    log.info(str);
-                }
-                if (TOOUT) {
-                    System.out.println(str);
-                }
+                writeToLog(str);
             }
         }
     }
@@ -368,21 +358,20 @@ public class Summariser extends Abstract
             // and there has been at least one sample reported previously
             if (total.delta.getNumSamples() > 0 && total.total.getNumSamples() >  0) {
                 str = format(name, total.delta, "+");
-                if (TOLOG) {
-                    log.info(str);
-                }
-                if (TOOUT) {
-                    System.out.println(str);
-                }
+                writeToLog(str);
             }
             total.moveDelta(); // This will update the total endTime
             str = format(name, total.total, "=");
-            if (TOLOG) {
-                log.info(str);
-            }
-            if (TOOUT) {
-                System.out.println(str);
-            }
+            writeToLog(str);
+        }
+    }
+
+    private void writeToLog(String str) {
+        if (TOLOG) {
+            log.info(str);
+        }
+        if (TOOUT) {
+            System.out.println(str);
         }
     }