diff --git a/db/db_iter.cc b/db/db_iter.cc index 1381f24cf..370ffd8cb 100644 --- a/db/db_iter.cc +++ b/db/db_iter.cc @@ -552,6 +552,8 @@ void DBIter::FindParseableKey(ParsedInternalKey* ikey, Direction direction) { } void DBIter::Seek(const Slice& target) { + StopWatch sw(env_, statistics_, DB_SEEK); + saved_key_.Clear(); // now savved_key is used to store internal key. saved_key_.SetInternalKey(target, sequence_); diff --git a/include/rocksdb/statistics.h b/include/rocksdb/statistics.h index 4b17e481e..6785833b4 100644 --- a/include/rocksdb/statistics.h +++ b/include/rocksdb/statistics.h @@ -219,6 +219,7 @@ enum Histograms : uint32_t { HARD_RATE_LIMIT_DELAY_COUNT, SOFT_RATE_LIMIT_DELAY_COUNT, NUM_FILES_IN_SINGLE_COMPACTION, + DB_SEEK, HISTOGRAM_ENUM_MAX, }; @@ -241,6 +242,7 @@ const std::vector> HistogramsNameMap = { { HARD_RATE_LIMIT_DELAY_COUNT, "rocksdb.hard.rate.limit.delay.count"}, { SOFT_RATE_LIMIT_DELAY_COUNT, "rocksdb.soft.rate.limit.delay.count"}, { NUM_FILES_IN_SINGLE_COMPACTION, "rocksdb.numfiles.in.singlecompaction" }, + { DB_SEEK, "rocksdb.db.seek.micros" }, }; struct HistogramData {