make statistics forward-able

Summary:
Make StatisticsImpl being able to forward stats to provided statistics
implementation. The main purpose is to allow us to collect internal
stats in the future even when user supplies custom statistics
implementation. It avoids intrumenting 2 sets of stats collection code.
One immediate use case is tuning advisor, which needs to collect some
internal stats, users may not be interested.

Test Plan:
ran db_bench and see stats show up at the end of run
Will run make all check since some tests rely on statistics

Reviewers: yhchiang, sdong, igor

Reviewed By: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D20145
This commit is contained in:
Lei Jin 2014-07-28 12:10:49 -07:00
parent 40fa8a4cd5
commit f6ca226c17
2 changed files with 2 additions and 0 deletions

View file

@ -276,6 +276,7 @@ Options SanitizeOptions(const std::string& dbname,
DBOptions SanitizeOptions(const std::string& dbname, const DBOptions& src) {
DBOptions result = src;
// result.max_open_files means an "infinite" open files.
if (result.max_open_files != -1) {
ClipToRange(&result.max_open_files, 20, 1000000);

View file

@ -86,4 +86,5 @@ inline void SetTickerCount(Statistics* statistics, uint32_t ticker_type,
statistics->setTickerCount(ticker_type, count);
}
}
}