aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/server.go
diff options
context:
space:
mode:
authorCliff Lin <zylin@cs.nctu.edu.tw>2019-03-14 11:07:31 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 13:50:04 +0800
commitdabcfb97277f8a1b4dc1daa88a964a2e6b2c93b5 (patch)
tree3324993103e27d2ae9bd8b9d21629ac987166240 /p2p/server.go
parentc8d3a2ba9abfc548073eb8e78659fd5a5ce849b5 (diff)
downloaddexon-dabcfb97277f8a1b4dc1daa88a964a2e6b2c93b5.tar.gz
dexon-dabcfb97277f8a1b4dc1daa88a964a2e6b2c93b5.tar.zst
dexon-dabcfb97277f8a1b4dc1daa88a964a2e6b2c93b5.zip
p2p: report peer counts to datadog (#254)
Diffstat (limited to 'p2p/server.go')
-rw-r--r--p2p/server.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/p2p/server.go b/p2p/server.go
index 58b76a708..c1cf0f9fe 100644
--- a/p2p/server.go
+++ b/p2p/server.go
@@ -808,6 +808,7 @@ running:
}
name := truncateName(c.name)
srv.log.Debug("Adding p2p peer", "name", name, "addr", c.fd.RemoteAddr(), "peers", len(peers)+1)
+ peerCounts.Update(int64((len(peers) + 1)))
go srv.runPeer(p)
peers[c.node.ID()] = p
if p.Inbound() {
@@ -830,6 +831,7 @@ running:
if pd.Inbound() {
inboundCount--
}
+ peerCounts.Update(int64(len(peers)))
}
}