From d0e1779893105b368dba76df1458f72fa9fc29c6 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 7 Aug 2020 06:04:50 +0000 Subject: [PATCH] Accounts hash calculation metrics (#11433) (#11438) (cherry picked from commit 770d3d383c5845a3ca1d6043405e13b4d23a0525) Co-authored-by: sakridge --- runtime/src/accounts_db.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index dbcdf9ac99..064d40a42b 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -1599,9 +1599,18 @@ impl AccountsDB { } scan.stop(); - debug!("{}", scan); + let hash_total = hashes.len(); - Ok(Self::accumulate_account_hashes(hashes)) + let mut accumulate = Measure::start("accumulate"); + let accumulated_hash = Self::accumulate_account_hashes(hashes); + accumulate.stop(); + datapoint_info!( + "update_accounts_hash", + ("accounts_scan", scan.as_us(), i64), + ("hash_accumulate", accumulate.as_us(), i64), + ("hash_total", hash_total, i64), + ); + Ok(accumulated_hash) } pub fn get_accounts_hash(&self, slot: Slot) -> Hash {