Skip to content

Commit

Permalink
Add stat for hash calculation file drop time (#3577)
Browse files Browse the repository at this point in the history
add drop_us stat

Co-authored-by: HaoranYi <[email protected]>
  • Loading branch information
HaoranYi and HaoranYi authored Nov 11, 2024
1 parent b46c87e commit 9d02885
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions accounts-db/src/accounts_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ pub struct HashStats {
pub scan_time_total_us: u64,
pub zeros_time_total_us: u64,
pub hash_time_total_us: u64,
pub drop_hash_files_us: u64,
pub sort_time_total_us: u64,
pub hash_total: usize,
pub num_snapshot_storage: usize,
Expand Down Expand Up @@ -245,6 +246,7 @@ impl HashStats {
("accounts_scan_us", self.scan_time_total_us, i64),
("eliminate_zeros_us", self.zeros_time_total_us, i64),
("hash_us", self.hash_time_total_us, i64),
("drop_hash_files_us", self.drop_hash_files_us, i64),
("sort_us", self.sort_time_total_us, i64),
("hash_total", self.hash_total, i64),
("storage_sort_us", self.storage_sort_us, i64),
Expand Down Expand Up @@ -1232,6 +1234,9 @@ impl<'a> AccountsHasher<'a> {
);
hash_time.stop();
stats.hash_time_total_us += hash_time.as_us();

let (_, drop_us) = measure_us!(drop(cumulative));
stats.drop_hash_files_us += drop_us;
(hash, total_lamports)
}
}
Expand Down

0 comments on commit 9d02885

Please sign in to comment.