sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1481751 - /sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java
Date Mon, 13 May 2013 09:33:46 GMT
Author: cziegeler
Date: Mon May 13 09:33:45 2013
New Revision: 1481751

URL: http://svn.apache.org/r1481751
Log:
Don't cache statistics

Modified:
    sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java

Modified: sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java?rev=1481751&r1=1481750&r2=1481751&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java
(original)
+++ sling/trunk/bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java
Mon May 13 09:33:45 2013
@@ -149,9 +149,6 @@ public class JobManagerImpl
     /** Current statistics. */
     private final StatisticsImpl baseStatistics = new StatisticsImpl();
 
-    /** Last update for current statistics. */
-    private long lastUpdatedStatistics;
-
     /** Statistics per topic. */
     private final ConcurrentMap<String, TopicStatistics> topicStatistics = new ConcurrentHashMap<String,
TopicStatistics>();
 
@@ -406,7 +403,6 @@ public class JobManagerImpl
             jq.reset();
         }
         this.topicStatistics.clear();
-        this.lastUpdatedStatistics = 0;
     }
 
     /**
@@ -597,19 +593,16 @@ public class JobManagerImpl
 
     /**
      * Return our internal statistics object.
-     * We recalculate this every 1.5sec (if requested)
      *
      * @see org.apache.sling.event.jobs.JobManager#getStatistics()
      */
     @Override
     public synchronized Statistics getStatistics() {
-        final long now = System.currentTimeMillis();
-        if ( this.lastUpdatedStatistics + 1500 < now ) {
-            this.copyFrom(this.baseStatistics);
-            for(final AbstractJobQueue jq : this.queues.values() ) {
-                this.add(jq);
-            }
+        this.copyFrom(this.baseStatistics);
+        for(final AbstractJobQueue jq : this.queues.values() ) {
+            this.add(jq);
         }
+
         return this;
     }
 



Mime
View raw message