You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by nf...@apache.org on 2024/09/26 11:32:21 UTC

(jackrabbit-oak) branch trunk updated: OAK-11145 - Fix: time reported for makeDocument in indexing statistics is wrong. (#1739)

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

nfsantos pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 9f26450c69 OAK-11145 - Fix: time reported for makeDocument in indexing statistics is wrong. (#1739)
9f26450c69 is described below

commit 9f26450c69f2da27a303a2e9e9465aaa5038010e
Author: Nuno Santos <ns...@adobe.com>
AuthorDate: Thu Sep 26 13:32:16 2024 +0200

    OAK-11145 - Fix: time reported for makeDocument in indexing statistics is wrong. (#1739)
---
 .../index/indexer/document/IndexerStatisticsTracker.java   | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/IndexerStatisticsTracker.java b/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/IndexerStatisticsTracker.java
index c4ede412fe..c58afface2 100644
--- a/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/IndexerStatisticsTracker.java
+++ b/oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/IndexerStatisticsTracker.java
@@ -31,12 +31,12 @@ public final class IndexerStatisticsTracker {
     // Timestamp of when indexing started.
     private long startIndexingNanos = 0;
     // Time spent indexing entries. Should be almost the same as totalMakeDocumentTimeNanos+totalWriteTimeNanos
-    private AtomicLong totalIndexingTimeNanos = new AtomicLong();
+    private final AtomicLong totalIndexingTimeNanos = new AtomicLong();
     // Time generating the Lucene document.
-    private AtomicLong totalMakeDocumentTimeNanos = new AtomicLong();
+    private final AtomicLong totalMakeDocumentTimeNanos = new AtomicLong();
     // Time writing the Lucene document to disk.
-    private AtomicLong totalWriteTimeNanos = new AtomicLong();
-    private AtomicLong nodesIndexed = new AtomicLong();
+    private final AtomicLong totalWriteTimeNanos = new AtomicLong();
+    private final AtomicLong nodesIndexed = new AtomicLong();
 
     public IndexerStatisticsTracker(Logger logger) {
         this.logger = logger;
@@ -50,10 +50,10 @@ public final class IndexerStatisticsTracker {
      * Mark that an entry completed indexing. If indexing the entry was slow, then a
      * message is logged.
      *
-     * @param path the path
+     * @param entryPath the path
      * @param startEntryNanos timestamp of when the current entry started being
      *                        indexed
-     * @oaran endEntryMakeDocumentNanos timestamp of when the current entry finished
+     * @param endEntryMakeDocumentNanos timestamp of when the current entry finished
      *        the makeDocument phase.
      */
     public void onEntryEnd(String entryPath, long startEntryNanos, long endEntryMakeDocumentNanos) {
@@ -63,7 +63,7 @@ public final class IndexerStatisticsTracker {
         long entryMakeDocumentTimeNanos = endEntryMakeDocumentNanos - startEntryNanos;
         long entryWriteTimeNanos = endEntryWriteNanos - endEntryMakeDocumentNanos;
         totalIndexingTimeNanos.addAndGet(entryIndexingTimeNanos);
-        totalMakeDocumentTimeNanos.addAndGet(entryWriteTimeNanos);
+        totalMakeDocumentTimeNanos.addAndGet(entryMakeDocumentTimeNanos);
         totalWriteTimeNanos.addAndGet(entryWriteTimeNanos);
         if (entryIndexingTimeNanos >= (long) SLOW_DOCUMENT_LOG_THRESHOLD * 1_000_000) {
             logger.info("Slow document: {}. Times: total={}ms, makeDocument={}ms, writeToIndex={}ms",