diff options
| author | tv <tv@krebsco.de> | 2026-10-25 13:38:59 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-25 13:38:59 +0100 |
| commit | f52ae6973299fa3c1d81758838951e39904e1d84 (patch) | |
| tree | eeadc6f698d1fa99d33268f997e8def5ee403038 /src/swarm/stats.rs | |
| parent | 022ddb4bf167a12cd45b4a5cac27739f92449eff (diff) | |
add files module to consistently track stats
Diffstat (limited to 'src/swarm/stats.rs')
| -rw-r--r-- | src/swarm/stats.rs | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/swarm/stats.rs b/src/swarm/stats.rs index ab5c4da..eb34276 100644 --- a/src/swarm/stats.rs +++ b/src/swarm/stats.rs @@ -33,17 +33,6 @@ struct Inner { /// The document version (`AppState::change_tx`) and epoch the saved size is of. measured_version: Option<(u64, Epoch)>, propagation: Propagation, - disk: Disk, -} - -/// Files this node reads and writes for itself: the state file, a backup to recover -/// from. Not the Mycelium daemon's, and not logs. -#[derive(Debug, Clone, Copy, Default)] -pub(crate) struct Disk { - pub(crate) reads: u64, - pub(crate) read_bytes: u64, - pub(crate) writes: u64, - pub(crate) written_bytes: u64, } /// Upper bounds (inclusive, milliseconds) of the propagation delay buckets; a last @@ -118,7 +107,6 @@ pub(crate) struct Snapshot { pub(crate) max_heads: usize, pub(crate) stale_hello_replies: u64, pub(crate) propagation: Propagation, - pub(crate) disk: Disk, } impl Default for NodeStats { @@ -163,20 +151,6 @@ impl NodeStats { } } - /// A file of `bytes` was read (`Disk`). - pub(crate) fn disk_read(&self, bytes: u64) { - let mut inner = self.lock(); - inner.disk.reads += 1; - inner.disk.read_bytes += bytes; - } - - /// A file of `bytes` was written (`Disk`). - pub(crate) fn disk_written(&self, bytes: u64) { - let mut inner = self.lock(); - inner.disk.writes += 1; - inner.disk.written_bytes += bytes; - } - pub(crate) fn stale_hello_reply(&self) { self.lock().stale_hello_replies += 1; } @@ -231,7 +205,6 @@ impl NodeStats { max_heads: inner.max_heads, stale_hello_replies: inner.stale_hello_replies, propagation: inner.propagation, - disk: inner.disk, } } } |
