NUMBER_BLOCK_COMPRESSED, etc, shouldn't be treated as timer counter

Summary:
NUMBER_BLOCK_DECOMPRESSED and NUMBER_BLOCK_COMPRESSED are not reported unless the stats level contain detailed timers, which is wrong. They are normal counters. Fix it.
Closes https://github.com/facebook/rocksdb/pull/3263

Differential Revision: D6552519

Pulled By: siying

fbshipit-source-id: 40899ccea7b2856bb39752616657c0bfd432f6f9
main
Siying Dong 7 years ago committed by Facebook Github Bot
parent cd2e5cae7f
commit 6b77c07379
  1. 6
      table/block_based_table_builder.cc
  2. 2
      table/format.cc

@ -527,11 +527,11 @@ void BlockBasedTableBuilder::WriteBlock(const Slice& raw_block_contents,
RecordTick(r->ioptions.statistics, NUMBER_BLOCK_NOT_COMPRESSED); RecordTick(r->ioptions.statistics, NUMBER_BLOCK_NOT_COMPRESSED);
type = kNoCompression; type = kNoCompression;
block_contents = raw_block_contents; block_contents = raw_block_contents;
} else if (type != kNoCompression && } else if (type != kNoCompression) {
ShouldReportDetailedTime(r->ioptions.env, if (ShouldReportDetailedTime(r->ioptions.env, r->ioptions.statistics)) {
r->ioptions.statistics)) {
MeasureTime(r->ioptions.statistics, COMPRESSION_TIMES_NANOS, MeasureTime(r->ioptions.statistics, COMPRESSION_TIMES_NANOS,
timer.ElapsedNanos()); timer.ElapsedNanos());
}
MeasureTime(r->ioptions.statistics, BYTES_COMPRESSED, MeasureTime(r->ioptions.statistics, BYTES_COMPRESSED,
raw_block_contents.size()); raw_block_contents.size());
RecordTick(r->ioptions.statistics, NUMBER_BLOCK_COMPRESSED); RecordTick(r->ioptions.statistics, NUMBER_BLOCK_COMPRESSED);

@ -369,9 +369,9 @@ Status UncompressBlockContentsForCompressionType(
if(ShouldReportDetailedTime(ioptions.env, ioptions.statistics)){ if(ShouldReportDetailedTime(ioptions.env, ioptions.statistics)){
MeasureTime(ioptions.statistics, DECOMPRESSION_TIMES_NANOS, MeasureTime(ioptions.statistics, DECOMPRESSION_TIMES_NANOS,
timer.ElapsedNanos()); timer.ElapsedNanos());
}
MeasureTime(ioptions.statistics, BYTES_DECOMPRESSED, contents->data.size()); MeasureTime(ioptions.statistics, BYTES_DECOMPRESSED, contents->data.size());
RecordTick(ioptions.statistics, NUMBER_BLOCK_DECOMPRESSED); RecordTick(ioptions.statistics, NUMBER_BLOCK_DECOMPRESSED);
}
return Status::OK(); return Status::OK();
} }

Loading…
Cancel
Save