From 94c78b11e411d15f23bbc0c3c3f95c7e070ea528 Mon Sep 17 00:00:00 2001 From: Zhongyi Xie Date: Fri, 24 May 2019 10:27:28 -0700 Subject: [PATCH] improve comments for statistics.h Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/5351 Differential Revision: D15496346 Pulled By: miasantreble fbshipit-source-id: eeb619e6bd8616003ba35b0cd4bb8050e6a8cb4d --- include/rocksdb/statistics.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/include/rocksdb/statistics.h b/include/rocksdb/statistics.h index 3b2b2e048..653b460cb 100644 --- a/include/rocksdb/statistics.h +++ b/include/rocksdb/statistics.h @@ -447,6 +447,10 @@ struct HistogramData { double min = 0.0; }; +// StatsLevel can be used to reduce statistics overhead by skipping certain +// types of stats in the stats collection process. +// Usage: +// options.statistics->set_stats_level(StatsLevel::kExceptTimeForMutex); enum StatsLevel : uint8_t { // Disable timer stats, and skip histogram stats kExceptHistogramOrTimers, @@ -464,7 +468,15 @@ enum StatsLevel : uint8_t { kAll, }; -// Analyze the performance of a db +// Analyze the performance of a db by providing cumulative stats over time. +// Usage: +// Options options; +// options.statistics = rocksdb::CreateDBStatistics(); +// Status s = DB::Open(options, kDBPath, &db); +// ... +// options.statistics->getTickerCount(NUMBER_BLOCK_COMPRESSED); +// HistogramData hist; +// options.statistics->histogramData(FLUSH_TIME, &hist); class Statistics { public: virtual ~Statistics() {}