From 3e7cb85816b2e819cbef8462f97b1565dda5e302 Mon Sep 17 00:00:00 2001 From: Alexey Rybalchenko Date: Thu, 12 Jan 2017 09:43:10 +0100 Subject: [PATCH] Fix incorrect calculation of transfer rate for multipart. --- fairmq/zeromq/FairMQSocketZMQ.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fairmq/zeromq/FairMQSocketZMQ.cxx b/fairmq/zeromq/FairMQSocketZMQ.cxx index 15ce5d2c..ee2eba7c 100644 --- a/fairmq/zeromq/FairMQSocketZMQ.cxx +++ b/fairmq/zeromq/FairMQSocketZMQ.cxx @@ -146,7 +146,6 @@ int64_t FairMQSocketZMQ::Send(const vector>& msgVec, c if (nbytes >= 0) { totalSize += nbytes; - fBytesTx += nbytes; } else { @@ -186,6 +185,7 @@ int64_t FairMQSocketZMQ::Send(const vector>& msgVec, c // store statistics on how many messages have been sent (handle all parts as a single message) ++fMessagesTx; + fBytesTx += totalSize; return totalSize; } // If there's only one part, send it as a regular message else if (msgVec.size() == 1) @@ -247,7 +247,6 @@ int64_t FairMQSocketZMQ::Receive(vector>& msgVec, cons { msgVec.push_back(move(part)); totalSize += nbytes; - fBytesRx += nbytes; } else { @@ -261,6 +260,7 @@ int64_t FairMQSocketZMQ::Receive(vector>& msgVec, cons // store statistics on how many messages have been received (handle all parts as a single message) ++fMessagesRx; + fBytesRx += totalSize; return totalSize; }