jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r994952 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionState.java
Date Wed, 08 Sep 2010 09:55:30 GMT
Author: jukka
Date: Wed Sep  8 09:55:30 2010
New Revision: 994952

URL: http://svn.apache.org/viewvc?rev=994952&view=rev
Log:
JCR-2741: Improved logging for session operations

Add debug-level timing information for SessionOperations

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionState.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionState.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionState.java?rev=994952&r1=994951&r2=994952&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionState.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/session/SessionState.java
Wed Sep  8 09:55:30 2010
@@ -113,7 +113,17 @@ public class SessionState {
         String previous = MDC.get("jcr.session");
         MDC.put("jcr.session", context.toString());
         try {
-            return internalPerform(operation);
+            if (log.isDebugEnabled()) {
+                long start = System.nanoTime();
+                try {
+                    return internalPerform(operation);
+                } finally {
+                    log.debug("{} performed in {}ns",
+                            operation, System.nanoTime() - start);
+                }
+            } else {
+                return internalPerform(operation);
+            }
         } finally {
             if (previous != null) {
                 MDC.put("jcr.session", previous);



Mime
View raw message