From: P2P-Next Date: Fri, 13 Aug 2010 13:04:20 +0000 (+0300) Subject: instrumentation/hrktorrent: log peer upload/download speed information X-Git-Tag: next-share-m32~10 X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=a818552cedccde15f78d031de56f70a01376556f;p=cs-p2p-next.git instrumentation/hrktorrent: log peer upload/download speed information --- 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++; }