Show More DB Stats in info logs

Summary:
DB Stats now are truncated if there are too many CFs. Extend the buffer size to allow more to be printed out. Also, separate out malloc to another log line.
Closes https://github.com/facebook/rocksdb/pull/1439

Differential Revision: D4100943

Pulled By: yiwu-arbug

fbshipit-source-id: 79f7218
main
Siying Dong 8 years ago committed by Facebook Github Bot
parent 1b295ac8ae
commit c90c48d3c8
  1. 13
      db/db_impl.cc
  2. 2
      util/posix_logger.h

@ -634,13 +634,20 @@ void DBImpl::MaybeDumpStats() {
default_cf_internal_stats_->GetStringProperty(
*db_property_info, DB::Properties::kDBStats, &stats);
}
if (immutable_db_options_.dump_malloc_stats) {
DumpMallocStats(&stats);
}
Log(InfoLogLevel::WARN_LEVEL, immutable_db_options_.info_log,
"------- DUMPING STATS -------");
Log(InfoLogLevel::WARN_LEVEL, immutable_db_options_.info_log, "%s",
stats.c_str());
if (immutable_db_options_.dump_malloc_stats) {
stats.clear();
DumpMallocStats(&stats);
if (!stats.empty()) {
Log(InfoLogLevel::WARN_LEVEL, immutable_db_options_.info_log,
"------- Malloc STATS -------");
Log(InfoLogLevel::WARN_LEVEL, immutable_db_options_.info_log, "%s",
stats.c_str());
}
}
#endif // !ROCKSDB_LITE
PrintStatistics();

@ -80,7 +80,7 @@ class PosixLogger : public Logger {
bufsize = sizeof(buffer);
base = buffer;
} else {
bufsize = 30000;
bufsize = 65536;
base = new char[bufsize];
}
char* p = base;

Loading…
Cancel
Save