Skip to content

Commit

Permalink
clean up shrink select stat
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoranYi committed Sep 30, 2024
1 parent 6b9f569 commit 0811bea
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4598,7 +4598,6 @@ impl AccountsDb {
let mut total_alive_bytes: u64 = 0;
let mut candidates_count: usize = 0;
let mut total_bytes: u64 = 0;
let mut total_candidate_stores: usize = 0;
for slot in shrink_slots {
let Some(store) = self.storage.get_slot_storage_entry(*slot) else {
continue;
Expand All @@ -4613,7 +4612,6 @@ impl AccountsDb {
alive_ratio,
store: store.clone(),
});
total_candidate_stores += 1;
}
store_usage.sort_by(|a, b| {
a.alive_ratio
Expand Down Expand Up @@ -4650,18 +4648,18 @@ impl AccountsDb {
shrink_slots.insert(usage.slot, Arc::clone(store));
}
}

measure.stop();
inc_new_counter_debug!(
"shrink_select_top_sparse_storage_entries-ms",
measure.as_ms() as usize
);
inc_new_counter_debug!(
"shrink_select_top_sparse_storage_entries-seeds",
candidates_count
);
inc_new_counter_debug!(
"shrink_total_preliminary_candidate_stores",
total_candidate_stores
datapoint_info!(
"shrink_select",
("select_time-ms", measure.as_ms(), i64),
("candidates_count", candidates_count, i64),
("selected_count", shrink_slots.len(), i64),
(
"deferred_to_next_round_count",
shrink_slots_next_batch.len(),
i64
)
);

(shrink_slots, shrink_slots_next_batch)
Expand Down

0 comments on commit 0811bea

Please sign in to comment.