From 211a42fb986721aa9470d6622ef44b924df5c9e2 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 3 Mar 2021 01:36:09 +0000 Subject: [PATCH] adds more metrics for tx counts and batch sizes (#15642) (#15645) (cherry picked from commit 0bd0084b0dde1396827b9e5e477d1daa0b4a59ef) Co-authored-by: behzad nouri --- core/src/banking_stage.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/src/banking_stage.rs b/core/src/banking_stage.rs index 2fd71f72c3..cbfa20526d 100644 --- a/core/src/banking_stage.rs +++ b/core/src/banking_stage.rs @@ -490,6 +490,7 @@ impl BankingStage { debug!("num_to_commit: {} ", num_to_commit); // 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_count", 1); inc_new_counter_info!("banking_stage-record_transactions", num_to_commit); let mut hash_time = Measure::start("record::hash"); @@ -506,6 +507,11 @@ impl BankingStage { match res { Ok(()) => (), Err(PohRecorderError::MaxHeightReached) => { + inc_new_counter_info!("banking_stage-max_height_reached", 1); + inc_new_counter_info!( + "banking_stage-max_height_reached_num_to_commit", + num_to_commit + ); // If record errors, add all the committable transactions (the ones // we just attempted to record) as retryable return ( @@ -571,6 +577,14 @@ impl BankingStage { let mut record_time = Measure::start("record_time"); let (num_to_commit, retryable_record_txs) = Self::record_transactions(bank.slot(), txs, &results, poh); + inc_new_counter_info!( + "banking_stage-record_transactions_num_to_commit", + *num_to_commit.as_ref().unwrap_or(&0) + ); + inc_new_counter_info!( + "banking_stage-record_transactions_retryable_record_txs", + retryable_record_txs.len() + ); retryable_txs.extend(retryable_record_txs); if num_to_commit.is_err() { return (num_to_commit, retryable_txs);