From 3ce5e291e746a06a523deb7a1046d0d02cd67a86 Mon Sep 17 00:00:00 2001 From: William Banfield Date: Mon, 31 Oct 2022 17:42:57 -0400 Subject: [PATCH] document new metrics --- p2p/peer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/p2p/peer.go b/p2p/peer.go index d7f3d6a93..82af52703 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -260,6 +260,8 @@ func (p *peer) Status() tmconn.ConnectionStatus { // SendEnvelope sends the message in the envelope on the channel specified by the // envelope. Returns false if the connection times out trying to place the message // onto its internal queue. +// Using SendEnvelope allows for tracking the message bytes sent and received by message type +// as a metric which Send cannot support. func (p *peer) SendEnvelope(e Envelope) bool { if !p.IsRunning() { return false @@ -305,7 +307,8 @@ func (p *peer) Send(chID byte, msgBytes []byte) bool { // TrySendEnvelope attempts to sends the message in the envelope on the channel specified by the // envelope. Returns false immediately if the connection's internal queue is full -// TrySendEnvelope replaces TrySend which will be deprecated in a future release. +// Using TrySendEnvelope allows for tracking the message bytes sent and received by message type +// as a metric which TrySend cannot support. func (p *peer) TrySendEnvelope(e Envelope) bool { if !p.IsRunning() { // see Switch#Broadcast, where we fetch the list of peers and loop over @@ -333,6 +336,7 @@ func (p *peer) TrySendEnvelope(e Envelope) bool { // TrySend msg bytes to the channel identified by chID byte. Immediately returns // false if the send queue is full. +// TrySendEnvelope replaces TrySend which will be deprecated in a future release. func (p *peer) TrySend(chID byte, msgBytes []byte) bool { if !p.IsRunning() { return false