File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
beacon_node/beacon_chain/src Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -4322,6 +4322,9 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
4322
4322
payload_verification_status : PayloadVerificationStatus ,
4323
4323
current_slot : Slot ,
4324
4324
) {
4325
+ let block_delay_total =
4326
+ get_slot_delay_ms ( block_time_imported, block. slot ( ) , & self . slot_clock ) ;
4327
+
4325
4328
// Only present some metrics for blocks from the previous epoch or later.
4326
4329
//
4327
4330
// This helps avoid noise in the metrics during sync.
@@ -4331,6 +4334,11 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
4331
4334
block. body ( ) . attestations_len ( ) as f64 ,
4332
4335
) ;
4333
4336
4337
+ metrics:: set_gauge (
4338
+ & metrics:: BLOCK_AVAILABILITY_DELAY ,
4339
+ block_delay_total. as_secs ( ) as i64 ,
4340
+ ) ;
4341
+
4334
4342
if let Ok ( sync_aggregate) = block. body ( ) . sync_aggregate ( ) {
4335
4343
metrics:: set_gauge (
4336
4344
& metrics:: BLOCK_SYNC_AGGREGATE_SET_BITS ,
@@ -4339,9 +4347,6 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
4339
4347
}
4340
4348
}
4341
4349
4342
- let block_delay_total =
4343
- get_slot_delay_ms ( block_time_imported, block. slot ( ) , & self . slot_clock ) ;
4344
-
4345
4350
// Do not write to the cache for blocks older than 2 epochs, this helps reduce writes to
4346
4351
// the cache during sync.
4347
4352
if block_delay_total < self . slot_clock . slot_duration ( ) * 64 {
Original file line number Diff line number Diff line change @@ -1835,6 +1835,16 @@ pub static BLOCK_PRODUCTION_BLOBS_VERIFICATION_TIMES: LazyLock<Result<Histogram>
1835
1835
} ,
1836
1836
) ;
1837
1837
1838
+ /*
1839
+ * Availability related metrics
1840
+ */
1841
+ pub static BLOCK_AVAILABILITY_DELAY : LazyLock < Result < IntGauge > > = LazyLock :: new ( || {
1842
+ try_create_int_gauge (
1843
+ "block_availability_delay" ,
1844
+ "Duration between start of the slot and the time at which all components of the block are available." ,
1845
+ )
1846
+ } ) ;
1847
+
1838
1848
/*
1839
1849
* Data Availability cache metrics
1840
1850
*/
You can’t perform that action at this time.
0 commit comments