From 1edac32b77cc5ebf8f1e853b2cf850c6f9bb8281 Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Wed, 31 Jan 2018 14:16:04 -0800 Subject: [PATCH] Update rocksdb.read.block.get.micros when block cache disabled Summary: Previously `ReadBlockFromFile` for data blocks was only measured when reading a block to populate block cache. This PR adds the corresponding measurements for users who disabled block cache. Closes https://github.com/facebook/rocksdb/pull/3442 Differential Revision: D6848671 Pulled By: ajkr fbshipit-source-id: bb4bbe1797fa2cc1d9a5bad44891af2b55384b41 --- table/block_based_table_reader.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/table/block_based_table_reader.cc b/table/block_based_table_reader.cc index 87bc766c1a..1abd79af74 100644 --- a/table/block_based_table_reader.cc +++ b/table/block_based_table_reader.cc @@ -1499,11 +1499,15 @@ BlockIter* BlockBasedTable::NewDataBlockIterator( return iter; } std::unique_ptr block_value; - s = ReadBlockFromFile(rep->file.get(), nullptr /* prefetch_buffer */, - rep->footer, ro, handle, &block_value, rep->ioptions, - true /* compress */, compression_dict, - rep->persistent_cache_options, rep->global_seqno, - rep->table_options.read_amp_bytes_per_bit); + { + StopWatch sw(rep->ioptions.env, rep->ioptions.statistics, + READ_BLOCK_GET_MICROS); + s = ReadBlockFromFile( + rep->file.get(), nullptr /* prefetch_buffer */, rep->footer, ro, + handle, &block_value, rep->ioptions, true /* compress */, + compression_dict, rep->persistent_cache_options, rep->global_seqno, + rep->table_options.read_amp_bytes_per_bit); + } if (s.ok()) { block.value = block_value.release(); }