Measure compaction time.
Summary: just record time consumed in compaction Test Plan: compile Reviewers: dhruba Reviewed By: dhruba CC: leveldb Differential Revision: https://reviews.facebook.net/D8781
This commit is contained in:
parent
5024d72572
commit
959337ed5b
@ -1690,7 +1690,9 @@ Status DBImpl::DoCompactionWork(CompactionState* compact) {
|
|||||||
|
|
||||||
CompactionStats stats;
|
CompactionStats stats;
|
||||||
stats.micros = env_->NowMicros() - start_micros - imm_micros;
|
stats.micros = env_->NowMicros() - start_micros - imm_micros;
|
||||||
|
if (options_.statistics) {
|
||||||
|
options_.statistics->measureTime(COMPACTION_TIME, stats.micros);
|
||||||
|
}
|
||||||
stats.files_in_leveln = compact->compaction->num_input_files(0);
|
stats.files_in_leveln = compact->compaction->num_input_files(0);
|
||||||
stats.files_in_levelnp1 = compact->compaction->num_input_files(1);
|
stats.files_in_levelnp1 = compact->compaction->num_input_files(1);
|
||||||
|
|
||||||
|
@ -275,7 +275,7 @@ class DBImpl : public DB {
|
|||||||
// Per level compaction stats. stats_[level] stores the stats for
|
// Per level compaction stats. stats_[level] stores the stats for
|
||||||
// compactions that produced data for the specified "level".
|
// compactions that produced data for the specified "level".
|
||||||
struct CompactionStats {
|
struct CompactionStats {
|
||||||
int64_t micros;
|
uint64_t micros;
|
||||||
|
|
||||||
// Bytes read from level N during compaction between levels N and N+1
|
// Bytes read from level N during compaction between levels N and N+1
|
||||||
int64_t bytes_readn;
|
int64_t bytes_readn;
|
||||||
|
@ -49,7 +49,8 @@ enum Tickers {
|
|||||||
enum Histograms {
|
enum Histograms {
|
||||||
DB_GET = 0,
|
DB_GET = 0,
|
||||||
DB_WRITE = 1,
|
DB_WRITE = 1,
|
||||||
HISTOGRAM_ENUM_MAX = 2,
|
COMPACTION_TIME = 2,
|
||||||
|
HISTOGRAM_ENUM_MAX = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct HistogramData {
|
struct HistogramData {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user