)// Stats represents a point-in-time snapshot of bandwidth metrics.//// The TotalIn and TotalOut fields record cumulative bytes sent / received.// The RateIn and RateOut fields record bytes sent / received per second.typeStatsstruct{TotalInint64TotalOutint64RateInfloat64RateOutfloat64}// Reporter provides methods for logging and retrieving metrics.typeReporterinterface{LogSentMessage(int64)LogRecvMessage(int64)LogSentMessageStream(int64,protocol.ID,peer.ID)LogRecvMessageStream(int64,protocol.ID,peer.ID)GetBandwidthForPeer(peer.ID)StatsGetBandwidthForProtocol(protocol.ID)StatsGetBandwidthTotals()StatsGetBandwidthByPeer()map[peer.ID]StatsGetBandwidthByProtocol()map[protocol.ID]Stats}