reschke commented on code in PR #201:
URL: 
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/201#discussion_r2309710237


##########
src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java:
##########
@@ -776,21 +783,46 @@ private boolean drainSpecificQueue(boolean isAlias, 
List<Map.Entry<String, Resou
                     new ChangeContext(type, path, isAlias, !isAlias), 
resolverRefreshed, hasReloadedConfig);
         }
 
+        if (count > 0) {
+            log.info(getTimingMessage(message, sw.getDuration(), count));
+        }
+
         // do we need to send an event?
         return sendEvent;
     }
 
     // Drains the resource event queue for aliases
-    private void drainAliasQueue() {
-        if (drainSpecificQueue(true, resourceChangeQueueForAliases)) {
+    private void drainAliasQueue(String message) {
+        if (drainSpecificQueue(true, message, resourceChangeQueueForAliases)) {
             sendChangeEvent();
         }
     }
 
     // Drains the resource event queue for vanity paths
-    private void drainVanityPathQueue() {
-        if (drainSpecificQueue(false, resourceChangeQueueForVanityPaths)) {
+    private void drainVanityPathQueue(String message) {
+        if (drainSpecificQueue(false, message, 
resourceChangeQueueForVanityPaths)) {
             sendChangeEvent();
         }
     }
+
+    // builds a string based on (optional) message, duration, number of 
operations
+    // computes and inserts the number of operations per second
+    static String getTimingMessage(String description, Duration duration, long 
operations) {

Review Comment:
   Oops. And that did not even have test coverage.



-- 
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: dev-unsubscr...@sling.apache.org

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

Reply via email to