franz1981 commented on a change in pull request #2681: ARTEMIS-2308 Support
exporting metrics
URL: https://github.com/apache/activemq-artemis/pull/2681#discussion_r287796425
##########
File path:
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
##########
@@ -3852,6 +3859,41 @@ void scheduleSlowConsumerReaper(AddressSettings
settings) {
}
}
+ private void registerMeters() {
+ String addressName = address.toString();
+ String queueName = name.toString();
+
+ if (server != null && server.getMetricsManager() != null) {
+ MetricsManager metricsManager = server.getMetricsManager();
+ metricsManager.registerQueueGauge("message.count", addressName,
queueName, pendingMetrics, metrics ->
Double.valueOf(pendingMetrics.getMessageCount()),
QueueControl.MESSAGE_COUNT_DESCRIPTION);
Review comment:
Would be nice to collect in some static final fields all the metrics IDs eg
`message.count`
to avoid mistakes while registering them
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services