diff options
| author | tv <tv@krebsco.de> | 2026-11-04 21:07:42 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-04 21:07:42 +0100 |
| commit | a8762b78d327e97c3c818842e5a948ba118fefd8 (patch) | |
| tree | 60308cecf72a0fa247f807746588a23f136f89ab /src/simtest/bench.rs | |
| parent | 9f4820d5d121025e908da9ca98783f2827044768 (diff) | |
benchmark what sync bytes are
Diffstat (limited to 'src/simtest/bench.rs')
| -rw-r--r-- | src/simtest/bench.rs | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/simtest/bench.rs b/src/simtest/bench.rs index ecf44a5..290fd7c 100644 --- a/src/simtest/bench.rs +++ b/src/simtest/bench.rs @@ -235,6 +235,11 @@ impl Totals { relay.nothing_new_bytes += stats.relay.nothing_new_bytes; relay.nothing_new_along_trees += stats.relay.nothing_new_along_trees; relay.nothing_new_delivered += stats.relay.nothing_new_delivered; + relay.carrying += stats.relay.carrying; + relay.carrying_change_bytes += stats.relay.carrying_change_bytes; + relay.carrying_bloom_bytes += stats.relay.carrying_bloom_bytes; + relay.nothing_new_change_bytes += stats.relay.nothing_new_change_bytes; + relay.nothing_new_bloom_bytes += stats.relay.nothing_new_bloom_bytes; for (_, peer_state) in node.peers_snapshot().await { totals.incidents.add(&peer_state.lock().await.incidents); } @@ -510,6 +515,33 @@ fn report( (r1.nothing_new_along_trees - r0.nothing_new_along_trees) as f64 / writes, (r1.nothing_new_delivered - r0.nothing_new_delivered) as f64 / writes, ); + let each = |bytes: u64, count: u64| { + if count > 0 { + bytes as f64 / count as f64 + } else { + 0.0 + } + }; + let carrying = r1.carrying - r0.carrying; + let twice = r1.nothing_new - r0.nothing_new; + let _ = writeln!( + out, + " received with changes: {:.1} per write, each {:.0} bytes of changes and {:.0} of bloom filters; of those with nothing new, {:.0} and {:.0}", + carrying as f64 / writes, + each( + r1.carrying_change_bytes - r0.carrying_change_bytes, + carrying + ), + each(r1.carrying_bloom_bytes - r0.carrying_bloom_bytes, carrying), + each( + r1.nothing_new_change_bytes - r0.nothing_new_change_bytes, + twice + ), + each( + r1.nothing_new_bloom_bytes - r0.nothing_new_bloom_bytes, + twice + ), + ); let (i0, i1) = (during.0.incidents, during.1.incidents); let _ = writeln!( out, |
