From ca6c967fcfc9bbc2114c328911324a212ef96a36 Mon Sep 17 00:00:00 2001 From: HaoranYi Date: Tue, 17 Oct 2023 23:43:03 +0000 Subject: [PATCH] candidate count --- accounts-db/src/accounts_db.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/accounts-db/src/accounts_db.rs b/accounts-db/src/accounts_db.rs index e8e835e5aece9d..9b7fcc257296f7 100644 --- a/accounts-db/src/accounts_db.rs +++ b/accounts-db/src/accounts_db.rs @@ -4773,6 +4773,8 @@ impl AccountsDb { let shrink_candidates_slots = std::mem::take(&mut *self.shrink_candidate_slots.lock().unwrap()); + let shrink_candidates_count = shrink_candidates_slots.len(); + let (shrink_slots, shrink_slots_next_batch) = { if let AccountShrinkThreshold::TotalSpace { shrink_ratio } = self.shrink_ratio { let (shrink_slots, shrink_slots_next_batch) = self @@ -4813,7 +4815,6 @@ impl AccountsDb { let mut measure_shrink_all_candidates = Measure::start("shrink_all_candidate_slots"); let num_candidates = shrink_slots.len(); - let shrink_candidates_count = shrink_slots.len(); self.thread_pool_clean.install(|| { shrink_slots .into_par_iter() @@ -4845,6 +4846,7 @@ impl AccountsDb { i64 ), ("shrink_candidates_count", shrink_candidates_count, i64), + ("shrink_candidates_selected_count", num_candidates, i64), ("shrink_candidates_pending_count", pended_counts, i64), );