Index: oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/BackgroundObserver.java =================================================================== --- oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/BackgroundObserver.java (revision 1754365) +++ oak-core/src/main/java/org/apache/jackrabbit/oak/spi/commit/BackgroundObserver.java (working copy) @@ -94,6 +94,7 @@ private static class ContentChange { private final NodeState root; private final CommitInfo info; + private final long created = System.currentTimeMillis(); ContentChange(NodeState root, CommitInfo info) { this.root = root; this.info = info; @@ -129,6 +130,7 @@ ContentChange change = queue.poll(); if (change != null && change != STOP) { observer.contentChanged(change.root, change.info); + removed(queue.size(), change.created); currentTask.onComplete(completionHandler); } } catch (Throwable t) { @@ -187,6 +189,15 @@ protected void added(int queueSize) { } /** + * Called when ever an item has been removed from the queue. + * + * @param queueSize the size of the queue after the item was removed. + * @param created the time in milliseconds when the removed item was put + * into the queue. + */ + protected void removed(int queueSize, long created) { } + + /** * @return The max queue length used for this observer's queue */ public int getMaxQueueLength() { Index: oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java =================================================================== --- oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java (revision 1754365) +++ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ChangeProcessor.java (working copy) @@ -273,6 +273,12 @@ } } } + + @Override + protected void removed(int queueSize, long created) { + maxQueueLength.recordValue(queueSize); + tracker.recordQueueLength(queueSize, created); + } }; } Index: oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ConsolidatedListenerMBeanImpl.java =================================================================== --- oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ConsolidatedListenerMBeanImpl.java (revision 1754365) +++ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/observation/ConsolidatedListenerMBeanImpl.java (working copy) @@ -270,6 +270,8 @@ "delivered/hr", "us/delivered", "ratioOfTimeSpentProcessingEvents", + "eventConsumerTimeRatio", + "queueBacklogMillis", "queueSize", "localEventCount", "externalEventCount", @@ -294,6 +296,8 @@ SimpleType.LONG, SimpleType.LONG, SimpleType.DOUBLE, + SimpleType.DOUBLE, + SimpleType.LONG, SimpleType.INTEGER, SimpleType.INTEGER, SimpleType.INTEGER, @@ -339,6 +343,8 @@ mbeans.eventListenerMBean.getEventsDeliveredPerHour(), mbeans.eventListenerMBean.getMicrosecondsPerEventDelivered(), mbeans.eventListenerMBean.getRatioOfTimeSpentProcessingEvents(), + mbeans.eventListenerMBean.getEventConsumerTimeRatio(), + mbeans.eventListenerMBean.getQueueBacklogMillis(), mbeans.observerMBean.getQueueSize(), mbeans.observerMBean.getLocalEventCount(), mbeans.observerMBean.getExternalEventCount(),