Skip to content

Commit

Permalink
make statistics forward-able
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Lei Jin committed Jul 28, 2014
1 parent 40fa8a4 commit f6ca226
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions db/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions util/statistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,5 @@ inline void SetTickerCount(Statistics* statistics, uint32_t ticker_type,
statistics->setTickerCount(ticker_type, count);
}
}

}

0 comments on commit f6ca226

Please sign in to comment.