jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r880804 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventConsumer.java
Date Mon, 16 Nov 2009 15:42:12 GMT
Author: mreutegg
Date: Mon Nov 16 15:42:12 2009
New Revision: 880804

URL: http://svn.apache.org/viewvc?rev=880804&view=rev
Log:
JCR-2394: Add timing information to event delivery

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventConsumer.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventConsumer.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventConsumer.java?rev=880804&r1=880803&r2=880804&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventConsumer.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventConsumer.java
Mon Nov 16 15:42:12 2009
@@ -16,8 +16,21 @@
  */
 package org.apache.jackrabbit.core.observation;
 
-import org.apache.jackrabbit.core.id.ItemId;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.WeakHashMap;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.observation.Event;
+import javax.jcr.observation.EventIterator;
+import javax.jcr.observation.EventListener;
+
 import org.apache.jackrabbit.core.SessionImpl;
+import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.state.ItemState;
 import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.PathFactory;
@@ -25,18 +38,6 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-import javax.jcr.observation.Event;
-import javax.jcr.observation.EventIterator;
-import javax.jcr.observation.EventListener;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.WeakHashMap;
-
 /**
  * The <code>EventConsumer</code> class combines the {@link
  * javax.jcr.observation.EventListener} with the implementation of specified
@@ -241,7 +242,13 @@
         EventIterator it = new FilteredEventIterator(events.iterator(),
                 events.getTimestamp(), events.getUserData(), filter, denied);
         if (it.hasNext()) {
+            long time = System.currentTimeMillis();
             listener.onEvent(it);
+            time = System.currentTimeMillis() - time;
+            if (log.isDebugEnabled()) {
+                log.debug("listener {} processed events in {} ms.",
+                        listener.getClass().getName(), time);
+            }
         } else {
             // otherwise skip this listener
         }



Mime
View raw message