diff options
author | Cliff Lin <zylin@cs.nctu.edu.tw> | 2019-03-14 11:07:31 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:58 +0800 |
commit | 96340d7e6d81298780888bef417982586ff81466 (patch) | |
tree | 17a6bf1fcfd078182c8e8ef6fcc6a79a89a151bb /p2p/server.go | |
parent | a6580f578e49463eea0e3e89ab0a1c598c3b9ab6 (diff) | |
download | dexon-96340d7e6d81298780888bef417982586ff81466.tar dexon-96340d7e6d81298780888bef417982586ff81466.tar.gz dexon-96340d7e6d81298780888bef417982586ff81466.tar.bz2 dexon-96340d7e6d81298780888bef417982586ff81466.tar.lz dexon-96340d7e6d81298780888bef417982586ff81466.tar.xz dexon-96340d7e6d81298780888bef417982586ff81466.tar.zst dexon-96340d7e6d81298780888bef417982586ff81466.zip |
p2p: report peer counts to datadog (#254)
Diffstat (limited to 'p2p/server.go')
-rw-r--r-- | p2p/server.go | 2 |
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))) } } |