From 560bd5edad0adec0b4ea953662622ff825c2f864 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 1 Mar 2023 18:24:21 -0800 Subject: [PATCH] modules/console: Add param to filter db files cmd output by level. --- modules/console.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/console.cc b/modules/console.cc index a257edf19..d03a75bf3 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -4910,7 +4910,7 @@ try { const params param{line, " ", { - "dbname", "column" + "dbname", "column", "level" }}; const auto dbname @@ -4923,6 +4923,11 @@ try param.at("column", "*"_sv) }; + const auto level + { + param.at("level", -1) + }; + auto &database { db::database::get(dbname) @@ -4969,7 +4974,12 @@ try _print_sst_info_header(out); for(const auto &fileinfo : vector) + { + if(level != -1 && fileinfo.level != level) + continue; + _print_sst_info(out, fileinfo); + } out << std::endl; _print_totals(vector); @@ -5001,7 +5011,12 @@ try _print_sst_info_header(out); for(const auto &info : vector) + { + if(level != -1 && info.level != level) + continue; + _print_sst_info(out, info); + } out << std::endl; _print_totals(vector);