From 4656912cbe7026c975b938076addd3b160ccf785 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Thu, 22 Aug 2024 14:16:37 -0500 Subject: [PATCH] add index stat accounts_not_found_in_index (#2686) --- accounts-db/src/accounts_db.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/accounts-db/src/accounts_db.rs b/accounts-db/src/accounts_db.rs index 058500443b9094..c84d7fd81be90d 100644 --- a/accounts-db/src/accounts_db.rs +++ b/accounts-db/src/accounts_db.rs @@ -2028,6 +2028,7 @@ pub struct ShrinkStats { alive_accounts: AtomicU64, accounts_loaded: AtomicU64, purged_zero_lamports: AtomicU64, + accounts_not_found_in_index: AtomicU64, } impl ShrinkStats { @@ -2131,6 +2132,11 @@ impl ShrinkStats { self.purged_zero_lamports.swap(0, Ordering::Relaxed), i64 ), + ( + "accounts_not_found_in_index", + self.accounts_not_found_in_index.swap(0, Ordering::Relaxed), + i64 + ), ); } } @@ -2338,6 +2344,13 @@ impl ShrinkAncientStats { .swap(0, Ordering::Relaxed), i64 ), + ( + "accounts_not_found_in_index", + self.shrink_stats + .accounts_not_found_in_index + .swap(0, Ordering::Relaxed), + i64 + ), ); } } @@ -3923,6 +3936,10 @@ impl AccountsDb { alive_accounts.add(ref_count, stored_account, slot_list); alive += 1; } + } else { + stats + .accounts_not_found_in_index + .fetch_add(1, Ordering::Relaxed); } index += 1; result