aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-06 06:19:16 +0100
committertv <tv@krebsco.de>2026-11-06 06:19:16 +0100
commit028bdaae355d677571bd21764caa17acb3687e78 (patch)
tree9ca179867aec772bb1c0b4e84f6dad2d21d82533 /src/swarm
parentd9d398522a142283b537670068cc6418402d9546 (diff)
soak counts records
Diffstat (limited to 'src/swarm')
-rw-r--r--src/swarm/working_links.rs23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/swarm/working_links.rs b/src/swarm/working_links.rs
index 6f07375..af476c4 100644
--- a/src/swarm/working_links.rs
+++ b/src/swarm/working_links.rs
@@ -46,6 +46,15 @@ pub(crate) struct Pending {
/// Checks done (`check`), for the benchmark to wait for one (`settled`).
#[cfg(test)]
checks: u64,
+ /// Records written, for the soak (`written`).
+ #[cfg(test)]
+ written: u64,
+}
+
+/// How many times we wrote our record.
+#[cfg(test)]
+pub(crate) fn written(state: &AppState) -> u64 {
+ state.working_links.lock_or_recover().written
}
/// How many checks were done, and whether none of our links differs from our record
@@ -103,10 +112,16 @@ pub(crate) async fn check(state: &AppState) {
.mutate_doc(move |doc| members::set_links(doc, &me, &next))
.await
{
- Ok(()) => info!(
- unreached,
- reached, "Links that differ from the member list's graph recorded"
- ),
+ Ok(()) => {
+ #[cfg(test)]
+ {
+ state.working_links.lock_or_recover().written += 1;
+ }
+ info!(
+ unreached,
+ reached, "Links that differ from the member list's graph recorded"
+ )
+ }
Err(error) => warn!(error = %error, "Failed to record our links"),
}
}