[ 
https://issues.apache.org/jira/browse/ARTEMIS-4915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17878831#comment-17878831
 ] 

ASF subversion and git services commented on ARTEMIS-4915:
----------------------------------------------------------

Commit 7605bd673f68a0555e1bbbbc7ba0544f9d0ebd2f in activemq-artemis's branch 
refs/heads/main from Justin Bertram
[ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=7605bd673f ]

ARTEMIS-4915 clarify 'total' server metrics' descriptions


> TotalMessagesAdded/Acknowledged metrics are inaccurate if queues deleted
> ------------------------------------------------------------------------
>
>                 Key: ARTEMIS-4915
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4915
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: JMX, management
>            Reporter: Josh Byster
>            Priority: Minor
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Currently, the total messages added/acknowledged fields are computed by 
> summing up the counts on the individual queues, i.e.
> {code:java}
>    @Override
>    public long getTotalMessagesAdded() {
>       long total = 0;
>       for (Binding binding : iterableOf(postOffice.getAllBindings())) {
>          if (binding.getType() == BindingType.LOCAL_QUEUE) {
>             total += ((LocalQueueBinding) 
> binding).getQueue().getMessagesAdded();
>          }
>       }
>       return total;
>    }
> {code}
> This fails to give an accurate count if queues are being created or deleted 
> (for example, as consumers disconnect or reconnect).
> This can easily be demonstrated by sending messages and then disconnecting 
> all consumers (with queue auto-deletion) and seeing the "messages added" 
> count drop to 0.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to