You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2021/09/13 12:34:06 UTC

[GitHub] [activemq-artemis] franz1981 commented on a change in pull request #3742: ARTEMIS-2007 - refactor to make use of existing refCountForConsumers …

franz1981 commented on a change in pull request #3742:
URL: https://github.com/apache/activemq-artemis/pull/3742#discussion_r707287160



##########
File path: artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/QueueImpl.java
##########
@@ -218,17 +218,17 @@ private void checkIDSupplier(NodeStore<MessageReference> nodeStore) {
 
    protected final ScheduledDeliveryHandler scheduledDeliveryHandler;
 
-   private AtomicLong messagesAdded = new AtomicLong(0);
+   private final AtomicLong messagesAdded = new AtomicLong(0);

Review comment:
       Sometime we use AtomicLongFieldUpdater and sometime we use AtomicLong. This could be the chance to unify the way we treat counters like these, chosing a single tool for the job...
   
   IMO if these counters are not used for logic, but for telemetry, probably a `LongAdder` (or some of the JCTools counters) would work much better then `AtomicLong/AtomicLongFieldUpdater`. because `LongAdder` scales way better and cost must less for the thread that increment it, especially if is happening in the hot path




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

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org