From ff61342c01b88aa48ff0575182158843845c675c Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 16 May 2019 23:27:31 -0700 Subject: [PATCH] modules/console: Show number of keys in event_horizon when no event_id given. --- modules/console.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/console.cc b/modules/console.cc index 89bab57b0..319b0e4bc 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -6438,11 +6438,22 @@ console_cmd__event__horizon(opt &out, const string_view &line) "event_id", }}; - const m::event::id &event_id + const string_view &event_id { - param.at("event_id") + param["event_id"] }; + if(!event_id) + { + const auto &num_keys + { + db::property(m::dbs::event_horizon, "rocksdb.estimate-num-keys") + }; + + out << "Estimated event_id's unresolved: " << num_keys << '.' << std::endl; + return true; + } + char buf[m::dbs::EVENT_HORIZON_KEY_MAX_SIZE]; const string_view &key {