From ec7bba0793d70d248c1fb011cff09cf25631da55 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Thu, 25 Jun 2020 13:03:24 +0000 Subject: util: fix kilo prefix typo (K instead of k) --- src/common/util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/util.cpp b/src/common/util.cpp index f1140d1d5..0a2f9da3a 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} -- cgit v1.2.3 From afd002c31fbaf6028a3dbb354843184fe5adc1a9 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Thu, 25 Jun 2020 13:03:59 +0000 Subject: daemon: print sampling time in print_net_stats --- src/daemon/rpc_command_executor.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp index 034d49918..05e7b8a6b 100644 --- a/src/daemon/rpc_command_executor.cpp +++ b/src/daemon/rpc_command_executor.cpp @@ -722,10 +722,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); @@ -733,10 +734,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); -- cgit v1.2.3