Add counter for accounts hash verification. (#8928)

This commit is contained in:
sakridge 2020-03-18 08:39:09 -07:00 committed by GitHub
parent 9cedeb0a8d
commit c51049a59b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -118,6 +118,7 @@ impl AccountsHashVerifier {
trusted_validators: &Option<HashSet<Pubkey>>,
slot_to_hash: &mut HashMap<Slot, Hash>,
) -> bool {
let mut verified_count = 0;
if let Some(trusted_validators) = trusted_validators.as_ref() {
for trusted_validator in trusted_validators {
let cluster_info_r = cluster_info.read().unwrap();
@ -135,6 +136,8 @@ impl AccountsHashVerifier {
);
return true;
} else {
verified_count += 1;
}
} else {
slot_to_hash.insert(*slot, *hash);
@ -143,6 +146,7 @@ impl AccountsHashVerifier {
}
}
}
inc_new_counter_info!("accounts_hash_verifier-hashes_verified", verified_count);
false
}