Repository: activemq Updated Branches: refs/heads/activemq-5.15.x bca0af413 -> 79fae8c00
Revert "AMQ-6947 - Update Queue metrics on expiration" This reverts commit bca0af4133a6e226783f8e953f1abe7d4e165743. Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/86fbf957 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/86fbf957 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/86fbf957 Branch: refs/heads/activemq-5.15.x Commit: 86fbf957e9ee4a005da838cd7306292ab975e745 Parents: bca0af4 Author: Christopher L. Shannon (cshannon) <[email protected]> Authored: Wed Apr 18 12:35:01 2018 -0400 Committer: Christopher L. Shannon (cshannon) <[email protected]> Committed: Wed Apr 18 12:35:01 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/86fbf957/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 f669e41..2946ac5 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 @@ -1842,7 +1842,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(); @@ -1850,11 +1851,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); } @@ -2011,11 +2007,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(); }
