From c197b0109b21e0737711e21ad3ebdd61647b34ab Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 20 Sep 2020 13:50:56 -0700 Subject: [PATCH] modules/console: Add key count to db info summary. --- modules/console.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/console.cc b/modules/console.cc index 13baebc11..dfa4ebcef 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -5456,7 +5456,13 @@ try } else { - out << std::endl; + out + << std::endl + << std::left << std::setfill (' ') << std::setw(3) << "ID" + << " " << std::setw(20) << "NAME" + << " " << std::right << std::setw(12) << "KEYS" + << " " << std::left << std::setw(24) << "SIZE (COMPRESSED)" + << " :" << "DESCRIPTION" << std::endl; for(const auto &column : d.columns) { const auto explain @@ -5464,9 +5470,15 @@ try split(db::describe(*column).explain, '\n').first }; + const auto &num_keys + { + db::property(*column, "rocksdb.estimate-num-keys") + }; + out << std::left << std::setfill (' ') << std::setw(3) << db::id(*column) << " " << std::setw(20) << db::name(*column) - << " " << std::setw(24) << pretty(iec(db::bytes(*column))) + << " " << std::right << std::setw(12) << num_keys + << " " << std::left << std::setw(24) << pretty(iec(db::bytes(*column))) << " :" << explain << std::endl; } }