add stat for disk buckets flushed (#30850)

This commit is contained in:
Jeff Washington (jwash) 2023-03-22 17:04:17 -05:00 committed by GitHub
parent d69f60229d
commit 3ebfda5aef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -41,6 +41,7 @@ pub struct BucketMapHolderStats {
pub failed_to_evict: AtomicU64,
pub keys: AtomicU64,
pub deletes: AtomicU64,
pub buckets_scanned: AtomicU64,
pub inserts: AtomicU64,
count: AtomicUsize,
pub bg_waiting_us: AtomicU64,
@ -372,6 +373,11 @@ impl BucketMapHolderStats {
("items", self.items.swap(0, Ordering::Relaxed), i64),
("keys", self.keys.swap(0, Ordering::Relaxed), i64),
("ms_per_age", ms_per_age, i64),
(
"buckets_scanned",
self.buckets_scanned.swap(0, Ordering::Relaxed),
i64
),
(
"flush_scan_us",
self.flush_scan_us.swap(0, Ordering::Relaxed),

View File

@ -1109,6 +1109,7 @@ impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> InMemAccountsIndex<T,
return;
}
Self::update_stat(&self.stats().buckets_scanned, 1);
// scan in-mem map for items that we may evict
let FlushScanResult {
mut evictions_age_possible,