|
|
|
@ -7,7 +7,6 @@ |
|
|
|
|
#define STORAGE_ROCKSDB_INCLUDE_STATISTICS_H_ |
|
|
|
|
|
|
|
|
|
#include <atomic> |
|
|
|
|
#include <cassert> |
|
|
|
|
#include <cstddef> |
|
|
|
|
#include <cstdint> |
|
|
|
|
#include <string> |
|
|
|
@ -18,10 +17,8 @@ namespace rocksdb { |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Keep adding ticker's here. |
|
|
|
|
* Any ticker should have a value less than TICKER_ENUM_MAX. |
|
|
|
|
* Add a new ticker by assigning it the current value of TICKER_ENUM_MAX |
|
|
|
|
* Add a string representation in TickersNameMap below. |
|
|
|
|
* And incrementing TICKER_ENUM_MAX. |
|
|
|
|
* 1. Any ticker should be added before TICKER_ENUM_MAX. |
|
|
|
|
* 2. Add a readable string in TickersNameMap below for the newly added ticker. |
|
|
|
|
*/ |
|
|
|
|
enum Tickers { |
|
|
|
|
// total block cache misses
|
|
|
|
@ -159,7 +156,7 @@ const std::vector<std::pair<Tickers, std::string>> TickersNameMap = { |
|
|
|
|
{ NUMBER_OF_RESEEKS_IN_ITERATION, "rocksdb.number.reseeks.iteration" }, |
|
|
|
|
{ GET_UPDATES_SINCE_CALLS, "rocksdb.getupdatessince.calls" }, |
|
|
|
|
{ BLOCK_CACHE_COMPRESSED_MISS, "rocksdb.block.cachecompressed.miss" }, |
|
|
|
|
{ BLOCK_CACHE_COMPRESSED_HIT, "rocksdb.block.cachecompressed.hit" } |
|
|
|
|
{ BLOCK_CACHE_COMPRESSED_HIT, "rocksdb.block.cachecompressed.hit" }, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -254,7 +251,7 @@ class Ticker { |
|
|
|
|
count_ = count; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
inline void recordTick(int count = 1) { |
|
|
|
|
inline void recordTick(int64_t count = 1) { |
|
|
|
|
count_ += count; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -269,13 +266,12 @@ class Ticker { |
|
|
|
|
// Analyze the performance of a db
|
|
|
|
|
class Statistics { |
|
|
|
|
public: |
|
|
|
|
|
|
|
|
|
virtual long getTickerCount(Tickers tickerType) = 0; |
|
|
|
|
virtual void recordTick(Tickers tickerType, uint64_t count = 0) = 0; |
|
|
|
|
virtual void setTickerCount(Tickers tickerType, uint64_t count) = 0; |
|
|
|
|
virtual void measureTime(Histograms histogramType, uint64_t time) = 0; |
|
|
|
|
|
|
|
|
|
virtual void histogramData(Histograms type, HistogramData * const data) = 0; |
|
|
|
|
virtual void histogramData(Histograms type, HistogramData* const data) = 0; |
|
|
|
|
// String representation of the statistic object.
|
|
|
|
|
std::string ToString(); |
|
|
|
|
}; |
|
|
|
|