From: Igor Fedotov Date: Fri, 3 Feb 2023 12:08:01 +0000 (+0300) Subject: os/bluestore: beautify disk size output for volume selector X-Git-Tag: v18.1.0~14^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2a93e204b364b5c96a5a09002a152c454c6f4848;p=ceph.git os/bluestore: beautify disk size output for volume selector Signed-off-by: Igor Fedotov (cherry picked from commit 326eabe7442acfa67c600e3ff04b7b5efb13a3c2) --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index fd7ebd89fde..24133f8edee 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -18099,11 +18099,8 @@ void* RocksDBBlueFSVolumeSelector::get_hint_by_dir(std::string_view dirname) con void RocksDBBlueFSVolumeSelector::dump(ostream& sout) { auto max_x = per_level_per_dev_usage.get_max_x(); auto max_y = per_level_per_dev_usage.get_max_y(); - sout << "RocksDBBlueFSVolumeSelector: wal_total:" << l_totals[LEVEL_WAL - LEVEL_FIRST] - << ", db_total:" << l_totals[LEVEL_DB - LEVEL_FIRST] - << ", slow_total:" << l_totals[LEVEL_SLOW - LEVEL_FIRST] - << ", db_avail:" << db_avail4slow << std::endl - << "Usage matrix:" << std::endl; + + sout << "RocksDBBlueFSVolumeSelector Usage Matrix:" << std::endl; constexpr std::array names{ { "DEV/LEV", "WAL", @@ -18134,7 +18131,7 @@ void RocksDBBlueFSVolumeSelector::dump(ostream& sout) { case LEVEL_SLOW: sout << "SLOW"; break; case LEVEL_MAX: - sout << "TOTALS"; break; + sout << "TOTAL"; break; } for (size_t d = 0; d < max_x; d++) { sout.setf(std::ios::left, std::ios::adjustfield); @@ -18161,7 +18158,7 @@ void RocksDBBlueFSVolumeSelector::dump(ostream& sout) { case LEVEL_SLOW: sout << "SLOW"; break; case LEVEL_MAX: - sout << "TOTALS"; break; + sout << "TOTAL"; break; } for (size_t d = 0; d < max_x - 1; d++) { sout.setf(std::ios::left, std::ios::adjustfield); @@ -18171,10 +18168,20 @@ void RocksDBBlueFSVolumeSelector::dump(ostream& sout) { sout.setf(std::ios::left, std::ios::adjustfield); sout.width(width); sout << stringify(byte_u_t(per_level_per_dev_max.at(max_x - 1, l))); - if (l < max_y - 1) { - sout << std::endl; - } + sout << std::endl; } + string sizes[] = { + ">> SIZE <<", + stringify(byte_u_t(l_totals[LEVEL_WAL - LEVEL_FIRST])), + stringify(byte_u_t(l_totals[LEVEL_DB - LEVEL_FIRST])), + stringify(byte_u_t(l_totals[LEVEL_SLOW - LEVEL_FIRST])), + }; + for (size_t i = 0; i < (sizeof(sizes) / sizeof(sizes[0])); i++) { + sout.setf(std::ios::left, std::ios::adjustfield); + sout.width(width); + sout << sizes[i]; + } + sout << std::endl; } BlueFSVolumeSelector* RocksDBBlueFSVolumeSelector::clone_empty() const {