nit0906 commented on code in PR #1621:
URL: https://github.com/apache/jackrabbit-oak/pull/1621#discussion_r1703680984


##########
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/TopKSlowestPaths.java:
##########
@@ -0,0 +1,70 @@
+package org.apache.jackrabbit.oak.index.indexer.document;
+
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.PriorityQueue;
+import java.util.stream.Collectors;
+
+/**
+ * Keeps track of the top K entries that took the longest to index.
+ */
+final class TopKSlowestPaths {
+    final static class PathAndTime implements Comparable<PathAndTime> {
+        final String path;
+        final long timeMillis;
+
+        public PathAndTime(String key, long timeMillis) {
+            this.path = key;
+            this.timeMillis = timeMillis;
+        }
+
+        @Override
+        public int compareTo(PathAndTime o) {
+            return Long.compare(timeMillis, o.timeMillis);
+        }
+
+        @Override
+        public String toString() {

Review Comment:
   Would it make sense to log the node content as well ? 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to