directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r526134 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/AbstractContextFactory.java
Date Fri, 06 Apr 2007 12:26:26 GMT
Author: elecharny
Date: Fri Apr  6 05:26:25 2007
New Revision: 526134

URL: http://svn.apache.org/viewvc?view=rev&rev=526134
Log:
Added some timing instructions, commented (to use them, one should simply uncomment the //TM
)

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/AbstractContextFactory.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/AbstractContextFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/AbstractContextFactory.java?view=diff&rev=526134&r1=526133&r2=526134
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/AbstractContextFactory.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/AbstractContextFactory.java
Fri Apr  6 05:26:25 2007
@@ -71,6 +71,8 @@
  */
 public abstract class AbstractContextFactory implements InitialContextFactory, DirectoryServiceListener
 {
+    //TM private static long cumul = 0L;
+    //TM private static long count = 0;
     // ------------------------------------------------------------------------
     // Members
     // ------------------------------------------------------------------------
@@ -85,6 +87,7 @@
 
     public final synchronized Context getInitialContext( Hashtable env ) throws NamingException
     {
+        //TM long t0 = System.nanoTime();
         Configuration cfg = Configuration.toConfiguration( env );
         env = ( Hashtable ) env.clone();
         
@@ -135,7 +138,17 @@
             throw new NamingException( "Unknown configuration: " + cfg );
         }
 
-        return service.getJndiContext( principalDn, principal, credential, authentication,
providerUrl );
+        Context context = service.getJndiContext( principalDn, principal, credential, authentication,
providerUrl );
+        //TM long t1 = System.nanoTime();
+        //TM cumul += (t1 - t0)/1000;
+        //TM count++;
+        
+        //TM if ( count % 1000 == 0)
+        //TM {
+        //TM     System.out.println( "getInitialContext cost : " + (cumul/count) );
+        //TM }
+        
+        return context;
     }
 
 



Mime
View raw message