You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@excalibur.apache.org by le...@apache.org on 2005/11/04 13:00:42 UTC

svn commit: r330799 - /excalibur/trunk/components/pool/instrumented/src/java/org/apache/avalon/excalibur/pool/TraceableResourceLimitingPool.java

Author: leif
Date: Fri Nov  4 04:00:34 2005
New Revision: 330799

URL: http://svn.apache.org/viewcvs?rev=330799&view=rev
Log:
Add the time that a given Poolable was checked out to the status information.

Modified:
    excalibur/trunk/components/pool/instrumented/src/java/org/apache/avalon/excalibur/pool/TraceableResourceLimitingPool.java

Modified: excalibur/trunk/components/pool/instrumented/src/java/org/apache/avalon/excalibur/pool/TraceableResourceLimitingPool.java
URL: http://svn.apache.org/viewcvs/excalibur/trunk/components/pool/instrumented/src/java/org/apache/avalon/excalibur/pool/TraceableResourceLimitingPool.java?rev=330799&r1=330798&r2=330799&view=diff
==============================================================================
--- excalibur/trunk/components/pool/instrumented/src/java/org/apache/avalon/excalibur/pool/TraceableResourceLimitingPool.java (original)
+++ excalibur/trunk/components/pool/instrumented/src/java/org/apache/avalon/excalibur/pool/TraceableResourceLimitingPool.java Fri Nov  4 04:00:34 2005
@@ -199,6 +199,7 @@
                 // Go back and extract the state.
                 Thread[] threads = new Thread[count];
                 TraceException[] traceExceptions = new TraceException[count];
+                long[] traceTimes = new long[count];
                 if ( count > 0 )
                 {
                     int i = 0;
@@ -209,12 +210,13 @@
                         {
                             threads[i] = element.m_thread;
                             traceExceptions[i] = element.m_traceException;
+                            traceTimes[i] = element.m_time;
                             i++;
                         }
                     }
                 }
                 
-                return new State( getSize(), getReadySize(), threads, traceExceptions );
+                return new State( getSize(), getReadySize(), threads, traceExceptions, traceTimes );
             }
         }
         else
@@ -232,13 +234,18 @@
         private int m_readySize;
         private Thread[] m_threads;
         private TraceException[] m_traceExceptions;
+        private long[] m_traceTimes;
         
-        private State( int size, int readySize, Thread[] threads, TraceException[] traceExceptions )
+        private State( int size, int readySize,
+                       Thread[] threads,
+                       TraceException[] traceExceptions,
+                       long[] traceTimes )
         {
             m_size = size;
             m_readySize = readySize;
             m_threads = threads;
             m_traceExceptions = traceExceptions;
+            m_traceTimes = traceTimes;
         }
         
         public int getSize()
@@ -260,6 +267,11 @@
         {
             return m_traceExceptions;
         }
+        
+        public long[] getTraceTimes()
+        {
+            return m_traceTimes;
+        }
     }
     
     private static class PoolElement
@@ -267,6 +279,7 @@
         private Poolable m_poolable;
         private Thread m_thread;
         private TraceException m_traceException;
+        private long m_time;
         
         private PoolElement( Poolable poolable )
         {
@@ -278,6 +291,7 @@
             m_thread = Thread.currentThread();
             m_traceException = new TraceException();
             m_traceException.fillInStackTrace();
+            m_time = System.currentTimeMillis();
         }
         
         private void clear()



---------------------------------------------------------------------
To unsubscribe, e-mail: scm-unsubscribe@excalibur.apache.org
For additional commands, e-mail: scm-help@excalibur.apache.org