@@ -895,17 +895,25 @@ PeerImp::doProtocolStart()
895895void
896896PeerImp::onReadMessage (error_code ec, std::size_t bytes_transferred)
897897{
898- if (!socket_.is_open ())
898+ app_.overlay ().incTotalPeerInbound ();
899+ if (!socket_.is_open ()) {
900+ app_.overlay ().incTotalPeerInboundEarlyReturn ();
899901 return ;
900- if (ec == boost::asio::error::operation_aborted)
902+ }
903+ if (ec == boost::asio::error::operation_aborted) {
904+ app_.overlay ().incTotalPeerInboundEarlyReturn ();
901905 return ;
906+ }
902907 if (ec == boost::asio::error::eof)
903908 {
904909 JLOG (journal_.info ()) << " EOF" ;
910+ app_.overlay ().incTotalPeerInboundEarlyReturn ();
905911 return gracefulClose ();
906912 }
907- if (ec)
913+ if (ec) {
914+ app_.overlay ().incTotalPeerInboundEarlyReturn ();
908915 return fail (" onReadMessage" , ec);
916+ }
909917 if (auto stream = journal_.trace ())
910918 {
911919 if (bytes_transferred > 0 )
@@ -914,6 +922,8 @@ PeerImp::onReadMessage(error_code ec, std::size_t bytes_transferred)
914922 stream << " onReadMessage" ;
915923 }
916924
925+ app_.overlay ().addTotalPeerInboundBytes (bytes_transferred);
926+
917927 metrics_.recv .add_message (bytes_transferred);
918928
919929 read_buffer_.commit (bytes_transferred);
@@ -927,7 +937,9 @@ PeerImp::onReadMessage(error_code ec, std::size_t bytes_transferred)
927937 using namespace std ::chrono_literals;
928938 std::tie (bytes_consumed, ec) = perf::measureDurationAndLog (
929939 [&]() {
930- return invokeProtocolMessage (read_buffer_.data (), *this , hint);
940+ return invokeProtocolMessage (read_buffer_.data (), *this , hint,
941+ [this ]() { app_.overlay ().incTotalPeerInboundComplete (); },
942+ [this ]() { app_.overlay ().incTotalPeerInboundPropose (); });
931943 },
932944 " invokeProtocolMessage" ,
933945 350ms,
0 commit comments