diff --git a/util/statistics.cc b/util/statistics.cc index f19a777c1..a850445ed 100644 --- a/util/statistics.cc +++ b/util/statistics.cc @@ -5,6 +5,7 @@ // #include "util/statistics.h" #include "rocksdb/statistics.h" +#include #include namespace rocksdb { @@ -13,7 +14,11 @@ std::shared_ptr CreateDBStatistics() { return std::make_shared(); } -StatisticsImpl::StatisticsImpl() {} +StatisticsImpl::StatisticsImpl() { + // Fill tickers_ with "zero". To ensure plasform indepedent, we used + // uint_fast64_t() instead literal `0` to represent zero. + std::fill(tickers_, tickers_ + TICKER_ENUM_MAX, uint_fast64_t()); +} StatisticsImpl::~StatisticsImpl() {}