From e43fdc9654be8f6ca6b9b6b0146e3e6793f35943 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Tue, 18 Jan 2011 11:31:35 +0000 Subject: [PATCH] say how many msec flush took, in infoStream git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1060324 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/java/org/apache/lucene/index/DocumentsWriter.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lucene/src/java/org/apache/lucene/index/DocumentsWriter.java b/lucene/src/java/org/apache/lucene/index/DocumentsWriter.java index e7e34e5d9a5..8b9d33e3135 100644 --- a/lucene/src/java/org/apache/lucene/index/DocumentsWriter.java +++ b/lucene/src/java/org/apache/lucene/index/DocumentsWriter.java @@ -546,6 +546,8 @@ final class DocumentsWriter { // Lock order: IW -> DW synchronized SegmentInfo flush(IndexWriter writer, IndexFileDeleter deleter, MergePolicy mergePolicy, SegmentInfos segmentInfos) throws IOException { + final long startTime = System.currentTimeMillis(); + // We change writer's segmentInfos: assert Thread.holdsLock(writer); @@ -646,6 +648,10 @@ final class DocumentsWriter { // Lock order: IW -> DW -> BD pushDeletes(newSegment, segmentInfos); + if (infoStream != null) { + message("flush time " + (System.currentTimeMillis()-startTime) + " msec"); + } + return newSegment; }