From fbd5132fe1d2ade272febec11c2ee8b2b7860656 Mon Sep 17 00:00:00 2001 From: qima Date: Tue, 3 Oct 2023 18:28:52 +0800 Subject: [PATCH] chore: log status of pending_get_record --- sn_networking/src/cmd.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sn_networking/src/cmd.rs b/sn_networking/src/cmd.rs index 2b98a9c0b8..561f1abe0b 100644 --- a/sn_networking/src/cmd.rs +++ b/sn_networking/src/cmd.rs @@ -180,6 +180,15 @@ impl SwarmDriver { { warn!("An existing get_record task {query_id:?} got replaced"); } + // Logging the status of the `pending_get_record`. + // We also interested in the status of `result_map` (which contains record) inside. + let total_records: usize = self + .pending_get_record + .iter() + .map(|(_, (_, result_map))| result_map.len()) + .sum(); + info!("We now have {} pending get record attempts and cached {total_records} fetched copies", + self.pending_get_record.len()); } SwarmCmd::GetLocalStoreCost { sender } => { let cost = self.swarm.behaviour_mut().kademlia.store_mut().store_cost();