diff --git a/accounts-db/src/accounts_db.rs b/accounts-db/src/accounts_db.rs index 580d7ffb67dea9..e53236b29f8665 100644 --- a/accounts-db/src/accounts_db.rs +++ b/accounts-db/src/accounts_db.rs @@ -1992,6 +1992,7 @@ pub(crate) struct ShrinkAncientStats { pub(crate) many_refs_old_alive: AtomicU64, pub(crate) slots_eligible_to_shrink: AtomicU64, pub(crate) total_dead_bytes: AtomicU64, + pub(crate) total_alive_bytes: AtomicU64, pub(crate) ideal_storage_size: AtomicU64, } @@ -2340,6 +2341,11 @@ impl ShrinkAncientStats { self.total_dead_bytes.swap(0, Ordering::Relaxed), i64 ), + ( + "total_alive_bytes", + self.total_alive_bytes.swap(0, Ordering::Relaxed), + i64 + ), ( "slots_considered", self.slots_considered.swap(0, Ordering::Relaxed) as i64, diff --git a/accounts-db/src/ancient_append_vecs.rs b/accounts-db/src/ancient_append_vecs.rs index 2ae2178922cc95..c10bd923876545 100644 --- a/accounts-db/src/ancient_append_vecs.rs +++ b/accounts-db/src/ancient_append_vecs.rs @@ -626,6 +626,9 @@ impl AccountsDb { self.shrink_ancient_stats .total_dead_bytes .fetch_add(total_dead_bytes, Ordering::Relaxed); + self.shrink_ancient_stats + .total_alive_bytes + .fetch_add(total_alive_bytes, Ordering::Relaxed); if randoms > 0 { self.shrink_ancient_stats .random_shrink