From ca019e26010869d03d6ffed1b13abb6d18ac3caa Mon Sep 17 00:00:00 2001 From: hama Date: Sun, 22 Mar 2015 19:48:18 +0100 Subject: [PATCH] current rate in dirtool TCP test --- os/ReDirTools.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/os/ReDirTools.cpp b/os/ReDirTools.cpp index 53ff136..457d25f 100644 --- a/os/ReDirTools.cpp +++ b/os/ReDirTools.cpp @@ -2433,17 +2433,23 @@ void ReDirTCP::runOneThreadClient(const char* ip, int port, int rounds, int duration = 0; ReByteBuffer answer, data; client.setLogSendReceive(false); + int64_t sizeCurrent = 0; for (int ii = 0; ii < rounds; ii++) { client.send(command, message.str(), message.length()); client.receive(answer, data); size += message.length() + data.length(); + sizeCurrent += message.length() + data.length(); time_t now = time(NULL); if (now >= lastPrint + interval) { duration = int(now - start); - printf("%2d: %9.3f MiByte %8.3f kiByte/sec %s\n", ii, - size / 1024.0 / 1024, (double) size / duration / 1024, + int durationCurrent = int(now - lastPrint); + printf("%2d: %9.3f MiByte %8.3f / %8.3f kiByte/sec %s\n", ii, + size / 1024.0 / 1024, + (double) sizeCurrent / durationCurrent / 1024, + (double) size / duration / 1024, upload ? "up" : "down"); lastPrint = now; + sizeCurrent = 0; } } duration = int(time(NULL) - start); -- 2.39.5