Skip to content

Commit

Permalink
log: reduce some rocksdb statistics log (#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 authored May 15, 2019
1 parent c9488b7 commit 5cf8b7a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/server/pegasus_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2221,34 +2221,34 @@ void pegasus_server_impl::update_replica_rocksdb_statistics()
}
}
_pfc_rdb_sst_count->set(val);
ddebug_replica("_pfc_rdb_sst_count: {}", val);
dinfo_replica("_pfc_rdb_sst_count: {}", val);

if (_db->GetProperty(rocksdb::DB::Properties::kTotalSstFilesSize, &str_val) &&
dsn::buf2uint64(str_val, val)) {
static uint64_t bytes_per_mb = 1U << 20U;
_pfc_rdb_sst_size->set(val / bytes_per_mb);
ddebug_replica("_pfc_rdb_sst_size: {} bytes", val);
dinfo_replica("_pfc_rdb_sst_size: {} bytes", val);
}

uint64_t block_cache_hit = _statistics->getTickerCount(rocksdb::BLOCK_CACHE_HIT);
_pfc_rdb_block_cache_hit_count->set(block_cache_hit);
ddebug_replica("_pfc_rdb_block_cache_hit_count: {}", block_cache_hit);
dinfo_replica("_pfc_rdb_block_cache_hit_count: {}", block_cache_hit);

uint64_t block_cache_miss = _statistics->getTickerCount(rocksdb::BLOCK_CACHE_MISS);
uint64_t block_cache_total = block_cache_hit + block_cache_miss;
_pfc_rdb_block_cache_total_count->set(block_cache_total);
ddebug_replica("_pfc_rdb_block_cache_total_count: {}", block_cache_total);
dinfo_replica("_pfc_rdb_block_cache_total_count: {}", block_cache_total);

if (_db->GetProperty(rocksdb::DB::Properties::kEstimateTableReadersMem, &str_val) &&
dsn::buf2uint64(str_val, val)) {
_pfc_rdb_index_and_filter_blocks_mem_usage->set(val);
ddebug_replica("_pfc_rdb_index_and_filter_blocks_mem_usage: {} bytes", val);
dinfo_replica("_pfc_rdb_index_and_filter_blocks_mem_usage: {} bytes", val);
}

if (_db->GetProperty(rocksdb::DB::Properties::kCurSizeAllMemTables, &str_val) &&
dsn::buf2uint64(str_val, val)) {
_pfc_rdb_memtable_mem_usage->set(val);
ddebug_replica("_pfc_rdb_memtable_mem_usage: {} bytes", val);
dinfo_replica("_pfc_rdb_memtable_mem_usage: {} bytes", val);
}
}

Expand All @@ -2257,9 +2257,9 @@ void pegasus_server_impl::update_server_rocksdb_statistics()
if (_block_cache) {
uint64_t val = _block_cache->GetUsage();
_pfc_rdb_block_cache_mem_usage->set(val);
ddebug_f("_pfc_rdb_block_cache_mem_usage: {} bytes", val);
dinfo_f("_pfc_rdb_block_cache_mem_usage: {} bytes", val);
} else {
ddebug("_pfc_rdb_block_cache_mem_usage: 0 bytes because block cache is diabled");
dinfo("_pfc_rdb_block_cache_mem_usage: 0 bytes because block cache is disabled");
}
}

Expand Down

0 comments on commit 5cf8b7a

Please sign in to comment.