franz1981 commented on a change in pull request #2681: ARTEMIS-2308 Support 
exporting metrics
URL: https://github.com/apache/activemq-artemis/pull/2681#discussion_r288087224
 
 

 ##########
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java
 ##########
 @@ -191,4 +194,16 @@ public long getUnRoutedMessageCount() {
       return unRoutedMessageCountUpdater.get(this);
    }
 
+   public void registerMeters(MetricsManager metricsManager) {
+      if (metricsManager != null) {
+         metricsManager.registerAddressGauge("routed.message.count", 
name.toString(), this, metrics -> Double.valueOf(getRoutedMessageCount()), 
AddressControl.ROUTED_MESSAGE_COUNT_DESCRIPTION);
+         metricsManager.registerAddressGauge("unrouted.message.count", 
name.toString(), this, metrics -> Double.valueOf(getUnRoutedMessageCount()), 
AddressControl.ROUTED_MESSAGE_COUNT_DESCRIPTION);
+      }
+   }
+
+   public void unregisterMeters(MetricsManager metricsManager) {
+      if (metricsManager != null) {
 
 Review comment:
   Given that `metricsManager` is volatile, it should be called in a local 
variable and if not null, used to call its method

----------------------------------------------------------------
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

Reply via email to