Add a statistic to count the number of calls to GetUpdatesSince

Summary: This is useful to keep track of refreshes in transaction log iterator

Test Plan: make; db_stress --statistics=1 shows it

Reviewers: dhruba, haobo

Reviewed By: dhruba

CC: leveldb

Differential Revision: https://reviews.facebook.net/D13281
main
Mayank Agarwal 11 years ago
parent 854d236361
commit b3ed08129b
  1. 1
      db/db_impl.cc
  2. 7
      include/rocksdb/statistics.h

@ -1092,6 +1092,7 @@ SequenceNumber DBImpl::GetLatestSequenceNumber() {
Status DBImpl::GetUpdatesSince(SequenceNumber seq, Status DBImpl::GetUpdatesSince(SequenceNumber seq,
unique_ptr<TransactionLogIterator>* iter) { unique_ptr<TransactionLogIterator>* iter) {
RecordTick(options_.statistics, GET_UPDATES_SINCE_CALLS);
if (seq > last_flushed_sequence_) { if (seq > last_flushed_sequence_) {
return Status::IOError("Requested sequence not yet written in the db"); return Status::IOError("Requested sequence not yet written in the db");
} }

@ -76,6 +76,10 @@ enum Tickers {
// over large number of keys with same userkey. // over large number of keys with same userkey.
NUMBER_OF_RESEEKS_IN_ITERATION, NUMBER_OF_RESEEKS_IN_ITERATION,
// Record the number of calls to GetUpadtesSince. Useful to keep track of
// transaction log iterator refreshes
GET_UPDATES_SINCE_CALLS,
TICKER_ENUM_MAX TICKER_ENUM_MAX
}; };
@ -108,7 +112,8 @@ const std::vector<std::pair<Tickers, std::string>> TickersNameMap = {
{ SEQUENCE_NUMBER, "rocksdb.sequence.number" }, { SEQUENCE_NUMBER, "rocksdb.sequence.number" },
{ BLOOM_FILTER_PREFIX_CHECKED, "rocksdb.bloom.filter.prefix.checked" }, { BLOOM_FILTER_PREFIX_CHECKED, "rocksdb.bloom.filter.prefix.checked" },
{ BLOOM_FILTER_PREFIX_USEFUL, "rocksdb.bloom.filter.prefix.useful" }, { BLOOM_FILTER_PREFIX_USEFUL, "rocksdb.bloom.filter.prefix.useful" },
{ NUMBER_OF_RESEEKS_IN_ITERATION, "rocksdb.number.reseeks.iteration" } { NUMBER_OF_RESEEKS_IN_ITERATION, "rocksdb.number.reseeks.iteration" },
{ GET_UPDATES_SINCE_CALLS, "rocksdb.getupdatessince.calls" }
}; };
/** /**

Loading…
Cancel
Save