Skip to content

Commit

Permalink
metrics: add frags skipped metric to mux
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcgee-jump committed Mar 20, 2024
1 parent d08156a commit 3a7d3ce
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/disco/metrics/generated/fd_metrics_all.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {
Expand Down
11 changes: 8 additions & 3 deletions src/disco/metrics/generated/fd_metrics_all.h
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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)
1 change: 1 addition & 0 deletions src/disco/metrics/metrics.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ metric introduced.
<counter name="FilteredCount" summary="The number of consumed fragments that were filtered." />
<counter name="FilteredSizeBytes" summary="The total number of bytes read by the link consumer that were filtered." />
<counter name="OverrunPollingCount" summary="The number of times the link has been overrun while polling." />
<counter name="OverrunPollingFragCount" summary="The number of fragments the link has not processed because it was overrun while polling." />
<counter name="OverrunReadingCount" summary="The number of input overruns detected while reading metadata by the consumer." />
</group>

Expand Down
5 changes: 3 additions & 2 deletions src/disco/mux/fd_mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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) );
Expand Down

0 comments on commit 3a7d3ce

Please sign in to comment.