Skip to content

Commit

Permalink
Fix peer count by client metric (#4999)
Browse files Browse the repository at this point in the history
  • Loading branch information
wemeetagain committed Jan 13, 2023
1 parent 0582f41 commit 8ab220a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/beacon-node/src/network/peers/peerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,11 @@ export class PeerManager {
metrics.peerLongLivedAttnets.reset();
metrics.peerConnectionLength.reset();

// reset client counts _for each client_ to 0
for (const client of Object.values(ClientKind)) {
peersByClient.set(client, 0);
}

for (const connections of getConnectionsMap(this.libp2p.connectionManager).values()) {
const openCnx = connections.find((cnx) => cnx.stat.status === "OPEN");
if (openCnx) {
Expand Down

0 comments on commit 8ab220a

Please sign in to comment.