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. 11
      db/db_impl.cc
  2. 2
      util/posix_logger.h

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

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

Loading…
Cancel
Save