Skip to content

Commit

Permalink
fix sent message stats
Browse files Browse the repository at this point in the history
  • Loading branch information
jlopp committed Feb 6, 2024
1 parent 05ad41b commit e6d141a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3831,6 +3831,9 @@ void CConnman::PushMessage(CNode* pnode, CSerializedNetMsg&& msg)
CaptureMessage(pnode->addr, msg.m_type, msg.data, /*is_incoming=*/false);
}

statsClient.count("bandwidth.message." + SanitizeString(msg.m_type.c_str()) + ".bytesSent", nMessageSize, 1.0f);
statsClient.inc("message.sent." + SanitizeString(msg.m_type.c_str()), 1.0f);

TRACE6(net, outbound_message,
pnode->GetId(),
pnode->m_addr_name.c_str(),
Expand Down Expand Up @@ -3867,9 +3870,6 @@ void CConnman::PushMessage(CNode* pnode, CSerializedNetMsg&& msg)
}
}
if (nBytesSent) RecordBytesSent(nBytesSent);

statsClient.count("bandwidth.message." + SanitizeString(msg.m_type.c_str()) + ".bytesSent", nBytesSent, 1.0f);
statsClient.inc("message.sent." + SanitizeString(msg.m_type.c_str()), 1.0f);
}

bool CConnman::ForNode(NodeId id, std::function<bool(CNode* pnode)> func)
Expand Down

0 comments on commit e6d141a

Please sign in to comment.