@@ -103,8 +103,8 @@ fn progress_from_tip(
103
103
if height >= checkpoint_list. max_height ( ) {
104
104
( None , Progress :: FinalCheckpoint )
105
105
} else {
106
- metrics:: gauge!( "checkpoint.verified.height" , height. 0 as f64 ) ;
107
- metrics:: gauge!( "checkpoint.processing.next.height" , height. 0 as f64 ) ;
106
+ metrics:: gauge!( "checkpoint.verified.height" ) . set ( height. 0 as f64 ) ;
107
+ metrics:: gauge!( "checkpoint.processing.next.height" ) . set ( height. 0 as f64 ) ;
108
108
( Some ( hash) , Progress :: InitialTip ( height) )
109
109
}
110
110
}
@@ -303,7 +303,7 @@ where
303
303
. next_back ( )
304
304
. expect ( "queued has at least one entry" ) ;
305
305
306
- metrics:: gauge!( "checkpoint.queued.max.height" , max_queued_height. 0 as f64 ) ;
306
+ metrics:: gauge!( "checkpoint.queued.max.height" ) . set ( max_queued_height. 0 as f64 ) ;
307
307
308
308
let is_checkpoint = self . checkpoint_list . contains ( height) ;
309
309
tracing:: debug!( ?height, ?hash, ?is_checkpoint, "queued block" ) ;
@@ -326,12 +326,12 @@ where
326
326
return ;
327
327
} ;
328
328
329
- metrics:: gauge!( "checkpoint.verified.height" , verified_height. 0 as f64 ) ;
329
+ metrics:: gauge!( "checkpoint.verified.height" ) . set ( verified_height. 0 as f64 ) ;
330
330
331
331
let checkpoint_index = self . checkpoint_list . prev_checkpoint_index ( verified_height) ;
332
332
let checkpoint_count = self . checkpoint_list . len ( ) ;
333
333
334
- metrics:: gauge!( "checkpoint.verified.count" , checkpoint_index as f64 ) ;
334
+ metrics:: gauge!( "checkpoint.verified.count" ) . set ( checkpoint_index as f64 ) ;
335
335
336
336
tracing:: debug!(
337
337
?verified_height,
@@ -409,7 +409,7 @@ where
409
409
// Check if we have the genesis block as a special case, to simplify the loop
410
410
BeforeGenesis if !self . queued . contains_key ( & block:: Height ( 0 ) ) => {
411
411
tracing:: trace!( "Waiting for genesis block" ) ;
412
- metrics:: counter!( "checkpoint.waiting.count" , 1 ) ;
412
+ metrics:: counter!( "checkpoint.waiting.count" ) . increment ( 1 ) ;
413
413
return WaitingForBlocks ;
414
414
}
415
415
BeforeGenesis => block:: Height ( 0 ) ,
@@ -444,10 +444,7 @@ where
444
444
break ;
445
445
}
446
446
}
447
- metrics:: gauge!(
448
- "checkpoint.queued.continuous.height" ,
449
- pending_height. 0 as f64 ,
450
- ) ;
447
+ metrics:: gauge!( "checkpoint.queued.continuous.height" ) . set ( pending_height. 0 as f64 ) ;
451
448
452
449
// Now find the start of the checkpoint range
453
450
let start = self . current_start_bound ( ) . expect (
@@ -466,14 +463,11 @@ where
466
463
) ;
467
464
468
465
if let Some ( block:: Height ( target_checkpoint) ) = target_checkpoint {
469
- metrics:: gauge!(
470
- "checkpoint.processing.next.height" ,
471
- target_checkpoint as f64 ,
472
- ) ;
466
+ metrics:: gauge!( "checkpoint.processing.next.height" ) . set ( target_checkpoint as f64 ) ;
473
467
} else {
474
468
// Use the start height if there is no potential next checkpoint
475
- metrics:: gauge!( "checkpoint.processing.next.height" , start_height. 0 as f64 ) ;
476
- metrics:: counter!( "checkpoint.waiting.count" , 1 ) ;
469
+ metrics:: gauge!( "checkpoint.processing.next.height" ) . set ( start_height. 0 as f64 ) ;
470
+ metrics:: counter!( "checkpoint.waiting.count" ) . increment ( 1 ) ;
477
471
}
478
472
479
473
target_checkpoint
@@ -541,12 +535,12 @@ where
541
535
/// Increase the current checkpoint height to `verified_height`,
542
536
fn update_progress ( & mut self , verified_height : block:: Height ) {
543
537
if let Some ( max_height) = self . queued . keys ( ) . next_back ( ) {
544
- metrics:: gauge!( "checkpoint.queued.max.height" , max_height. 0 as f64 ) ;
538
+ metrics:: gauge!( "checkpoint.queued.max.height" ) . set ( max_height. 0 as f64 ) ;
545
539
} else {
546
540
// use f64::NAN as a sentinel value for "None", because 0 is a valid height
547
- metrics:: gauge!( "checkpoint.queued.max.height" , f64 :: NAN ) ;
541
+ metrics:: gauge!( "checkpoint.queued.max.height" ) . set ( f64:: NAN ) ;
548
542
}
549
- metrics:: gauge!( "checkpoint.queued_slots" , self . queued. len( ) as f64 ) ;
543
+ metrics:: gauge!( "checkpoint.queued_slots" ) . set ( self . queued . len ( ) as f64 ) ;
550
544
551
545
// Ignore blocks that are below the previous checkpoint, or otherwise
552
546
// have invalid heights.
@@ -869,7 +863,7 @@ where
869
863
870
864
let block_count = rev_valid_blocks. len ( ) ;
871
865
tracing:: info!( ?block_count, ?current_range, "verified checkpoint range" ) ;
872
- metrics:: counter!( "checkpoint.verified.block.count" , block_count as u64 ) ;
866
+ metrics:: counter!( "checkpoint.verified.block.count" ) . increment ( block_count as u64 ) ;
873
867
874
868
// All the blocks we've kept are valid, so let's verify them
875
869
// in height order.
@@ -1058,7 +1052,7 @@ where
1058
1052
1059
1053
self . process_checkpoint_range ( ) ;
1060
1054
1061
- metrics:: gauge!( "checkpoint.queued_slots" , self . queued. len( ) as f64 ) ;
1055
+ metrics:: gauge!( "checkpoint.queued_slots" ) . set ( self . queued . len ( ) as f64 ) ;
1062
1056
1063
1057
// Because the checkpoint verifier duplicates state from the state
1064
1058
// service (it tracks which checkpoints have been verified), we must
0 commit comments