jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1493645 - /jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/observation/ListenerTracker.java
Date Mon, 17 Jun 2013 05:21:51 GMT
Author: jukka
Date: Mon Jun 17 05:21:51 2013
New Revision: 1493645

URL: http://svn.apache.org/r1493645
Log:
JCR-3608: MBeans for tracking event listeners

More accurate statistics

Modified:
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/observation/ListenerTracker.java

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/observation/ListenerTracker.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/observation/ListenerTracker.java?rev=1493645&r1=1493644&r2=1493645&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/observation/ListenerTracker.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/observation/ListenerTracker.java
Mon Jun 17 05:21:51 2013
@@ -176,9 +176,8 @@ public class ListenerTracker {
             }
             @Override
             public long getEventDeliveriesPerHour() {
-                long hours = TimeUnit.MILLISECONDS.toHours(
-                        currentTimeMillis() - startTime);
-                return getEventDeliveries() / Math.max(hours, 1);
+                return TimeUnit.HOURS.toMillis(getEventDeliveries())
+                        / Math.max(currentTimeMillis() - startTime, 1);
             }
             @Override
             public long getMicrosecondsPerEventDelivery() {
@@ -191,9 +190,8 @@ public class ListenerTracker {
             }
             @Override
             public long getEventsDeliveredPerHour() {
-                long hours = TimeUnit.MILLISECONDS.toHours(
-                        currentTimeMillis() - startTime);
-                return getEventsDelivered() / Math.max(hours, 1);
+                return TimeUnit.HOURS.toMillis(getEventsDelivered())
+                        / Math.max(currentTimeMillis() - startTime, 1);
             }
             @Override
             public long getMicrosecondsPerEventDelivered() {



Mime
View raw message