Skip to content

Commit

Permalink
add simple db memory usage info
Browse files Browse the repository at this point in the history
  • Loading branch information
flabby committed Jul 14, 2016
1 parent dd995ba commit 4e49fb6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pika_admin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,13 @@ void InfoCmd::InfoData(std::string &info) {
tmp_stream << "compression:" << g_pika_conf->compression() << "\r\n";
tmp_stream << "used_memory:" << db_size << "\r\n";

uint64_t usage;
g_pika_server->db()->GetUsage(nemo::USAGE_TYPE_ROCKSDB_MEMTABLE, &usage);
tmp_stream << "db_memtable_usage:" << usage << "Bytes\r\n";

g_pika_server->db()->GetUsage(nemo::USAGE_TYPE_ROCKSDB_TABLE_READER, &usage);
tmp_stream << "db_tablereader_usage:" << usage << "Bytes\r\n";

info.append(tmp_stream.str());
return;
}
Expand Down

0 comments on commit 4e49fb6

Please sign in to comment.