fix infoStream formatting to always report double precision MB usage

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1051067 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2010-12-20 11:19:30 +00:00
parent 5b3250dc37
commit fda2483fb6
1 changed files with 8 additions and 8 deletions

View File

@ -592,7 +592,7 @@ final class DocumentsWriter {
threads.add(threadState.consumer);
}
long startNumBytesUsed = bytesUsed();
double startMBUsed = bytesUsed()/1024./1024.;
consumer.flush(threads, flushState);
newSegment.setHasVectors(flushState.hasVectors);
@ -622,13 +622,13 @@ final class DocumentsWriter {
if (infoStream != null) {
message("flush: segment=" + newSegment);
final long newSegmentSizeNoStore = newSegment.sizeInBytes(false);
final long newSegmentSize = newSegment.sizeInBytes(true);
message(" ramUsed=" + nf.format(startNumBytesUsed / 1024. / 1024.) + " MB" +
" newFlushedSize=" + nf.format(newSegmentSize / 1024 / 1024) + " MB" +
" (" + nf.format(newSegmentSizeNoStore / 1024 / 1024) + " MB w/o doc stores)" +
" docs/MB=" + nf.format(numDocs / (newSegmentSize / 1024. / 1024.)) +
" new/old=" + nf.format(100.0 * newSegmentSizeNoStore / startNumBytesUsed) + "%");
final double newSegmentSizeNoStore = newSegment.sizeInBytes(false)/1024./1024.;
final double newSegmentSize = newSegment.sizeInBytes(true)/1024./1024.;
message(" ramUsed=" + nf.format(startMBUsed) + " MB" +
" newFlushedSize=" + nf.format(newSegmentSize) + " MB" +
" (" + nf.format(newSegmentSizeNoStore) + " MB w/o doc stores)" +
" docs/MB=" + nf.format(numDocs / newSegmentSize) +
" new/old=" + nf.format(100.0 * newSegmentSizeNoStore / startMBUsed) + "%");
}
success = true;