Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log: reduce some rocksdb statistics log #326

Merged
merged 3 commits into from
May 15, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 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 Expand Up @@ -2470,7 +2470,7 @@ std::string pegasus_server_impl::compression_type_to_str(rocksdb::CompressionTyp
bool pegasus_server_impl::set_usage_scenario(const std::string &usage_scenario)
{
if (usage_scenario == _usage_scenario)
return false;
return true;
std::unordered_map<std::string, std::string> new_options;
if (usage_scenario == ROCKSDB_ENV_USAGE_SCENARIO_NORMAL ||
usage_scenario == ROCKSDB_ENV_USAGE_SCENARIO_PREFER_WRITE) {
Expand Down