diff options
Diffstat (limited to 'src/transport/stats.rs')
| -rw-r--r-- | src/transport/stats.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/transport/stats.rs b/src/transport/stats.rs index 398ffdf..ed8b247 100644 --- a/src/transport/stats.rs +++ b/src/transport/stats.rs @@ -6,6 +6,8 @@ use std::collections::BTreeMap; use serde::Serialize; +use super::Connection; + #[derive(Debug, Clone, Default, Serialize)] #[serde(rename_all = "camelCase")] pub(crate) struct TransportStats { @@ -58,6 +60,10 @@ pub(crate) struct PathInfo { /// Its PINGs went unanswered three times in a row, or a send there failed within a /// minute: used only when no other path works. pub(crate) down: bool, + /// The transport's connection there, if it has connections (libp2p: direct or + /// relayed; `Transport::connection`). + #[serde(skip_serializing_if = "Option::is_none")] + pub(crate) connection: Option<Connection>, } /// Counts since start. @@ -82,6 +88,9 @@ pub(crate) struct IdentityStats { /// Nodes proven at an address, by transport (scheme); a node on several counts on /// each. pub(crate) proven: BTreeMap<String, usize>, + /// Of those, the nodes the transport reaches only through a relay (no direct + /// connection at its address there), by transport; absent where none is. + pub(crate) relayed: BTreeMap<String, usize>, /// Nodes known only from hints (the member list, HELLO_REPLYs), proven nowhere. pub(crate) hinted: usize, #[serde(flatten)] |
