You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sf...@apache.org on 2014/09/16 16:04:04 UTC

git commit: move meter to send code

Repository: incubator-usergrid
Updated Branches:
  refs/heads/two-dot-o 0e9c67d27 -> 16848a82b


move meter to send code


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/16848a82
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/16848a82
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/16848a82

Branch: refs/heads/two-dot-o
Commit: 16848a82bf9d489f6b1f856331912ded2b21d440
Parents: 0e9c67d
Author: Shawn Feldman <sf...@apache.org>
Authored: Tue Sep 16 08:03:49 2014 -0600
Committer: Shawn Feldman <sf...@apache.org>
Committed: Tue Sep 16 08:03:49 2014 -0600

----------------------------------------------------------------------
 .../services/notifications/ApplicationQueueManager.java      | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/16848a82/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueManager.java
----------------------------------------------------------------------
diff --git a/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueManager.java b/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueManager.java
index 7fa3422..1033d16 100644
--- a/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueManager.java
+++ b/stack/services/src/main/java/org/apache/usergrid/services/notifications/ApplicationQueueManager.java
@@ -61,14 +61,14 @@ public class ApplicationQueueManager implements QueueManager {
 
 
     //this is for tests, will not mark initial post complete, set to false for tests
-    private final Meter sendMeter;
-    private final Histogram queueSize;
+
     private static ExecutorService INACTIVE_DEVICE_CHECK_POOL = Executors.newFixedThreadPool(5);
     public static final String NOTIFIER_ID_POSTFIX = ".notifier.id";
 
     private final EntityManager em;
     private final org.apache.usergrid.mq.QueueManager qm;
     private final JobScheduler jobScheduler;
+    private final MetricsFactory metricsFactory;
     HashMap<Object, Notifier> notifierHashMap; // only retrieve notifiers once
 
 
@@ -88,8 +88,7 @@ public class ApplicationQueueManager implements QueueManager {
         this.em = entityManager;
         this.qm = queueManager;
         this.jobScheduler = jobScheduler;
-        this.sendMeter = metricsFactory.getMeter(NotificationsService.class, "send");
-        this.queueSize = metricsFactory.getHistogram(NotificationsService.class, "queue_size");
+        this.metricsFactory = metricsFactory;
     }
 
     public static QueueResults getDeliveryBatch(org.apache.usergrid.mq.QueueManager queueManager) throws Exception {
@@ -287,6 +286,7 @@ public class ApplicationQueueManager implements QueueManager {
      */
     public Observable sendBatchToProviders( final List<ApplicationQueueMessage> messages) {
         LOG.info("sending batch of {} notifications.", messages.size());
+        final Meter sendMeter = metricsFactory.getMeter(NotificationsService.class, "send");
 
         final Map<Object, Notifier> notifierMap = getNotifierMap();
         final QueueManager proxy = this;