diff --git a/modules/console.cc b/modules/console.cc index 9da711fb7..58c2c7e06 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -948,6 +948,35 @@ console_cmd__env(opt &out, const string_view &line) return true; } +// +// stats +// + +bool +console_cmd__stats(opt &out, const string_view &line) +{ + for(const auto &[name, item] : stats::items) + { + static constexpr size_t name_width {60}; + + assert(item); + const auto trunc_name(trunc(name, name_width)); + out << std::left << std::setw(name_width) << trunc_name; + + if(size(trunc_name) == name_width) + out << "..."; + else + out << " "; + + out << " " + << std::left << (*item) + << std::endl + ; + } + + return true; +} + // // ios //