[logback-dev] svn commit: r1863 - logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic

noreply.ceki at qos.ch noreply.ceki at qos.ch
Thu Oct 23 11:51:11 CEST 2008


Author: ceki
Date: Thu Oct 23 11:51:11 2008
New Revision: 1863

Modified:
   logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/LoggerPerfTest.java

Log:
tyring to determine the cause test failures on Unix

Modified: logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/LoggerPerfTest.java
==============================================================================
--- logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/LoggerPerfTest.java	(original)
+++ logback/trunk/logback-classic/src/test/java/ch/qos/logback/classic/LoggerPerfTest.java	Thu Oct 23 11:51:11 2008
@@ -19,12 +19,13 @@
 import ch.qos.logback.classic.turbo.NOPTurboFilter;
 import ch.qos.logback.core.UnsynchronizedAppenderBase;
 import ch.qos.logback.core.appender.NOPAppender;
+import ch.qos.logback.core.util.StatusPrinter;
 
 public class LoggerPerfTest {
 
   long NANOS_IN_ONE_SEC = 1000*1000*1000L;
   static long NORMAL_RUN_LENGTH = 1000 * 1000;
-  static long SHORTENED_RUN_LENGTH = 500 * 1000;
+  static long SHORTENED_RUN_LENGTH = 1000 * 1000;
   static long REFERENCE_BIPS = 9324;
 
   @Before
@@ -79,15 +80,15 @@
   }
 
   @Test
-  public void testDurationOfEnabledWithStraightStringParameter() {
-    computeDurationOfEnabledLogWithStraightStringParameter(SHORTENED_RUN_LENGTH);
-    double avgDuration = computeDurationOfEnabledLogWithStraightStringParameter(SHORTENED_RUN_LENGTH);
+  public void testDurationOfEnabledLog() {
+    computeDurationOfEnabledLog(SHORTENED_RUN_LENGTH);
+    double avgDuration = computeDurationOfEnabledLog(SHORTENED_RUN_LENGTH);
     long referencePerf = 500;
-    BogoPerf.assertDuration(avgDuration, referencePerf, REFERENCE_BIPS);
     System.out.println("avgDuration="+avgDuration);
+    BogoPerf.assertDuration(avgDuration, referencePerf, REFERENCE_BIPS);
   }
   
-  double computeDurationOfEnabledLogWithStraightStringParameter(long len) {
+  double computeDurationOfEnabledLog(long len) {
     LoggerContext lc = new LoggerContext();
     Logger logger = lc.getLogger(this.getClass());
     logger.setLevel(Level.ALL);
@@ -102,6 +103,8 @@
       logger.debug("Toto");
     }
     long end = System.nanoTime();
+    StatusPrinter.print(lc);
+    
     return (end - start) / len;
   }
 


More information about the logback-dev mailing list