diff --git a/accounts-db/src/accounts_db.rs b/accounts-db/src/accounts_db.rs index 63c03ada543eef..0634ab6ba2a1da 100644 --- a/accounts-db/src/accounts_db.rs +++ b/accounts-db/src/accounts_db.rs @@ -1962,6 +1962,7 @@ struct CleanAccountsStats { clean_stored_dead_slots_us: AtomicU64, uncleaned_roots_slot_list_1: AtomicU64, get_account_sizes_us: AtomicU64, + slots_cleaned: AtomicU64, } impl CleanAccountsStats { @@ -3603,6 +3604,13 @@ impl AccountsDb { .swap(0, Ordering::Relaxed), i64 ), + ( + "slots_cleaned", + self.clean_accounts_stats + .slots_cleaned + .swap(0, Ordering::Relaxed), + i64 + ), ( "clean_old_root_us", self.clean_accounts_stats @@ -8020,6 +8028,10 @@ impl AccountsDb { assert!(reclaimed_offsets.contains_key(&expected_slot)); } + self.clean_accounts_stats + .slots_cleaned + .fetch_add(reclaimed_offsets.len() as u64, Ordering::Relaxed); + reclaimed_offsets.iter().for_each(|(slot, offsets)| { if let Some(store) = self .storage