add new leader slot metric to track account contention throttling (#27654)

This commit is contained in:
Maximilian Schneider 2022-09-08 16:22:58 +02:00 committed by GitHub
parent 82d12c4dda
commit cc58968b76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 0 deletions

View File

@ -104,6 +104,11 @@ struct LeaderSlotPacketCountMetrics {
// then hit the age limit after failing to be comitted. // then hit the age limit after failing to be comitted.
executed_transactions_failed_commit_count: u64, 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 // 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 // according to the cost model. These transactions are added back to the buffered queue and are
// already counted in `self.retrayble_errored_transaction_count`. // already counted in `self.retrayble_errored_transaction_count`.
@ -197,6 +202,11 @@ impl LeaderSlotPacketCountMetrics {
self.executed_transactions_failed_commit_count as i64, self.executed_transactions_failed_commit_count as i64,
i64 i64
), ),
(
"account_lock_throttled_transactions_count",
self.account_lock_throttled_transactions_count as i64,
i64
),
( (
"cost_model_throttled_transactions_count", "cost_model_throttled_transactions_count",
self.cost_model_throttled_transactions_count as i64, self.cost_model_throttled_transactions_count as i64,
@ -394,6 +404,7 @@ impl LeaderSlotMetricsTracker {
cost_model_throttled_transactions_count, cost_model_throttled_transactions_count,
cost_model_us, cost_model_us,
ref execute_and_commit_timings, ref execute_and_commit_timings,
error_counters,
.. ..
} = process_transactions_summary; } = process_transactions_summary;
@ -441,6 +452,13 @@ impl LeaderSlotMetricsTracker {
.saturating_sub(retryable_transaction_indexes.len()) as u64 .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!( saturating_add_assign!(
leader_slot_metrics leader_slot_metrics
.packet_count_metrics .packet_count_metrics