aboutsummaryrefslogtreecommitdiffstats
path: root/src/state/peer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/peer.rs')
-rw-r--r--src/state/peer.rs5
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,