From 9d02885142a5185152eda8fa279df28d15dd0fc7 Mon Sep 17 00:00:00 2001 From: HaoranYi <219428+HaoranYi@users.noreply.github.com> Date: Mon, 11 Nov 2024 12:49:44 -0600 Subject: [PATCH] Add stat for hash calculation file drop time (#3577) add drop_us stat Co-authored-by: HaoranYi --- accounts-db/src/accounts_hash.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/accounts-db/src/accounts_hash.rs b/accounts-db/src/accounts_hash.rs index d5c3beedacc6c5..bf03e03bdcd493 100644 --- a/accounts-db/src/accounts_hash.rs +++ b/accounts-db/src/accounts_hash.rs @@ -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, @@ -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), @@ -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) } }