diff options
| author | tv <tv@krebsco.de> | 2026-10-30 18:28:14 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-30 18:28:14 +0100 |
| commit | e3b386c2aa9970f2f999f07ac43b7eb8fe319d8d (patch) | |
| tree | 58cd1542f9d1ddcd398c209ccaf11ffc345eb3f4 /src/transport/stats.rs | |
| parent | 0ef6785b09d74878f66449f18cf45fe54f8b2f5a (diff) | |
track connection type per path
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)] |
