This is an automated email from the ASF dual-hosted git repository.
cschneider pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-journal.git
The following commit(s) were added to refs/heads/master by this push:
new 9755a72 SLING-12887 - Log duration of RangePoller (#177)
9755a72 is described below
commit 9755a72faa6e257378ebdbee1401c06c0d7d81c6
Author: Christian Schneider <[email protected]>
AuthorDate: Wed Aug 13 12:16:08 2025 +0200
SLING-12887 - Log duration of RangePoller (#177)
---
.../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);