@@ -109,8 +109,8 @@ class Metrics:
109
109
# Variables to store the last block when we updated the RocksDB storage metrics
110
110
last_txstorage_data_block : Optional [int ] = None
111
111
112
- # Peers connected
113
- connected_peers : int = 0
112
+ # Peers ready
113
+ ready_peers : int = 0
114
114
# Peers handshaking
115
115
handshaking_peers : int = 0
116
116
# Peers connecting
@@ -200,7 +200,7 @@ def handle_publish(self, key: HathorEvents, args: EventArguments) -> None:
200
200
):
201
201
peers_connection_metrics : PeerConnectionsMetrics = data ["peers_count" ]
202
202
203
- self .connected_peers = peers_connection_metrics .connected_peers_count
203
+ self .ready_peers = peers_connection_metrics .ready_peers_count
204
204
self .connecting_peers = peers_connection_metrics .connecting_peers_count
205
205
self .handshaking_peers = peers_connection_metrics .handshaking_peers_count
206
206
self .known_peers = peers_connection_metrics .known_peers_count
@@ -247,14 +247,14 @@ def collect_peer_connection_metrics(self) -> None:
247
247
"""
248
248
self .peer_connection_metrics .clear ()
249
249
250
- for connection in self .connections .connections :
250
+ for connection in self .connections .get_connected_peers () :
251
251
if not connection ._peer :
252
252
# A connection without peer will not be able to communicate
253
253
# So we can just discard it for the sake of the metrics
254
254
continue
255
255
256
256
metric = PeerConnectionMetrics (
257
- connection_string = str (connection .entrypoint ) if connection . entrypoint else "" ,
257
+ connection_string = str (connection .addr ) ,
258
258
peer_id = str (connection .peer .id ),
259
259
network = settings .NETWORK_NAME ,
260
260
received_messages = connection .metrics .received_messages ,
0 commit comments