avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/src/test/org/apache/avalon/excalibur/pool/test PoolProfile.java
Date Mon, 04 Feb 2002 03:02:42 GMT
leif        02/02/03 19:02:42

  Modified:    src/test/org/apache/avalon/excalibur/pool/test
                        PoolProfile.java
  Log:
  Add a second logger object so that the test can be debugged more
  easily.
  
  Revision  Changes    Path
  1.14      +18 -13    jakarta-avalon-excalibur/src/test/org/apache/avalon/excalibur/pool/test/PoolProfile.java
  
  Index: PoolProfile.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/test/org/apache/avalon/excalibur/pool/test/PoolProfile.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- PoolProfile.java	11 Dec 2001 09:53:39 -0000	1.13
  +++ PoolProfile.java	4 Feb 2002 03:02:42 -0000	1.14
  @@ -22,13 +22,18 @@
   public final class PoolProfile
       extends TestCase
   {
  -    org.apache.log.Logger logger = org.apache.log.Hierarchy.getDefaultHierarchy().getLoggerFor("test");
  +    org.apache.log.Logger logger     = org.apache.log.Hierarchy.getDefaultHierarchy().getLoggerFor("test");
  +    org.apache.log.Logger poolLogger = org.apache.log.Hierarchy.getDefaultHierarchy().getLoggerFor("pool");
   
       public PoolProfile(String name)
       {
           super(name);
   
  +        // Set to debug to see more useful information.
           logger.setPriority(org.apache.log.Priority.INFO);
  +        
  +        // The output from the pools is too much data to be useful, so use a different
logger.
  +        poolLogger.setPriority(org.apache.log.Priority.INFO);
       }
   
       public static class A
  @@ -661,7 +666,7 @@
           logger.info("SMALL Sized Objects with thread safe pools");
   
           final DefaultPool pool1 = new DefaultPool( A.class, 5, 10 );
  -        pool1.setLogger(logger);
  +        pool1.setLogger(poolLogger);
           final long pool1Start = System.currentTimeMillis();
           final int pool1Factor = 1;
           final int pool1Loops = TEST_SIZE / pool1Factor;
  @@ -681,7 +686,7 @@
           if (logger.isDebugEnabled()) logger.debug("FreeMem post 1: " + Runtime.getRuntime().freeMemory()
);
   
           final DefaultPool pool2 = new DefaultPool( A.class, 5, 10 );
  -        pool2.setLogger(logger);
  +        pool2.setLogger(poolLogger);
           final long pool2Start = System.currentTimeMillis();
           final int pool2Factor = 10;
           final int pool2Loops = TEST_SIZE / pool2Factor;
  @@ -719,7 +724,7 @@
           if (logger.isDebugEnabled()) logger.debug("FreeMem post 2: " + Runtime.getRuntime().freeMemory()
);
   
           final DefaultPool pool3 = new DefaultPool( A.class, 5, 10 );
  -        pool3.setLogger(logger);
  +        pool3.setLogger(poolLogger);
           final long pool3Start = System.currentTimeMillis();
           final int pool3Factor = 15;
           final int pool3Loops = TEST_SIZE / pool3Factor;
  @@ -767,7 +772,7 @@
           if (logger.isDebugEnabled()) logger.debug("FreeMem post 3: " + Runtime.getRuntime().freeMemory()
);
   
           final DefaultPool pool4 = new DefaultPool( A.class, 5, 10 );
  -        pool4.setLogger(logger);
  +        pool4.setLogger(poolLogger);
           final long pool4Start = System.currentTimeMillis();
           final int pool4Factor = 20;
           final int pool4Loops = TEST_SIZE / pool4Factor;
  @@ -859,7 +864,7 @@
           Thread.currentThread().sleep(2);
   
           final DefaultPool pool1 = new DefaultPool( B.class, 5, 10 );
  -        pool1.setLogger(logger);
  +        pool1.setLogger(poolLogger);
           final long pool1Start = System.currentTimeMillis();
           final int pool1Factor = 1;
           final int pool1Loops = TEST_SIZE / pool1Factor;
  @@ -879,7 +884,7 @@
           if (logger.isDebugEnabled()) logger.debug("FreeMem post 1: " + Runtime.getRuntime().freeMemory()
);
   
           final DefaultPool pool2 = new DefaultPool( B.class, 5, 10 );
  -        pool2.setLogger(logger);
  +        pool2.setLogger(poolLogger);
           final long pool2Start = System.currentTimeMillis();
           final int pool2Factor = 10;
           final int pool2Loops = TEST_SIZE / pool2Factor;
  @@ -929,7 +934,7 @@
           if (logger.isDebugEnabled()) logger.debug("FreeMem post 2: " + Runtime.getRuntime().freeMemory()
);
   
           final DefaultPool pool3 = new DefaultPool( B.class, 5, 10 );
  -        pool3.setLogger(logger);
  +        pool3.setLogger(poolLogger);
           final long pool3Start = System.currentTimeMillis();
           final int pool3Factor = 15;
           final int pool3Loops = TEST_SIZE / pool3Factor;
  @@ -994,7 +999,7 @@
           if (logger.isDebugEnabled()) logger.debug("FreeMem post 3: " + Runtime.getRuntime().freeMemory()
);
   
           final DefaultPool pool4 = new DefaultPool( B.class, 5, 10 );
  -        pool4.setLogger(logger);
  +        pool4.setLogger(poolLogger);
           final long pool4Start = System.currentTimeMillis();
           final int pool4Factor = 20;
           final int pool4Loops = TEST_SIZE / pool4Factor;
  @@ -1106,7 +1111,7 @@
           Thread.currentThread().sleep(2);
   
           final DefaultPool pool1 = new DefaultPool( C.class, 5, 10 );
  -        pool1.setLogger(logger);
  +        pool1.setLogger(poolLogger);
           final long pool1Start = System.currentTimeMillis();
           final int pool1Factor = 1;
           final int pool1Loops = TEST_SIZE / pool1Factor;
  @@ -1127,7 +1132,7 @@
           if (logger.isDebugEnabled()) logger.debug("FreeMem post 1: " + Runtime.getRuntime().freeMemory()
);
   
           final DefaultPool pool2 = new DefaultPool( C.class, 5, 10 );
  -        pool2.setLogger(logger);
  +        pool2.setLogger(poolLogger);
           final long pool2Start = System.currentTimeMillis();
           final int pool2Factor = 10;
           final int pool2Loops = TEST_SIZE / pool2Factor;
  @@ -1177,7 +1182,7 @@
           if (logger.isDebugEnabled()) logger.debug("FreeMem post 2: " + Runtime.getRuntime().freeMemory()
);
   
           final DefaultPool pool3 = new DefaultPool( C.class, 5, 10 );
  -        pool3.setLogger(logger);
  +        pool3.setLogger(poolLogger);
           final long pool3Start = System.currentTimeMillis();
           final int pool3Factor = 15;
           final int pool3Loops = TEST_SIZE / pool3Factor;
  @@ -1242,7 +1247,7 @@
           if (logger.isDebugEnabled()) logger.debug("FreeMem post 3: " + Runtime.getRuntime().freeMemory()
);
   
           final DefaultPool pool4 = new DefaultPool( C.class, 5, 10 );
  -        pool4.setLogger(logger);
  +        pool4.setLogger(poolLogger);
           final long pool4Start = System.currentTimeMillis();
           final int pool4Factor = 20;
           final int pool4Loops = TEST_SIZE / pool4Factor;
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message