cleanup and stats accounting organization

This commit is contained in:
John Smith
2021-11-26 09:54:38 -05:00
parent 311dc908fe
commit a80178da54
9 changed files with 341 additions and 231 deletions
+8 -2
View File
@@ -671,6 +671,12 @@ pub struct LatencyStats {
pub slowest: u64, // slowest latency in the ROLLING_LATENCIES_SIZE last latencies
}
#[derive(Clone, Debug, Default)]
pub struct TransferStatsDownUp {
pub down: TransferStats,
pub up: TransferStats,
}
#[derive(Clone, Debug, Default)]
pub struct TransferStats {
pub total: u64, // total amount transferred ever
@@ -696,8 +702,8 @@ pub struct PeerStats {
pub last_seen: Option<u64>, // when the peer was last seen for any reason
pub ping_stats: PingStats, // information about pings
pub latency: Option<LatencyStats>, // latencies for communications with the peer
pub transfer: (TransferStats, TransferStats), // (download, upload) stats for communications with the peer
pub node_info: Option<NodeInfo>, // last known node info
pub transfer: TransferStatsDownUp, // Stats for communications with the peer
pub node_info: Option<NodeInfo>, // Last known node info
}
cfg_if! {