From 3a7d3ced516efc947a95032d2571329edb242f22 Mon Sep 17 00:00:00 2001 From: Michael McGee Date: Wed, 20 Mar 2024 16:17:10 +0000 Subject: [PATCH] metrics: add frags skipped metric to mux --- src/disco/metrics/generated/fd_metrics_all.c | 1 + src/disco/metrics/generated/fd_metrics_all.h | 11 ++++++++--- src/disco/metrics/metrics.xml | 1 + src/disco/mux/fd_mux.c | 5 +++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/disco/metrics/generated/fd_metrics_all.c b/src/disco/metrics/generated/fd_metrics_all.c index b203752318..79489200f1 100644 --- a/src/disco/metrics/generated/fd_metrics_all.c +++ b/src/disco/metrics/generated/fd_metrics_all.c @@ -22,6 +22,7 @@ const fd_metrics_meta_t FD_METRICS_ALL_LINK_IN[FD_METRICS_ALL_LINK_IN_TOTAL] = { DECLARE_METRIC_COUNTER( LINK, FILTERED_COUNT ), DECLARE_METRIC_COUNTER( LINK, FILTERED_SIZE_BYTES ), DECLARE_METRIC_COUNTER( LINK, OVERRUN_POLLING_COUNT ), + DECLARE_METRIC_COUNTER( LINK, OVERRUN_POLLING_FRAG_COUNT ), DECLARE_METRIC_COUNTER( LINK, OVERRUN_READING_COUNT ), }; const fd_metrics_meta_t FD_METRICS_ALL_LINK_OUT[FD_METRICS_ALL_LINK_OUT_TOTAL] = { diff --git a/src/disco/metrics/generated/fd_metrics_all.h b/src/disco/metrics/generated/fd_metrics_all.h index b26a0cb095..9079417481 100644 --- a/src/disco/metrics/generated/fd_metrics_all.h +++ b/src/disco/metrics/generated/fd_metrics_all.h @@ -36,7 +36,12 @@ #define FD_METRICS_COUNTER_LINK_OVERRUN_POLLING_COUNT_TYPE (FD_METRICS_TYPE_COUNTER) #define FD_METRICS_COUNTER_LINK_OVERRUN_POLLING_COUNT_DESC "The number of times the link has been overrun while polling." -#define FD_METRICS_COUNTER_LINK_OVERRUN_READING_COUNT_OFF (5UL) +#define FD_METRICS_COUNTER_LINK_OVERRUN_POLLING_FRAG_COUNT_OFF (5UL) +#define FD_METRICS_COUNTER_LINK_OVERRUN_POLLING_FRAG_COUNT_NAME "link_overrun_polling_frag_count" +#define FD_METRICS_COUNTER_LINK_OVERRUN_POLLING_FRAG_COUNT_TYPE (FD_METRICS_TYPE_COUNTER) +#define FD_METRICS_COUNTER_LINK_OVERRUN_POLLING_FRAG_COUNT_DESC "The number of fragments the link has not processed because it was overrun while polling." + +#define FD_METRICS_COUNTER_LINK_OVERRUN_READING_COUNT_OFF (6UL) #define FD_METRICS_COUNTER_LINK_OVERRUN_READING_COUNT_NAME "link_overrun_reading_count" #define FD_METRICS_COUNTER_LINK_OVERRUN_READING_COUNT_TYPE (FD_METRICS_TYPE_COUNTER) #define FD_METRICS_COUNTER_LINK_OVERRUN_READING_COUNT_DESC "The number of input overruns detected while reading metadata by the consumer." @@ -142,10 +147,10 @@ #define FD_METRICS_ALL_TOTAL (13UL) extern const fd_metrics_meta_t FD_METRICS_ALL[FD_METRICS_ALL_TOTAL]; -#define FD_METRICS_ALL_LINK_IN_TOTAL (6UL) +#define FD_METRICS_ALL_LINK_IN_TOTAL (7UL) extern const fd_metrics_meta_t FD_METRICS_ALL_LINK_IN[FD_METRICS_ALL_LINK_IN_TOTAL]; #define FD_METRICS_ALL_LINK_OUT_TOTAL (1UL) extern const fd_metrics_meta_t FD_METRICS_ALL_LINK_OUT[FD_METRICS_ALL_LINK_OUT_TOTAL]; -#define FD_METRICS_TOTAL_SZ (8UL*305UL) +#define FD_METRICS_TOTAL_SZ (8UL*306UL) diff --git a/src/disco/metrics/metrics.xml b/src/disco/metrics/metrics.xml index 777220a85e..b27ea3c8f1 100644 --- a/src/disco/metrics/metrics.xml +++ b/src/disco/metrics/metrics.xml @@ -116,6 +116,7 @@ metric introduced. + diff --git a/src/disco/mux/fd_mux.c b/src/disco/mux/fd_mux.c index d25d3a40b8..21316ce151 100644 --- a/src/disco/mux/fd_mux.c +++ b/src/disco/mux/fd_mux.c @@ -12,7 +12,7 @@ struct __attribute__((aligned(64))) fd_mux_tile_in { fd_frag_meta_t const * mline; /* == mcache + fd_mcache_line_idx( seq, depth ), location to poll next */ ulong * fseq; /* local join to the fseq used to return flow control credits to the in */ uint accum[6]; /* local diagnostic accumulators. These are drained during in housekeeping. */ - /* Assumes FD_FSEQ_DIAG_{PUB_CNT,PUB_SZ,FILT_CNT,FILT_SZ,OVRNP_CNT,OVRNR_CONT} are 0:5 */ + /* Assumes FD_FSEQ_DIAG_{PUB_CNT,PUB_SZ,FILT_CNT,FILT_SZ,OVRNP_CNT,OVRNP_FRAG_CNT} are 0:5 */ }; typedef struct fd_mux_tile_in fd_mux_tile_in_t; @@ -585,6 +585,7 @@ fd_mux_tile( fd_cnc_t * cnc, this_in->seq = seq_found; /* Resume from here (probably reasonably current, could query in mcache sync directly instead) */ hist = hist_ovrnp_ticks; this_in->accum[ FD_METRICS_COUNTER_LINK_OVERRUN_POLLING_COUNT_OFF ]++; + this_in->accum[ FD_METRICS_COUNTER_LINK_OVERRUN_POLLING_FRAG_COUNT_OFF ] += (uint)(-diff); } /* Don't bother with spin as polling multiple locations */ long next = fd_tickcount(); @@ -631,7 +632,7 @@ fd_mux_tile( fd_cnc_t * cnc, if( FD_UNLIKELY( fd_seq_ne( seq_test, seq_found ) ) ) { /* Overrun while reading (impossible if this_in honoring our fctl) */ this_in->seq = seq_test; /* Resume from here (probably reasonably current, could query in mcache sync instead) */ - this_in->accum[ FD_METRICS_COUNTER_LINK_OVERRUN_READING_COUNT_OFF ]++; + fd_metrics_link_in( fd_metrics_base_tl, this_in->idx )[ FD_METRICS_COUNTER_LINK_OVERRUN_READING_COUNT_OFF ]++; /* No local accum since extremely rare, faster to use smaller cache line */ /* Don't bother with spin as polling multiple locations */ long next = fd_tickcount(); fd_histf_sample( hist_ovrnr_ticks, (ulong)(next - now) );