Skip to content

Commit

Permalink
add stat for disk buckets flushed (#30850)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored Mar 22, 2023
1 parent d69f602 commit 3ebfda5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions runtime/src/bucket_map_holder_stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions runtime/src/in_mem_accounts_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3ebfda5

Please sign in to comment.