osdir.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] activemq-artemis pull request #2206: ARTEMIS-2003 - Add bridge metrics


Github user franz1981 commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2206#discussion_r206849644
  
    --- Diff: artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/BridgeImpl.java ---
    @@ -609,6 +612,7 @@ public HandleStatus handle(final MessageReference ref) throws Exception {
              final Message message = beforeForward(ref.getMessage(), dest);
     
              pendingAcks.countUp();
    +         metrics.incrementEnqueueCount();
    --- End diff --
    
    I haven't had the chance to explain that in other PRs related to metrics collection: if these metrics are getting updated from a single thread/writer, instead of using `AtomicLong::incrementAndGet` can be used `AtomicLong::lazySet(AtomicLong::get() + delta)` from the pov of metrics collections it will be a lot less expensive.
    It shouldn't be visible in our tests on laptop HW but with real servers, especially with NUMA (and multi socket) configuration.
    I don't know if it's the case, but given that it cost very little to change that, I suggest to do it right where is possible to do it.


---