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 2022/12/12 17:50:05 UTC

[GitHub] [activemq-artemis] clebertsuconic commented on a diff in pull request #4265: ARTEMIS-4065 Non Persistent Page Counters

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


##########
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:
   In a previous version of my changes, I was going to use SizeAwareMetric in the PageCounters in replacement of the values in there.
   
   As I progressed with the changes I did not use any of it...
   
   
   I am going to revert all changes in SizeAwareMetric on this PR.
   



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