aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Blair <snipa@jagtech.io>2020-08-16 12:47:36 -0700
committerAlexander Blair <snipa@jagtech.io>2020-08-16 12:47:36 -0700
commit0b0da2aa81e1642fb7fb218b052313d9790c11fb (patch)
tree846e4ea9a5f3c1d4250171b077a66f721eb0f0d4
parentMerge pull request #6679 (diff)
parentdaemon: print sampling time in print_net_stats (diff)
downloadmonero-0b0da2aa81e1642fb7fb218b052313d9790c11fb.tar.xz
Merge pull request #6689
afd002c31 daemon: print sampling time in print_net_stats (moneromooo-monero) ec7bba079 util: fix kilo prefix typo (K instead of k) (moneromooo-monero)
-rw-r--r--src/common/util.cpp2
-rw-r--r--src/daemon/rpc_command_executor.cpp6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/common/util.cpp b/src/common/util.cpp
index 138ac4294..433cb4919 100644
--- a/src/common/util.cpp
+++ b/src/common/util.cpp
@@ -1116,7 +1116,7 @@ std::string get_nix_version_display_string()
static constexpr const byte_map sizes[] =
{
{"%.0f B", 1024},
- {"%.2f KB", 1024 * 1024},
+ {"%.2f kB", 1024 * 1024},
{"%.2f MB", std::uint64_t(1024) * 1024 * 1024},
{"%.2f GB", std::uint64_t(1024) * 1024 * 1024 * 1024},
{"%.2f TB", std::uint64_t(1024) * 1024 * 1024 * 1024 * 1024}
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp
index 77dfe332f..2514491ef 100644
--- a/src/daemon/rpc_command_executor.cpp
+++ b/src/daemon/rpc_command_executor.cpp
@@ -721,10 +721,11 @@ bool t_rpc_command_executor::print_net_stats()
uint64_t average = seconds > 0 ? net_stats_res.total_bytes_in / seconds : 0;
uint64_t limit = limit_res.limit_down * 1024; // convert to bytes, as limits are always kB/s
double percent = (double)average / (double)limit * 100.0;
- tools::success_msg_writer() << boost::format("Received %u bytes (%s) in %u packets, average %s/s = %.2f%% of the limit of %s/s")
+ tools::success_msg_writer() << boost::format("Received %u bytes (%s) in %u packets in %s, average %s/s = %.2f%% of the limit of %s/s")
% net_stats_res.total_bytes_in
% tools::get_human_readable_bytes(net_stats_res.total_bytes_in)
% net_stats_res.total_packets_in
+ % tools::get_human_readable_timespan(seconds)
% tools::get_human_readable_bytes(average)
% percent
% tools::get_human_readable_bytes(limit);
@@ -732,10 +733,11 @@ bool t_rpc_command_executor::print_net_stats()
average = seconds > 0 ? net_stats_res.total_bytes_out / seconds : 0;
limit = limit_res.limit_up * 1024;
percent = (double)average / (double)limit * 100.0;
- tools::success_msg_writer() << boost::format("Sent %u bytes (%s) in %u packets, average %s/s = %.2f%% of the limit of %s/s")
+ tools::success_msg_writer() << boost::format("Sent %u bytes (%s) in %u packets in %s, average %s/s = %.2f%% of the limit of %s/s")
% net_stats_res.total_bytes_out
% tools::get_human_readable_bytes(net_stats_res.total_bytes_out)
% net_stats_res.total_packets_out
+ % tools::get_human_readable_timespan(seconds)
% tools::get_human_readable_bytes(average)
% percent
% tools::get_human_readable_bytes(limit);