mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-30 01:28:21 -05:00
feat: add reorg metrics (#3824)
This commit is contained in:
@@ -1003,6 +1003,7 @@ impl<DB: Database, C: Consensus, EF: ExecutorFactory> BlockchainTree<DB, C, EF>
|
||||
};
|
||||
// insert old canon chain
|
||||
self.insert_chain(AppendableChain::new(old_canon_chain));
|
||||
self.metrics.reorgs.increment(1);
|
||||
} else {
|
||||
// error here to confirm that we are reverting nothing from db.
|
||||
error!(target: "blockchain_tree", "Reverting nothing from db on block: #{:?}", block_hash);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use reth_metrics::{
|
||||
metrics::{self, Gauge},
|
||||
metrics::{self, Counter, Gauge},
|
||||
Metrics,
|
||||
};
|
||||
|
||||
@@ -11,6 +11,8 @@ pub struct TreeMetrics {
|
||||
pub sidechains: Gauge,
|
||||
/// The highest block number in the canonical chain
|
||||
pub canonical_chain_height: Gauge,
|
||||
/// The number of reorgs
|
||||
pub reorgs: Counter,
|
||||
}
|
||||
|
||||
/// Metrics for the blockchain tree block buffer
|
||||
|
||||
Reference in New Issue
Block a user