From cc58968b762897f58a3873cf9cda202acbd44797 Mon Sep 17 00:00:00 2001 From: Maximilian Schneider Date: Thu, 8 Sep 2022 16:22:58 +0200 Subject: [PATCH] add new leader slot metric to track account contention throttling (#27654) --- core/src/leader_slot_banking_stage_metrics.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/core/src/leader_slot_banking_stage_metrics.rs b/core/src/leader_slot_banking_stage_metrics.rs index 06e767ed35..a189efde15 100644 --- a/core/src/leader_slot_banking_stage_metrics.rs +++ b/core/src/leader_slot_banking_stage_metrics.rs @@ -104,6 +104,11 @@ struct LeaderSlotPacketCountMetrics { // then hit the age limit after failing to be comitted. executed_transactions_failed_commit_count: u64, + // total number of transactions that were excluded from the block because there were concurrent write locks active. + // These transactions are added back to the buffered queue and are already counted in + // `self.retrayble_errored_transaction_count`. + account_lock_throttled_transactions_count: u64, + // total number of transactions that were excluded from the block because they were too expensive // according to the cost model. These transactions are added back to the buffered queue and are // already counted in `self.retrayble_errored_transaction_count`. @@ -197,6 +202,11 @@ impl LeaderSlotPacketCountMetrics { self.executed_transactions_failed_commit_count as i64, i64 ), + ( + "account_lock_throttled_transactions_count", + self.account_lock_throttled_transactions_count as i64, + i64 + ), ( "cost_model_throttled_transactions_count", self.cost_model_throttled_transactions_count as i64, @@ -394,6 +404,7 @@ impl LeaderSlotMetricsTracker { cost_model_throttled_transactions_count, cost_model_us, ref execute_and_commit_timings, + error_counters, .. } = process_transactions_summary; @@ -441,6 +452,13 @@ impl LeaderSlotMetricsTracker { .saturating_sub(retryable_transaction_indexes.len()) as u64 ); + saturating_add_assign!( + leader_slot_metrics + .packet_count_metrics + .account_lock_throttled_transactions_count, + error_counters.account_in_use as u64 + ); + saturating_add_assign!( leader_slot_metrics .packet_count_metrics