tracing: add outbound connection tracepoint

This commit is contained in:
0xb10c
2022-05-02 16:27:13 +02:00
committed by 0xb10c
parent 85b2603eec
commit 4d61d52f43
3 changed files with 77 additions and 0 deletions

View File

@@ -54,6 +54,7 @@
#include <unordered_map>
TRACEPOINT_SEMAPHORE(net, inbound_connection);
TRACEPOINT_SEMAPHORE(net, outbound_connection);
TRACEPOINT_SEMAPHORE(net, outbound_message);
/** Maximum number of block-relay-only anchor connections */
@@ -3002,6 +3003,13 @@ void CConnman::OpenNetworkConnection(const CAddress& addrConnect, bool fCountFai
// update connection count by network
if (pnode->IsManualOrFullOutboundConn()) ++m_network_conn_counts[pnode->addr.GetNetwork()];
}
TRACEPOINT(net, outbound_connection,
pnode->GetId(),
pnode->m_addr_name.c_str(),
pnode->ConnectionTypeAsString().c_str(),
pnode->ConnectedThroughNetwork(),
GetNodeCount(ConnectionDirection::Out));
}
Mutex NetEventsInterface::g_msgproc_mutex;