diff options
| author | tv <tv@krebsco.de> | 2026-11-05 00:56:51 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-05 00:56:51 +0100 |
| commit | 63871240278181f14af9d561f30b428d5db5e34a (patch) | |
| tree | 946ac238d40cbb2766886339337d954c3b933b56 /src/state/peer.rs | |
| parent | 4da17a5e40e34aea27a34241b4f692ae0c827f57 (diff) | |
asked again counter
Diffstat (limited to 'src/state/peer.rs')
| -rw-r--r-- | src/state/peer.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/state/peer.rs b/src/state/peer.rs index 787a772..a84e069 100644 --- a/src/state/peer.rs +++ b/src/state/peer.rs @@ -233,6 +233,9 @@ pub(crate) struct Incidents { pub(crate) reply_timeouts: u64, /// Re-handshakes because our documents differed while sync was idle. pub(crate) heals: u64, + /// Times nothing answered us for half the time it may (`AwaitingAnswer`), so we + /// asked again, with a PING (or the keepalive then due). + pub(crate) asked_again: u64, /// Times the peer went dormant. pub(crate) dormancies: u64, /// Time spent dormant, in milliseconds, up to its last return (the current @@ -244,6 +247,7 @@ impl Incidents { pub(crate) fn add(&mut self, other: &Incidents) { self.reply_timeouts += other.reply_timeouts; self.heals += other.heals; + self.asked_again += other.asked_again; self.dormancies += other.dormancies; self.dormant_ms += other.dormant_ms; } @@ -439,6 +443,7 @@ impl PeerState { match &mut self.awaiting_answer { Some(awaiting) if awaiting.ask_again_at.is_some_and(|at| now >= at) => { awaiting.ask_again_at = None; + self.incidents.asked_again += 1; true } _ => false, |
