feat: add performed pool state updates metric (#3714)

This commit is contained in:
Matthias Seitz
2023-07-11 15:56:33 +02:00
committed by GitHub
parent 8f2e0cd7f0
commit 2effa942e1
2 changed files with 5 additions and 0 deletions

View File

@@ -33,6 +33,9 @@ pub struct TxPoolMetrics {
/// Number of all transactions of all sub-pools: pending + basefee + queued
pub(crate) total_transactions: Gauge,
/// How often the pool was updated after the canonical state changed
pub(crate) performed_state_updates: Counter,
}
/// Transaction pool maintenance metrics

View File

@@ -261,6 +261,8 @@ impl<T: TransactionOrdering> TxPool<T> {
// update the metrics after the update
self.update_size_metrics();
self.metrics.performed_state_updates.increment(1);
OnNewCanonicalStateOutcome { block_hash, mined: mined_transactions, promoted, discarded }
}