From a48ba5090beafc725ab04e67996e42f0b3f31348 Mon Sep 17 00:00:00 2001 From: Mike McCandless Date: Tue, 2 Feb 2016 11:07:36 -0500 Subject: [PATCH] add time took for each index part during flush, like we do on merge; improve javadocs --- .../lucene/index/DefaultIndexingChain.java | 26 +++++++++++++++++++ .../apache/lucene/store/RAMOutputStream.java | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java b/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java index 788fa2933ac..500aff29d70 100644 --- a/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java +++ b/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java @@ -91,16 +91,35 @@ final class DefaultIndexingChain extends DocConsumer { // aborting on any exception from this method int maxDoc = state.segmentInfo.maxDoc(); + long t0 = System.nanoTime(); writeNorms(state); + if (docState.infoStream.isEnabled("IW")) { + docState.infoStream.message("IW", ((System.nanoTime()-t0)/1000000) + " msec to write norms"); + } + + t0 = System.nanoTime(); writeDocValues(state); + if (docState.infoStream.isEnabled("IW")) { + docState.infoStream.message("IW", ((System.nanoTime()-t0)/1000000) + " msec to write docValues"); + } + + t0 = System.nanoTime(); writePoints(state); + if (docState.infoStream.isEnabled("IW")) { + docState.infoStream.message("IW", ((System.nanoTime()-t0)/1000000) + " msec to write points"); + } // it's possible all docs hit non-aborting exceptions... + t0 = System.nanoTime(); initStoredFieldsWriter(); fillStoredFields(maxDoc); storedFieldsWriter.finish(state.fieldInfos, maxDoc); storedFieldsWriter.close(); + if (docState.infoStream.isEnabled("IW")) { + docState.infoStream.message("IW", ((System.nanoTime()-t0)/1000000) + " msec to finish stored fields"); + } + t0 = System.nanoTime(); Map fieldsToFlush = new HashMap<>(); for (int i=0;i