11//! Metrics to track 
22//! 
33//! - Counters: 
4+ //!   - Number of builder blocks extracted 
45//!   - Number of builder blocks processed 
56//!   - Number of transactions processed 
6- //!   - slots  without builder blocks 
7+ //!   - Host blocks  without builder blocks 
78//! - Histograms: 
8- //!   - slots since last builder block 
9+ //!   - enter events extracted per block 
10+ //!   - enter token events extracted per block 
11+ //!   - transact events extracted per block 
12+ //!   - enter events processed per block 
13+ //!   - enter token events processed per block 
14+ //!   - transact events processed 
915//!   - Transaction counts per builder block 
1016
1117use  metrics:: { Counter ,  Histogram ,  counter,  describe_counter,  describe_histogram,  histogram} ; 
@@ -23,8 +29,8 @@ const BLOCKS_PROCESSED_HELP: &str = "Number of signet blocks processed";
2329const  TRANSACTIONS_PROCESSED :  & str  = "signet.block_processor.transactions_processed" ; 
2430const  TRANSACTIONS_PROCESSED_HELP :  & str  = "Number of transactions processed in signet blocks" ; 
2531
26- const  SLOTS_WITHOUT_BUILDER_BLOCK :  & str  = "signet.block_processor.slots_without_builder_block " ; 
27- const  SLOTS_WITHOUT_BUILDER_BLOCK_HELP :  & str  = "Number of slots  without builder blocks" ; 
32+ const  HOST_WITHOUT_BUILDER_BLOCK :  & str  = "signet.block_processor.host_without_builder_block " ; 
33+ const  HOST_WITHOUT_BUILDER_BLOCK_HELP :  & str  = "Number of host blocks  without builder blocks" ; 
2834
2935const  TRANSACTIONS_PER_BUILDER_BLOCK :  & str  = "signet.block_processor.txns_per_builder_block" ; 
3036const  TRANSACTIONS_PER_BUILDER_BLOCK_HELP :  & str  =
@@ -54,7 +60,7 @@ static DESCRIBE: LazyLock<()> = LazyLock::new(|| {
5460    describe_counter ! ( BUILDER_BLOCKS_EXTRACTED ,  BUILDER_BLOCKS_EXTRACTED_HELP ) ; 
5561    describe_counter ! ( BLOCKS_PROCESSED ,  BLOCKS_PROCESSED_HELP ) ; 
5662    describe_counter ! ( TRANSACTIONS_PROCESSED ,  TRANSACTIONS_PROCESSED_HELP ) ; 
57-     describe_counter ! ( SLOTS_WITHOUT_BUILDER_BLOCK ,   SLOTS_WITHOUT_BUILDER_BLOCK_HELP ) ; 
63+     describe_counter ! ( HOST_WITHOUT_BUILDER_BLOCK ,   HOST_WITHOUT_BUILDER_BLOCK_HELP ) ; 
5864
5965    describe_histogram ! ( TRANSACTIONS_PER_BUILDER_BLOCK ,  TRANSACTIONS_PER_BUILDER_BLOCK_HELP ) ; 
6066    describe_histogram ! ( TRANSACT_EXTRACTS ,  TRANSACT_EXTRACTS_HELP ) ; 
@@ -92,13 +98,13 @@ fn inc_transactions_processed(value: u64) {
9298    transactions_processed ( ) . increment ( value) ; 
9399} 
94100
95- fn  slots_without_builder_block ( )  -> Counter  { 
101+ fn  host_without_builder_block ( )  -> Counter  { 
96102    LazyLock :: force ( & DESCRIBE ) ; 
97-     counter ! ( SLOTS_WITHOUT_BUILDER_BLOCK ) 
103+     counter ! ( HOST_WITHOUT_BUILDER_BLOCK ) 
98104} 
99105
100- fn  inc_slots_without_builder_block ( )  { 
101-     slots_without_builder_block ( ) . increment ( 1 ) ; 
106+ fn  inc_host_without_builder_block ( )  { 
107+     host_without_builder_block ( ) . increment ( 1 ) ; 
102108} 
103109
104110fn  transactions_per_builder_block ( )  -> Histogram  { 
@@ -172,7 +178,7 @@ pub(crate) fn record_extracts<T: Extractable>(extracts: &Extracts<'_, T>) {
172178    if  extracts. events . submitted . is_some ( )  { 
173179        inc_blocks_extracted ( ) ; 
174180    }  else  { 
175-         inc_slots_without_builder_block ( ) ; 
181+         inc_host_without_builder_block ( ) ; 
176182    } 
177183} 
178184
0 commit comments