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
main
git-hulk 5 years ago committed by Facebook Github Bot
parent 979fbdc696
commit cdb6334e68
  1. 4
      monitoring/iostats_context.cc
  2. 5
      monitoring/perf_context.cc

@ -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

@ -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
}

Loading…
Cancel
Save