pub struct CooperationCounters {Show 15 fields
pub handshakes_out: u64,
pub handshakes_in: u64,
pub dial_failures: u64,
pub syncs_out: u64,
pub syncs_failed: u64,
pub syncs_in: u64,
pub events_sent: u64,
pub events_served: u64,
pub reconnects: u64,
pub restarts: u64,
pub peers_expired: u64,
pub claims_refused: u64,
pub threads: u64,
pub refused_in: BTreeMap<RefusalCode, u64>,
pub refused_out: BTreeMap<RefusalCode, u64>,
}Expand description
The link and replication counters since start: what this runtime did, not what it holds. They are monotonic and never reset, so two readings a minute apart are a rate — which is the only way to tell a mesh that is working from one that is retrying, since both show the same peers in the same states.
The counts are split by direction throughout (handshakes_out against
handshakes_in, refused_in against refused_out) because a runtime that refuses
everyone and one that everyone refuses need opposite remedies.
let key = a.dial(&["b:1".into()]).unwrap();
a.sync_with(&key).unwrap();
let dialer: CooperationCounters = a.status().counters;
let answerer = b.status().counters;
assert_eq!((dialer.handshakes_out, dialer.syncs_out), (1, 1));
assert_eq!((answerer.handshakes_in, answerer.syncs_in), (1, 1), "the other side of it");
assert_eq!(answerer.handshakes_out, 0, "B never dialed anybody");Fields§
§handshakes_out: u64Handshakes this runtime completed as the dialer.
handshakes_in: u64Handshakes this runtime accepted.
dial_failures: u64Dials that reached no endpoint.
syncs_out: u64Sync rounds this runtime completed as the dialer.
syncs_failed: u64Sync rounds that failed in transport.
syncs_in: u64Sync rounds this runtime answered.
events_sent: u64Events pushed in sync requests.
events_served: u64Events served in sync answers.
reconnects: u64Re-handshakes after an expiry or a dropped link.
restarts: u64Peer restarts observed.
peers_expired: u64Links expired.
claims_refused: u64Claims refused for a conflict.
threads: u64Cooperation threads alive now.
refused_in: BTreeMap<RefusalCode, u64>Hellos and syncs this runtime refused, by code.
refused_out: BTreeMap<RefusalCode, u64>Refusals this runtime received or applied to a welcome, by code.
Trait Implementations§
Source§impl Clone for CooperationCounters
impl Clone for CooperationCounters
Source§fn clone(&self) -> CooperationCounters
fn clone(&self) -> CooperationCounters
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CooperationCounters
impl Debug for CooperationCounters
Source§impl Default for CooperationCounters
impl Default for CooperationCounters
Source§fn default() -> CooperationCounters
fn default() -> CooperationCounters
Source§impl<'de> Deserialize<'de> for CooperationCounters
impl<'de> Deserialize<'de> for CooperationCounters
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 CooperationCounters
impl JsonSchema for CooperationCounters
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