From d4fc9e7ed47778b058e319ab8ef820210184eb34 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" <75863576+jeffwashington@users.noreply.github.com> Date: Mon, 24 May 2021 18:14:52 -0500 Subject: [PATCH] ad metric for collect (#17418) --- runtime/src/accounts_db.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index 2bfc637750..97f14773f5 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -4085,7 +4085,7 @@ impl AccountsDb { check_hash: bool, ) -> Result<(Hash, u64), BankHashVerificationError> { use BankHashVerificationError::*; - let mut scan = Measure::start("scan"); + let mut collect = Measure::start("collect"); let keys: Vec<_> = self .accounts_index .account_maps @@ -4094,6 +4094,9 @@ impl AccountsDb { .keys() .cloned() .collect(); + collect.stop(); + + let mut scan = Measure::start("scan"); let mismatch_found = AtomicU64::new(0); // Pick a chunk size big enough to allow us to produce output vectors that are smaller than the overall size. // We'll also accumulate the lamports within each chunk and fewer chunks results in less contention to accumulate the sum. @@ -4185,6 +4188,7 @@ impl AccountsDb { ("accounts_scan", scan.as_us(), i64), ("hash", hash_time.as_us(), i64), ("hash_total", hash_total, i64), + ("collect", collect.as_us(), i64), ); Ok((accumulated_hash, total_lamports)) }