diff options
| author | tv <tv@krebsco.de> | 2026-10-26 22:08:32 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-26 22:14:01 +0100 |
| commit | 5a32e746cf7aec3e4ca76616b6b66f023de53988 (patch) | |
| tree | 9eca1f501d8961a53497c03412c222fd485e76ac /src/swarm/stats.rs | |
| parent | 08f5df1f0a2e22876a5b49a4f9e2e05a61df882a (diff) | |
add delta blobs
Diffstat (limited to 'src/swarm/stats.rs')
| -rw-r--r-- | src/swarm/stats.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/swarm/stats.rs b/src/swarm/stats.rs index 8172233..308c2a5 100644 --- a/src/swarm/stats.rs +++ b/src/swarm/stats.rs @@ -31,6 +31,7 @@ struct Inner { stale_hello_replies: u64, relay: Relay, blob_requests_dropped: u64, + largest_sync_received: u64, saved_size: Option<SavedSize>, measuring: bool, /// The document version (`AppState::change_tx`) and epoch the saved size is of. @@ -122,6 +123,8 @@ pub(crate) struct Snapshot { pub(crate) stale_hello_replies: u64, pub(crate) relay: Relay, pub(crate) blob_requests_dropped: u64, + /// The largest sync message received (its Automerge part, in bytes). + pub(crate) largest_sync_received: u64, pub(crate) propagation: Propagation, } @@ -181,6 +184,12 @@ impl NodeStats { self.lock().relay.pulls_queued += 1; } + /// A sync message of `bytes` arrived. + pub(crate) fn sync_received(&self, bytes: usize) { + let mut inner = self.lock(); + inner.largest_sync_received = inner.largest_sync_received.max(bytes as u64); + } + /// A blob request went unanswered: too many were being answered. pub(crate) fn blob_request_dropped(&self) { self.lock().blob_requests_dropped += 1; @@ -237,6 +246,7 @@ impl NodeStats { stale_hello_replies: inner.stale_hello_replies, relay: inner.relay, blob_requests_dropped: inner.blob_requests_dropped, + largest_sync_received: inner.largest_sync_received, propagation: inner.propagation, } } |
