pub struct PeerView {Show 22 fields
pub runtime: String,
pub node: String,
pub instance: String,
pub name: String,
pub version: String,
pub local: bool,
pub trust: TrustState,
pub protocol: u32,
pub features: Vec<String>,
pub endpoints: Vec<String>,
pub state: LinkState,
pub outbound: bool,
pub inbound: bool,
pub endpoint: Option<String>,
pub last_exchange_ms: Option<u64>,
pub rtt_ms: Option<u64>,
pub failures: u32,
pub last_error: Option<String>,
pub handshakes: u64,
pub reconnects: u64,
pub restarts: u64,
pub linked_at: String,
}Expand description
One peer as every surface shows it: who it is, how this runtime reaches it, and what
the link has been through. The counters are carried per peer rather than only in the
totals because the question a person asks of a flapping mesh is which peer is flapping,
and restarts answers a different one from reconnects — a peer whose process keeps
dying, against a link that keeps dropping under a process that never did.
a.dial(&["b:1".into()]).unwrap();
let peer: &PeerView = &a.peers()[0];
assert_eq!(peer.runtime, b.runtime_key(), "the durable identity, not the endpoint");
assert!(peer.outbound, "this runtime dials it");
assert_eq!(peer.handshakes, 1);
assert_eq!(peer.restarts, 0, "the peer's process has not died under the link");Fields§
§runtime: String<node>-<runtime>: the peer’s durable identity.
node: StringThe node (machine key digest).
instance: StringThe current instance.
name: StringThe node’s display name.
version: StringThe executable version.
local: boolWhether the peer runs on this machine (the same node key).
trust: TrustStateThe trust verdict the link was admitted under.
protocol: u32The negotiated link protocol.
features: Vec<String>The link features the peer carries.
endpoints: Vec<String>Where the peer answers.
state: LinkStateThe link’s standing.
outbound: boolWhether this runtime dials the peer.
inbound: boolWhether the peer dials this runtime.
endpoint: Option<String>The endpoint this runtime dials, when it does.
last_exchange_ms: Option<u64>Milliseconds since the last successful exchange in either direction.
rtt_ms: Option<u64>The last round trip, milliseconds.
failures: u32Consecutive failed rounds.
last_error: Option<String>The last failure, in words.
handshakes: u64Handshakes completed with this peer.
reconnects: u64Handshakes after an expiry or a dropped link.
restarts: u64New instances of the peer seen (its process restarted).
linked_at: StringWhen the current link was established, RFC 3339.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PeerView
impl<'de> Deserialize<'de> for PeerView
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for PeerView
impl JsonSchema for PeerView
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more