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

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

Commit 246bf083914c7acbb05a7fe0904c471331242c39 in activemq-artemis's branch 
refs/heads/master from Justin Bertram
[ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=246bf08 ]

ARTEMIS-2909 revert ARTEMIS-2322

This reverts commit dbb3a90fe6d2718fef0b8ae75123519b1404ef1f.

The org.apache.activemq.artemis.core.server.Queue#getRate method is for
slow-consumer detection and is designed for internal use only.

Furthermore, it's too opaque to be trusted by a remote user as it only
returns the number of message added to the queue since *the last time
it was called*. The problem here is that the user calling it doesn't
know when it was invoked last. Therefore, they could be getting the
rate of messages added for the last 5 minutes or the last 5
milliseconds. This can lead to inconsistent and misleading results.

There are three main ways for users to track rates of message
production and consumption:

 1. Use a metrics plugin. This is the most feature-rich and flexible
way to track broker metrics, although it requires tools (e.g.
Prometheus) to store the metrics and display them (e.g. Grafana).

 2. Invoke the getMessageCount() and getMessagesAdded() management
methods and store the returned values along with the time they were
retrieved. A time-series database is a great tool for this job. This is
exactly what tools like Prometheus do. That data can then be used to
create informative graphs, etc. using tools like Grafana. Of course, one
can skip all the tools and just do some simple math to calculate rates
based on the last time the counts were retrieved.

 3. Use the broker's message counters. Message counters are the broker's
simple way of providing historical information about the queue. They
provide similar results to the previous solutions, but with less
flexibility since they only track data while the broker is up and
there's not really any good options for graphing.


> Expose Queue.getRate() data as JMX metric
> -----------------------------------------
>
>                 Key: ARTEMIS-2322
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2322
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 2.8.0
>            Reporter: Dmitry Volodin
>            Priority: Major
>             Fix For: 2.10.0
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> It would be nice also to expose metrics from the Queue.getRate()  as JMX and 
> have to setup window function for calculation (in the future).
> I will try to take care about this features and create PR soon.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to