FairMQ: Implement ofi::Socket data/message metrics

This commit is contained in:
Dennis Klein 2018-03-08 03:08:42 +01:00 committed by Mohammad Al-Turany
parent c5072ea425
commit cb447bde38

View File

@ -43,6 +43,10 @@ Socket::Socket(Context& context, const string& type, const string& name, const s
, fContext(context) , fContext(context)
, fWaitingForControlPeer(false) , fWaitingForControlPeer(false)
, fIoStrand(fContext.GetIoContext()) , fIoStrand(fContext.GetIoContext())
, fBytesTx(0)
, fBytesRx(0)
, fMessagesTx(0)
, fMessagesRx(0)
{ {
if (type != "pair") { if (type != "pair") {
throw SocketError{tools::ToString("Socket type '", type, "' not implemented for ofi transport.")}; throw SocketError{tools::ToString("Socket type '", type, "' not implemented for ofi transport.")};
@ -331,7 +335,9 @@ try {
throw SocketError(tools::ToString("Failed reading ofi tx completion queue event, reason: ", fi_strerror(ret))); throw SocketError(tools::ToString("Failed reading ofi tx completion queue event, reason: ", fi_strerror(ret)));
} }
// TODO free msg on tx completion? msg.reset(nullptr);
fBytesTx += size;
fMessagesTx++;
return size; return size;
} }
@ -384,6 +390,9 @@ try {
assert(cqEntry.buf == buf); assert(cqEntry.buf == buf);
} }
fBytesRx += size;
fMessagesRx++;
return size; return size;
} }
catch (const SilentSocketError& e) catch (const SilentSocketError& e)