From ffbb9e23ef65fc5b6b7323d8183d9ea70c80b005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= Date: Wed, 27 Jun 2018 11:54:15 -0400 Subject: [PATCH] dht: show usage at the end, print max store size --- src/dht.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/dht.cpp b/src/dht.cpp index 46ff08f3..6bd42e26 100644 --- a/src/dht.cpp +++ b/src/dht.cpp @@ -1585,11 +1585,6 @@ Dht::getStorageLog() const std::stringstream out; for (const auto& s : store) out << printStorageLog(s); - out << "Total " << store.size() << " storages, " << total_values << " values ("; - if (total_store_size < 1024) - out << total_store_size << " bytes)"; - else - out << (total_store_size/1024) << " KB)"; out << std::endl << std::endl; std::multimap q_map; for (const auto& ip : store_quota) @@ -1598,6 +1593,12 @@ Dht::getStorageLog() const for (auto ip = q_map.rbegin(); ip != q_map.rend(); ++ip) out << "IP " << ip->second->toString() << " uses " << ip->first << " bytes" << std::endl; out << std::endl; + out << "Total " << store.size() << " storages, " << total_values << " values ("; + if (total_store_size < 1024) + out << total_store_size << " bytes)"; + else + out << (total_store_size/1024) << " / " << (max_store_size/1024) << " KB)"; + out << std::endl; return out.str(); }