activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cshan...@apache.org
Subject [1/2] activemq git commit: Revert "AMQ-6947 - Update Queue metrics on expiration"
Date Wed, 18 Apr 2018 16:34:48 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 6e468b454 -> 1d2226e6c


Revert "AMQ-6947 - Update Queue metrics on expiration"

This reverts commit 6e468b4540754cad5cd30de373cadc026c998669.


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/7123534e
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/7123534e
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/7123534e

Branch: refs/heads/master
Commit: 7123534e1b1c82f5358f5a12f7498c0562696c92
Parents: 6e468b4
Author: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Authored: Wed Apr 18 12:34:07 2018 -0400
Committer: Christopher L. Shannon (cshannon) <christopher.l.shannon@gmail.com>
Committed: Wed Apr 18 12:34:07 2018 -0400

----------------------------------------------------------------------
 .../java/org/apache/activemq/broker/region/Queue.java  | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/7123534e/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
index 4aa8f7b..64f1da2 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/Queue.java
@@ -1872,7 +1872,8 @@ public class Queue extends BaseDestination implements Task, UsageListener,
Index
             pagedInMessagesLock.writeLock().lock();
             try {
                 if (pagedInMessages.remove(reference) != null) {
-                    updateMetricsOnMessageDrop();
+                    getDestinationStatistics().getDequeues().increment();
+                    getDestinationStatistics().getMessages().decrement();
                 }
             } finally {
                 pagedInMessagesLock.writeLock().unlock();
@@ -1880,11 +1881,6 @@ public class Queue extends BaseDestination implements Task, UsageListener,
Index
         }
     }
 
-    private void updateMetricsOnMessageDrop() {
-        getDestinationStatistics().getDequeues().increment();
-        getDestinationStatistics().getMessages().decrement();
-    }
-
     public void messageExpired(ConnectionContext context, MessageReference reference) {
         messageExpired(context, null, reference);
     }
@@ -2041,11 +2037,6 @@ public class Queue extends BaseDestination implements Task, UsageListener,
Index
                         if (processExpired && ref.isExpired()) {
                             if (broker.isExpired(ref)) {
                                 messageExpired(createConnectionContext(), ref);
-
-                                //We need to update the metrics here because the drop message
-                                //method will only update if the message was removed from
the
-                                //pagedInMessages list which won't happen in this case
-                                updateMetricsOnMessageDrop();
                             } else {
                                 ref.decrementReferenceCount();
                             }


Mime
View raw message