Fix incorrect calculation of transfer rate for multipart.

This commit is contained in:
Alexey Rybalchenko 2017-01-12 09:43:10 +01:00 committed by Mohammad Al-Turany
parent 8cf1cbb930
commit 3e7cb85816

View File

@ -146,7 +146,6 @@ int64_t FairMQSocketZMQ::Send(const vector<unique_ptr<FairMQMessage>>& msgVec, c
if (nbytes >= 0) if (nbytes >= 0)
{ {
totalSize += nbytes; totalSize += nbytes;
fBytesTx += nbytes;
} }
else else
{ {
@ -186,6 +185,7 @@ int64_t FairMQSocketZMQ::Send(const vector<unique_ptr<FairMQMessage>>& msgVec, c
// store statistics on how many messages have been sent (handle all parts as a single message) // store statistics on how many messages have been sent (handle all parts as a single message)
++fMessagesTx; ++fMessagesTx;
fBytesTx += totalSize;
return totalSize; return totalSize;
} // If there's only one part, send it as a regular message } // If there's only one part, send it as a regular message
else if (msgVec.size() == 1) else if (msgVec.size() == 1)
@ -247,7 +247,6 @@ int64_t FairMQSocketZMQ::Receive(vector<unique_ptr<FairMQMessage>>& msgVec, cons
{ {
msgVec.push_back(move(part)); msgVec.push_back(move(part));
totalSize += nbytes; totalSize += nbytes;
fBytesRx += nbytes;
} }
else else
{ {
@ -261,6 +260,7 @@ int64_t FairMQSocketZMQ::Receive(vector<unique_ptr<FairMQMessage>>& msgVec, cons
// store statistics on how many messages have been received (handle all parts as a single message) // store statistics on how many messages have been received (handle all parts as a single message)
++fMessagesRx; ++fMessagesRx;
fBytesRx += totalSize;
return totalSize; return totalSize;
} }