diff --git a/table/block_based_table_builder.cc b/table/block_based_table_builder.cc index dec0dce2d..fc3e8f829 100644 --- a/table/block_based_table_builder.cc +++ b/table/block_based_table_builder.cc @@ -527,11 +527,11 @@ void BlockBasedTableBuilder::WriteBlock(const Slice& raw_block_contents, RecordTick(r->ioptions.statistics, NUMBER_BLOCK_NOT_COMPRESSED); type = kNoCompression; block_contents = raw_block_contents; - } else if (type != kNoCompression && - ShouldReportDetailedTime(r->ioptions.env, - r->ioptions.statistics)) { - MeasureTime(r->ioptions.statistics, COMPRESSION_TIMES_NANOS, - timer.ElapsedNanos()); + } else if (type != kNoCompression) { + if (ShouldReportDetailedTime(r->ioptions.env, r->ioptions.statistics)) { + MeasureTime(r->ioptions.statistics, COMPRESSION_TIMES_NANOS, + timer.ElapsedNanos()); + } MeasureTime(r->ioptions.statistics, BYTES_COMPRESSED, raw_block_contents.size()); RecordTick(r->ioptions.statistics, NUMBER_BLOCK_COMPRESSED); diff --git a/table/format.cc b/table/format.cc index cf7f96316..6ab2fd5af 100644 --- a/table/format.cc +++ b/table/format.cc @@ -369,9 +369,9 @@ Status UncompressBlockContentsForCompressionType( if(ShouldReportDetailedTime(ioptions.env, ioptions.statistics)){ MeasureTime(ioptions.statistics, DECOMPRESSION_TIMES_NANOS, timer.ElapsedNanos()); - MeasureTime(ioptions.statistics, BYTES_DECOMPRESSED, contents->data.size()); - RecordTick(ioptions.statistics, NUMBER_BLOCK_DECOMPRESSED); } + MeasureTime(ioptions.statistics, BYTES_DECOMPRESSED, contents->data.size()); + RecordTick(ioptions.statistics, NUMBER_BLOCK_DECOMPRESSED); return Status::OK(); }