LCOV - code coverage report
Current view: top level - discof/repair - fd_repair_metrics.h (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 0 7 0.0 %
Date: 2025-10-27 04:40:00 Functions: 0 6 0.0 %

          Line data    Source code
       1             : #ifndef HEADER_fd_src_discof_repair_fd_repair_metrics_h
       2             : #define HEADER_fd_src_discof_repair_fd_repair_metrics_h
       3             : 
       4             : /* fd_repair_metrics tracks metadata on the N most recent slots, in particular
       5             :    the time it took to complete the slot.  As this purpose of this
       6             :    module currently is exclusively to print a waterfall diagram of the
       7             :    repair_metrics progress, this is a circular buffer of the last N slots,
       8             :    where N=256 and is non-configurable. */
       9             : 
      10             : #include "../../util/fd_util_base.h"
      11             : struct fd_slot_metrics {
      12             :   ulong slot;
      13             :   long  first_ts;
      14             :   long  slot_complete_ts; /* tick */
      15             : 
      16             :   uint repair_cnt;
      17             :   uint turbine_cnt;
      18             : };
      19             : typedef struct fd_slot_metrics fd_slot_metrics_t;
      20             : 
      21           0 : #define FD_CATCHUP_METRICS_MAX 256
      22             : 
      23             : struct fd_repair_metrics_t {
      24             :   fd_slot_metrics_t slots[ FD_CATCHUP_METRICS_MAX ];
      25             :   uint              st;
      26             :   uint              en;
      27             :   ulong             turbine_slot0;
      28             : };
      29             : typedef struct fd_repair_metrics_t fd_repair_metrics_t;
      30             : 
      31             : 
      32             : FD_FN_CONST static inline ulong
      33           0 : fd_repair_metrics_align( void ) {
      34           0 :   return alignof( fd_slot_metrics_t );
      35           0 : }
      36             : 
      37             : FD_FN_CONST static inline ulong
      38           0 : fd_repair_metrics_footprint( void ) {
      39           0 :   return sizeof( fd_repair_metrics_t );
      40           0 : }
      41             : 
      42             : void *
      43             : fd_repair_metrics_new( void * mem );
      44             : 
      45             : fd_repair_metrics_t *
      46             : fd_repair_metrics_join( void * repair_metrics );
      47             : 
      48             : void
      49             : fd_repair_metrics_set_turbine_slot0( fd_repair_metrics_t * repair_metrics, ulong turbine_slot0 );
      50             : 
      51             : void
      52             : fd_repair_metrics_print( fd_repair_metrics_t * repair_metrics, int verbose );
      53             : 
      54             : void
      55             : fd_repair_metrics_add_slot( fd_repair_metrics_t * repair_metrics, ulong slot, long first_ts, long slot_complete_ts, uint repair_cnt, uint turbine_cnt );
      56             : 
      57             : 
      58             : 
      59             : #endif /* HEADER_fd_src_discof_repair_fd_repair_metrics_h */

Generated by: LCOV version 1.14