Skip to content

Commit

Permalink
add clean metric for # slots cleaned (#2777)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored Aug 29, 2024
1 parent f6b7752 commit da81bb8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit da81bb8

Please sign in to comment.