From cb447bde3826734baebbcb055cf357c7298490e4 Mon Sep 17 00:00:00 2001 From: Dennis Klein Date: Thu, 8 Mar 2018 03:08:42 +0100 Subject: [PATCH] FairMQ: Implement ofi::Socket data/message metrics --- fairmq/ofi/Socket.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/fairmq/ofi/Socket.cxx b/fairmq/ofi/Socket.cxx index 3093574f..38bb2d29 100644 --- a/fairmq/ofi/Socket.cxx +++ b/fairmq/ofi/Socket.cxx @@ -43,6 +43,10 @@ Socket::Socket(Context& context, const string& type, const string& name, const s , fContext(context) , fWaitingForControlPeer(false) , fIoStrand(fContext.GetIoContext()) + , fBytesTx(0) + , fBytesRx(0) + , fMessagesTx(0) + , fMessagesRx(0) { if (type != "pair") { 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))); } - // TODO free msg on tx completion? + msg.reset(nullptr); + fBytesTx += size; + fMessagesTx++; return size; } @@ -384,6 +390,9 @@ try { assert(cqEntry.buf == buf); } + fBytesRx += size; + fMessagesRx++; + return size; } catch (const SilentSocketError& e)