[RocksDB] dump leveldb.stats periodically in LOG file.

Summary:
Added an option stats_dump_period_sec to dump leveldb.stats to LOG periodically for diagnosis.
By defauly, it's set to a very big number 3600 (1 hour).

Test Plan: make check;

Reviewers: dhruba

Reviewed By: dhruba

CC: leveldb, zshao

Differential Revision: https://reviews.facebook.net/D10761
This commit is contained in:
Haobo Xu
2013-05-10 15:21:04 -07:00
parent 26541860d3
commit 0e879c93de
4 changed files with 36 additions and 2 deletions

View File

@@ -208,6 +208,10 @@ class DBImpl : public DB {
Status ReadFirstLine(const std::string& fname, WriteBatch* const batch);
// dump leveldb.stats to LOG
void MaybeDumpStats();
// Constant after construction
const InternalFilterPolicy internal_filter_policy_;
bool owns_info_log_;
@@ -272,6 +276,9 @@ class DBImpl : public DB {
// last time when PurgeObsoleteWALFiles ran.
uint64_t purge_wal_files_last_run_;
// last time stats were dumped to LOG
uint64_t last_stats_dump_time_microsec_;
// These count the number of microseconds for which MakeRoomForWrite stalls.
uint64_t stall_level0_slowdown_;
uint64_t stall_memtable_compaction_;