From 1a20d28c7131a1b768079018f03dfb7bd1ffbc6e Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 5 Nov 2026 16:11:43 +0100 Subject: no epoch tag measure --- src/swarm/stats.rs | 11 ++++------- src/swarm/sync.rs | 4 +--- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'src/swarm') diff --git a/src/swarm/stats.rs b/src/swarm/stats.rs index ba75d68..8ab27e8 100644 --- a/src/swarm/stats.rs +++ b/src/swarm/stats.rs @@ -128,11 +128,10 @@ pub(crate) struct Relay { /// payload's bytes. pub(crate) delivered: u64, pub(crate) delivered_bytes: u64, - /// Sync messages sent (not offers), the bytes the envelope added to their - /// Automerge messages, and of those the epoch's. + /// Sync messages sent (not offers), and the bytes the envelope added to their + /// Automerge messages. pub(crate) framed: u64, pub(crate) framing_bytes: u64, - pub(crate) framing_id_bytes: u64, /// Sync messages deflated (`compress`), their bytes before and after. pub(crate) deflated: u64, pub(crate) deflated_from: u64, @@ -284,13 +283,11 @@ impl NodeStats { inner.relay.deflated_to += to as u64; } - /// A sync message went out whose envelope added `bytes` to its Automerge message, - /// `ids` of them the epoch. - pub(crate) fn sync_framing(&self, bytes: usize, ids: usize) { + /// A sync message went out whose envelope added `bytes` to its Automerge message. + pub(crate) fn sync_framing(&self, bytes: usize) { let mut inner = self.lock(); inner.relay.framed += 1; inner.relay.framing_bytes += bytes as u64; - inner.relay.framing_id_bytes += ids as u64; } /// A sync message taken as delivered went out, of `bytes` payload. diff --git a/src/swarm/sync.rs b/src/swarm/sync.rs index 5511ea2..5ee36a2 100644 --- a/src/swarm/sync.rs +++ b/src/swarm/sync.rs @@ -296,8 +296,6 @@ async fn deliver_sync_to_peer(state: &AppState, peer: &str) -> Result<()> { } transport::SyncBody::Delta(_) => None, }; - let ids = rmp_serde::encode::to_vec(&transport::EpochTag::of(epoch)) - .map_or(0, |tag| tag.len()); let envelope = transport::SyncEnvelope { epoch: transport::EpochTag::of(epoch), epoch_seq, @@ -311,7 +309,7 @@ async fn deliver_sync_to_peer(state: &AppState, peer: &str) -> Result<()> { .encode(&peer_owned, &ParsedMessage::Sync(envelope)) .map(Some); if let (Ok(Some(encoded)), Some(inner)) = (&encoded, inner) { - stats.sync_framing(encoded.payload_len.saturating_sub(inner), ids); + stats.sync_framing(encoded.payload_len.saturating_sub(inner)); } (session, encoded) }, -- cgit v1.3.1