log accounts loaded for shrink stats (#19747)

This commit is contained in:
Jeff Washington (jwash) 2021-09-10 12:51:58 -05:00 committed by GitHub
parent 098585234d
commit 2de2c6ddd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1261,6 +1261,7 @@ struct ShrinkStats {
skipped_shrink: AtomicU64,
dead_accounts: AtomicU64,
alive_accounts: AtomicU64,
accounts_loaded: AtomicU64,
}
impl ShrinkStats {
@ -1359,6 +1360,11 @@ impl ShrinkStats {
self.dead_accounts.swap(0, Ordering::Relaxed) as i64,
i64
),
(
"accounts_loaded",
self.accounts_loaded.swap(0, Ordering::Relaxed) as i64,
i64
),
);
}
}
@ -2350,6 +2356,10 @@ impl AccountsDb {
let len = stored_accounts.len();
let alive_accounts_collect = Mutex::new(Vec::with_capacity(len));
let unrefed_pubkeys_collect = Mutex::new(Vec::with_capacity(len));
self.shrink_stats
.accounts_loaded
.fetch_add(len as u64, Ordering::Relaxed);
self.thread_pool.install(|| {
let chunk_size = 50; // # accounts/thread
let chunks = len / chunk_size + 1;