File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1- use metrics:: { Counter , Gauge } ;
1+ use metrics:: { Counter , Gauge , Histogram } ;
22use metrics_derive:: Metrics ;
33
44#[ derive( Metrics , Clone ) ]
@@ -27,4 +27,7 @@ pub struct FlashblocksServiceMetrics {
2727
2828 #[ metric( describe = "Number of messages processed by the service" ) ]
2929 pub messages_processed : Counter ,
30+
31+ #[ metric( describe = "Number of flashblocks used to build a block" ) ]
32+ pub flashblocks_used : Histogram ,
3033}
Original file line number Diff line number Diff line change @@ -228,6 +228,11 @@ impl FlashblocksService {
228228 // consume the best payload and reset the builder
229229 let payload = {
230230 let mut builder = self . best_payload . write ( ) . await ;
231+ let flashblocks_number = builder. flashblocks . len ( ) ;
232+ self . metrics
233+ . flashblocks_used
234+ . record ( flashblocks_number as f64 ) ;
235+ tracing:: Span :: current ( ) . record ( "flashblocks_count" , flashblocks_number) ;
231236 // Take payload and place new one in its place in one go to avoid double locking
232237 std:: mem:: replace ( & mut * builder, FlashblockBuilder :: new ( ) ) . into_envelope ( version) ?
233238 } ;
Original file line number Diff line number Diff line change @@ -438,6 +438,7 @@ where
438438 gas_delta,
439439 tx_count_delta,
440440 builder_has_payload,
441+ flashblocks_count,
441442 )
442443 ) ]
443444 async fn get_payload_v3 (
You can’t perform that action at this time.
0 commit comments