diff --git a/libp2p/stream/chronosstream.nim b/libp2p/stream/chronosstream.nim index bf9515d21..d2db6cebf 100644 --- a/libp2p/stream/chronosstream.nim +++ b/libp2p/stream/chronosstream.nim @@ -103,11 +103,11 @@ method readOnce*(s: ChronosStream, pbytes: pointer, nbytes: int): Future[int] {. withExceptions: result = await s.client.readOnce(pbytes, nbytes) s.activity = true # reset activity flag - libp2p_network_bytes.inc(nbytes.int64, labelValues = ["in"]) + libp2p_network_bytes.inc(result.int64, labelValues = ["in"]) when defined(libp2p_agents_metrics): s.trackPeerIdentity() if s.tracked: - libp2p_peers_traffic_read.inc(nbytes.int64, labelValues = [s.shortAgent]) + libp2p_peers_traffic_read.inc(result.int64, labelValues = [s.shortAgent]) proc completeWrite( s: ChronosStream, fut: Future[int], msgLen: int): Future[void] {.async.} =