@@ -103,8 +103,8 @@ fn progress_from_tip(
103103 if height >= checkpoint_list. max_height ( ) {
104104 ( None , Progress :: FinalCheckpoint )
105105 } 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 ) ;
108108 ( Some ( hash) , Progress :: InitialTip ( height) )
109109 }
110110 }
@@ -303,7 +303,7 @@ where
303303 . next_back ( )
304304 . expect ( "queued has at least one entry" ) ;
305305
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 ) ;
307307
308308 let is_checkpoint = self . checkpoint_list . contains ( height) ;
309309 tracing:: debug!( ?height, ?hash, ?is_checkpoint, "queued block" ) ;
@@ -326,12 +326,12 @@ where
326326 return ;
327327 } ;
328328
329- metrics:: gauge!( "checkpoint.verified.height" , verified_height. 0 as f64 ) ;
329+ metrics:: gauge!( "checkpoint.verified.height" ) . set ( verified_height. 0 as f64 ) ;
330330
331331 let checkpoint_index = self . checkpoint_list . prev_checkpoint_index ( verified_height) ;
332332 let checkpoint_count = self . checkpoint_list . len ( ) ;
333333
334- metrics:: gauge!( "checkpoint.verified.count" , checkpoint_index as f64 ) ;
334+ metrics:: gauge!( "checkpoint.verified.count" ) . set ( checkpoint_index as f64 ) ;
335335
336336 tracing:: debug!(
337337 ?verified_height,
@@ -409,7 +409,7 @@ where
409409 // Check if we have the genesis block as a special case, to simplify the loop
410410 BeforeGenesis if !self . queued . contains_key ( & block:: Height ( 0 ) ) => {
411411 tracing:: trace!( "Waiting for genesis block" ) ;
412- metrics:: counter!( "checkpoint.waiting.count" , 1 ) ;
412+ metrics:: counter!( "checkpoint.waiting.count" ) . increment ( 1 ) ;
413413 return WaitingForBlocks ;
414414 }
415415 BeforeGenesis => block:: Height ( 0 ) ,
@@ -444,10 +444,7 @@ where
444444 break ;
445445 }
446446 }
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 ) ;
451448
452449 // Now find the start of the checkpoint range
453450 let start = self . current_start_bound ( ) . expect (
@@ -466,14 +463,11 @@ where
466463 ) ;
467464
468465 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 ) ;
473467 } else {
474468 // 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 ) ;
477471 }
478472
479473 target_checkpoint
@@ -541,12 +535,12 @@ where
541535 /// Increase the current checkpoint height to `verified_height`,
542536 fn update_progress ( & mut self , verified_height : block:: Height ) {
543537 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 ) ;
545539 } else {
546540 // 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 ) ;
548542 }
549- metrics:: gauge!( "checkpoint.queued_slots" , self . queued. len( ) as f64 ) ;
543+ metrics:: gauge!( "checkpoint.queued_slots" ) . set ( self . queued . len ( ) as f64 ) ;
550544
551545 // Ignore blocks that are below the previous checkpoint, or otherwise
552546 // have invalid heights.
@@ -869,7 +863,7 @@ where
869863
870864 let block_count = rev_valid_blocks. len ( ) ;
871865 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 ) ;
873867
874868 // All the blocks we've kept are valid, so let's verify them
875869 // in height order.
@@ -1058,7 +1052,7 @@ where
10581052
10591053 self . process_checkpoint_range ( ) ;
10601054
1061- metrics:: gauge!( "checkpoint.queued_slots" , self . queued. len( ) as f64 ) ;
1055+ metrics:: gauge!( "checkpoint.queued_slots" ) . set ( self . queued . len ( ) as f64 ) ;
10621056
10631057 // Because the checkpoint verifier duplicates state from the state
10641058 // service (it tracks which checkpoints have been verified), we must
0 commit comments