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


##########
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:
   I don't think it is necessary or advisable. Once we know what are the paths 
of the nodes, we can easily retrieve the node from the backing store and 
investigate further. And as we can't log the full contents of the node, we 
would have to select which parts to log, and we risk not to include the 
relevant information. But I think the more important reason not to log the 
contents is that we would be exposing more customer information on the logs, 
which we should avoid as much as possible.



-- 
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