clebertsuconic commented on code in PR #4265:
URL: https://github.com/apache/activemq-artemis/pull/4265#discussion_r1046173412


##########
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/SizeAwareMetric.java:
##########
@@ -163,6 +173,21 @@ public final long addSize(final int delta) {
       return addSize(delta, false);
    }
 
+   public final void add(final int elements, final long size) {
+
+      long currentSize = sizeUpdater.addAndGet(this, size);
+      long currentElements = elementsUpdater.addAndGet(this, elements);
+
+      if (elements >= 0) {
+         assert size >= 0 : "If elements is positve, size must be positive";

Review Comment:
   @gemmellr thanks for the catch!



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to