MOD: trim last space and comma in perf context and iostat context ToString()

Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/5755

Differential Revision: D17165190

Pulled By: riversand963

fbshipit-source-id: a3a4633961bfe019bf360f97a4c4d36464e7fa0b
This commit is contained in:
git-hulk 2019-09-03 11:21:47 -07:00 committed by Facebook Github Bot
parent 979fbdc696
commit cdb6334e68
2 changed files with 7 additions and 2 deletions

View File

@ -54,7 +54,9 @@ std::string IOStatsContext::ToString(bool exclude_zero_counters) const {
IOSTATS_CONTEXT_OUTPUT(prepare_write_nanos);
IOSTATS_CONTEXT_OUTPUT(logger_nanos);
return ss.str();
std::string str = ss.str();
str.erase(str.find_last_not_of(", ") + 1);
return str;
}
} // namespace rocksdb

View File

@ -529,7 +529,10 @@ std::string PerfContext::ToString(bool exclude_zero_counters) const {
PERF_CONTEXT_BY_LEVEL_OUTPUT_ONE_COUNTER(bloom_filter_full_true_positive);
PERF_CONTEXT_BY_LEVEL_OUTPUT_ONE_COUNTER(block_cache_hit_count);
PERF_CONTEXT_BY_LEVEL_OUTPUT_ONE_COUNTER(block_cache_miss_count);
return ss.str();
std::string str = ss.str();
str.erase(str.find_last_not_of(", ") + 1);
return str;
#endif
}