diff options
Diffstat (limited to 'src/swarm/working_links.rs')
| -rw-r--r-- | src/swarm/working_links.rs | 23 |
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"), } } |
