This is an automated email from the ASF dual-hosted git repository.

cschneider pushed a commit to branch SLING-12887
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-journal.git

commit 1e06ef63046e92df15a5a659acc08fd39d343b52
Author: Christian Schneider <[email protected]>
AuthorDate: Wed Aug 13 11:58:15 2025 +0200

    SLING-12887 - Log duration of RangePoller
---
 .../sling/distribution/journal/impl/publisher/RangePoller.java      | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/src/main/java/org/apache/sling/distribution/journal/impl/publisher/RangePoller.java
 
b/src/main/java/org/apache/sling/distribution/journal/impl/publisher/RangePoller.java
index 4ed267c..2a7fe0f 100644
--- 
a/src/main/java/org/apache/sling/distribution/journal/impl/publisher/RangePoller.java
+++ 
b/src/main/java/org/apache/sling/distribution/journal/impl/publisher/RangePoller.java
@@ -59,11 +59,14 @@ public class RangePoller {
 
     private final MessageSender<PackageMessage> sender;
 
+       private final long startTime;
+
     public RangePoller(MessagingProvider messagingProvider,
                           String packageTopic,
                           long minOffset,
                           long maxOffsetExclusive,
                           int seedDelaySeconds) {
+       this.startTime = System.currentTimeMillis();
         this.maxOffset = maxOffsetExclusive;
         this.minOffset = minOffset;
         this.seedDelaySeconds = seedDelaySeconds;
@@ -85,7 +88,8 @@ public class RangePoller {
                 sender.send(msg);
                 fetched.await();
             }
-            LOG.info("Fetched offsets [{},{}[", minOffset, maxOffset);
+            long durationMS = System.currentTimeMillis() - startTime;
+            LOG.info("Fetched offsets [{},{}[ in durationMs={}", minOffset, 
maxOffset, durationMS);
             return messages;
         } finally {
             IOUtils.closeQuietly(headPoller);

Reply via email to