Skip to content

Commit

Permalink
Add histogram for DB_SEEK
Browse files Browse the repository at this point in the history
Summary: as title

Test Plan: make release

Reviewers: sdong, yhchiang

Reviewed By: yhchiang

Subscribers: leveldb

Differential Revision: https://reviews.facebook.net/D21717
  • Loading branch information
Lei Jin committed Aug 13, 2014
1 parent 5e64240 commit 5a5953b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions db/db_iter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
Expand Down
2 changes: 2 additions & 0 deletions include/rocksdb/statistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand All @@ -241,6 +242,7 @@ const std::vector<std::pair<Histograms, std::string>> 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 {
Expand Down

0 comments on commit 5a5953b

Please sign in to comment.