From a818552cedccde15f78d031de56f70a01376556f Mon Sep 17 00:00:00 2001 From: P2P-Next Date: Fri, 13 Aug 2010 16:04:20 +0300 Subject: [PATCH] instrumentation/hrktorrent: log peer upload/download speed information --- instrumentation/hrktorrent/core.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/instrumentation/hrktorrent/core.cpp b/instrumentation/hrktorrent/core.cpp index 159e05c..3f53046 100644 --- a/instrumentation/hrktorrent/core.cpp +++ b/instrumentation/hrktorrent/core.cpp @@ -144,15 +144,23 @@ CCore::StatusLoop(void* data) PrintStatusStream(output, columns, stdout_is_tty); output.str(""); + output << "--Peers: "; + /* build peer status message */ t->get_peer_info(peers); std::vector::iterator it = peers.begin(); while (it != peers.end()) { - std::cout << it->ip << std::endl; + output << "[ ip: " << it->ip; + output << ", dl: " << Round(it->down_speed/1024, 2); + output << ", ul: " << Round(it->up_speed/1024, 2); + output << " ]"; it++; } + PrintStatusStream(output, columns, stdout_is_tty); + output.str(""); + sleep(1); loopcount++; } -- 2.20.1