Update reported tx count to exclude errors (#4201)

This commit is contained in:
Sagar Dhawan
2019-05-13 13:23:52 -07:00
committed by GitHub
parent e2830f5b0e
commit 5e91f8f59d
5 changed files with 21 additions and 7 deletions

View File

@ -114,13 +114,23 @@ impl BankForks {
.banks
.get(&root)
.expect("root bank didn't exist in bank_forks");
let root_tx_count = root_bank
.parents()
.last()
.map(|bank| bank.transaction_count())
.unwrap_or(0);
root_bank.squash();
let new_tx_count = root_bank.transaction_count();
self.prune_non_root(root);
inc_new_counter_info!(
"bank-forks_set_root_ms",
timing::duration_as_ms(&set_root_start.elapsed()) as usize
);
inc_new_counter_info!(
"bank-forks_set_root_tx_count",
(new_tx_count - root_tx_count) as usize
);
}
pub fn root(&self) -> u64 {

View File

@ -357,6 +357,10 @@ impl BankingStage {
debug!("processed: {} ", processed_transactions.len());
// unlock all the accounts with errors which are filtered by the above `filter_map`
if !processed_transactions.is_empty() {
inc_new_counter_info!(
"banking_stage-record_transactions",
processed_transactions.len()
);
let hash = hash_transactions(&processed_transactions);
// record and unlock will unlock all the successful transactions
poh.lock()