Struct libp2p::bandwidth::BandwidthSinks
source · pub struct BandwidthSinks { /* private fields */ }
Expand description
Allows obtaining the average bandwidth of the connections created from a BandwidthLogging
.
Implementations§
source§impl BandwidthSinks
impl BandwidthSinks
sourcepub fn total_inbound(&self) -> u64
pub fn total_inbound(&self) -> u64
Returns the total number of bytes that have been downloaded on all the connections spawned
through the BandwidthLogging
.
Note: This method is by design subject to race conditions. The returned value should only ever be used for statistics purposes.
sourcepub fn total_outbound(&self) -> u64
pub fn total_outbound(&self) -> u64
Returns the total number of bytes that have been uploaded on all the connections spawned
through the BandwidthLogging
.
Note: This method is by design subject to race conditions. The returned value should only ever be used for statistics purposes.