improve number of peers metric (#4527)

Signed-off-by: Stefan <stefan.pingel@consensys.net>
pull/4546/head
Stefan Pingel 2 years ago committed by GitHub
parent 7cab18e978
commit 7c926d20ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthPeers.java
  2. 5
      ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/RlpxAgent.java

@ -94,6 +94,11 @@ public class EthPeers {
"pending_peer_requests_current",
"Number of peer requests currently pending because peers are busy",
pendingRequests::size);
metricsSystem.createIntegerGauge(
BesuMetricCategory.ETHEREUM,
"peer_count",
"The current number of peers connected",
() -> (int) streamAvailablePeers().count());
}
public void registerConnection(

@ -111,11 +111,6 @@ public class RlpxAgent {
metricsSystem.createCounter(
BesuMetricCategory.PEERS, "connected_total", "Total number of peers connected");
metricsSystem.createIntegerGauge(
BesuMetricCategory.ETHEREUM,
"peer_count",
"The current number of peers connected",
this::getConnectionCount);
metricsSystem.createIntegerGauge(
BesuMetricCategory.ETHEREUM,
"peer_limit",

Loading…
Cancel
Save