[ 
https://issues.apache.org/jira/browse/ARTEMIS-3720?focusedWorklogId=743143&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-743143
 ]

ASF GitHub Bot logged work on ARTEMIS-3720:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 17/Mar/22 13:41
            Start Date: 17/Mar/22 13:41
    Worklog Time Spent: 10m 
      Work Description: clebertsuconic commented on a change in pull request 
#3983:
URL: https://github.com/apache/activemq-artemis/pull/3983#discussion_r829127933



##########
File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java
##########
@@ -189,13 +198,45 @@ public PagingStoreImpl(final SimpleString address,
       this.usingGlobalMaxSize = pagingManager.isUsingGlobalSize();
    }
 
+   private static SizeAwareMetric getGlobalMetric(PagingManager manager) {
+      if (manager instanceof PagingManagerImpl) {
+         return ((PagingManagerImpl) manager).getSizeAwareMetric();
+      } else {
+         // for unit / mock tests
+         SizeAwareMetric metric = new SizeAwareMetric(-1, -1, -1, -1, -1, 1, 
1, 0, 0);
+         metric.addOnSizeCallback(manager::addSize, false);
+         metric.addOnSizeCallback((l) -> manager.addSize(l, true), true);
+         return metric;
+      }
+   }

Review comment:
       I did not want to add SizeAwareMetric to the interface... I wanted it to 
be an internal implementation detail.
   
   if the implementation (PagingManagerImpl) is using it, it could use it on a 
parent call for the metric. Otherwise the proxy Metric would use the already 
existing API.
   
   I'm adding it to the interface now with a default implementation returning 
the proxy. I didn't want to do it.. but I will do it just to settle this.




-- 
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-unsubscr...@activemq.apache.org

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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 743143)
    Time Spent: 3.5h  (was: 3h 20m)

> Max number of messages as a deciding factor for Paging
> ------------------------------------------------------
>
>                 Key: ARTEMIS-3720
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3720
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker
>            Reporter: Clebert Suconic
>            Assignee: Clebert Suconic
>            Priority: Major
>             Fix For: 2.21.0
>
>          Time Spent: 3.5h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to