Skip to content

Commit b15faf3

Browse files
committed
gui: fix gossip votes in sankey
1 parent b9b5fb3 commit b15faf3

File tree

11 files changed

+198
-157
lines changed

11 files changed

+198
-157
lines changed

book/api/metrics-generated.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@
222222
| <span class="metrics-name">verify_&#8203;transaction_&#8203;parse_&#8203;failure</span> | counter | Count of transactions that failed to parse |
223223
| <span class="metrics-name">verify_&#8203;transaction_&#8203;dedup_&#8203;failure</span> | counter | Count of transactions that failed to deduplicate in the verify stage |
224224
| <span class="metrics-name">verify_&#8203;transaction_&#8203;verify_&#8203;failure</span> | counter | Count of transactions that failed to deduplicate in the verify stage |
225+
| <span class="metrics-name">verify_&#8203;gossiped_&#8203;votes_&#8203;received</span> | counter | Count of simple vote transactions received over gossip instead of via the normal TPU path |
225226

226227
</div>
227228

@@ -720,6 +721,7 @@
720721
| <span class="metrics-name">send_&#8203;leader_&#8203;not_&#8203;found</span> | counter | Total number of times slot leader not found |
721722
| <span class="metrics-name">send_&#8203;unstaked_&#8203;ci</span> | counter | Total number of times we received contact info for an unstaked node |
722723
| <span class="metrics-name">send_&#8203;ci_&#8203;removed</span> | counter | Total number of times we removed contact info |
724+
| <span class="metrics-name">send_&#8203;votes</span> | counter | Total number of simple vote transactions sent into the normal TPU path |
723725
| <span class="metrics-name">send_&#8203;new_&#8203;contact_&#8203;info_&#8203;quic_&#8203;vote</span><br/>{new_&#8203;contact_&#8203;outcome="<span class="metrics-enum">unroutable</span>"} | counter | Total number of contact infos received and handled for QUIC Vote port (Skipped (unroutable)) |
724726
| <span class="metrics-name">send_&#8203;new_&#8203;contact_&#8203;info_&#8203;quic_&#8203;vote</span><br/>{new_&#8203;contact_&#8203;outcome="<span class="metrics-enum">initialized</span>"} | counter | Total number of contact infos received and handled for QUIC Vote port (Initialized) |
725727
| <span class="metrics-name">send_&#8203;new_&#8203;contact_&#8203;info_&#8203;quic_&#8203;vote</span><br/>{new_&#8203;contact_&#8203;outcome="<span class="metrics-enum">changed</span>"} | counter | Total number of contact infos received and handled for QUIC Vote port (Contact info changed) |

src/disco/gui/fd_gui.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,22 @@ fd_gui_txn_waterfall_snap( fd_gui_t * gui,
554554
+ pack_metrics[ MIDX( COUNTER, PACK, BUNDLE_CRANK_STATUS_INSERTION_FAILED ) ]
555555
+ pack_metrics[ MIDX( COUNTER, PACK, BUNDLE_CRANK_STATUS_CREATION_FAILED ) ];
556556

557-
cur->in.gossip = dedup_metrics[ MIDX( COUNTER, DEDUP, GOSSIPED_VOTES_RECEIVED ) ];
557+
if( FD_UNLIKELY( gui->summary.is_full_client ) ) {
558+
cur->in.gossip = 0UL;
559+
for( ulong i=0UL; i<gui->summary.verify_tile_cnt; i++ ) {
560+
fd_topo_tile_t const * verify = &topo->tiles[ fd_topo_find_tile( topo, "verify", i ) ];
561+
volatile ulong const * verify_metrics = fd_metrics_tile( verify->metrics );
562+
cur->in.gossip += verify_metrics[ MIDX( COUNTER, VERIFY, GOSSIPED_VOTES_RECEIVED ) ];
563+
}
564+
565+
fd_topo_tile_t const * send = &topo->tiles[ fd_topo_find_tile( topo, "send", 0UL ) ];
566+
volatile ulong const * send_metrics = fd_metrics_tile( send->metrics );
567+
cur->in.gossip += send_metrics[ MIDX( COUNTER, SEND, VOTES ) ];
568+
cur->in.gossip += dedup_metrics[ MIDX( COUNTER, DEDUP, GOSSIPED_VOTES_RECEIVED ) ];
569+
} else {
570+
cur->in.gossip = dedup_metrics[ MIDX( COUNTER, DEDUP, GOSSIPED_VOTES_RECEIVED ) ];
571+
}
572+
558573
cur->in.quic = cur->out.tpu_quic_invalid +
559574
cur->out.quic_overrun +
560575
cur->out.quic_frag_drop +

src/disco/metrics/generated/fd_metrics_send.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const fd_metrics_meta_t FD_METRICS_SEND[FD_METRICS_SEND_TOTAL] = {
55
DECLARE_METRIC( SEND_LEADER_NOT_FOUND, COUNTER ),
66
DECLARE_METRIC( SEND_UNSTAKED_CI, COUNTER ),
77
DECLARE_METRIC( SEND_CI_REMOVED, COUNTER ),
8+
DECLARE_METRIC( SEND_VOTES, COUNTER ),
89
DECLARE_METRIC_ENUM( SEND_NEW_CONTACT_INFO_QUIC_VOTE, COUNTER, NEW_CONTACT_OUTCOME, UNROUTABLE ),
910
DECLARE_METRIC_ENUM( SEND_NEW_CONTACT_INFO_QUIC_VOTE, COUNTER, NEW_CONTACT_OUTCOME, INITIALIZED ),
1011
DECLARE_METRIC_ENUM( SEND_NEW_CONTACT_INFO_QUIC_VOTE, COUNTER, NEW_CONTACT_OUTCOME, CHANGED ),

src/disco/metrics/generated/fd_metrics_send.h

Lines changed: 160 additions & 154 deletions
Large diffs are not rendered by default.

src/disco/metrics/generated/fd_metrics_verify.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ const fd_metrics_meta_t FD_METRICS_VERIFY[FD_METRICS_VERIFY_TOTAL] = {
66
DECLARE_METRIC( VERIFY_TRANSACTION_PARSE_FAILURE, COUNTER ),
77
DECLARE_METRIC( VERIFY_TRANSACTION_DEDUP_FAILURE, COUNTER ),
88
DECLARE_METRIC( VERIFY_TRANSACTION_VERIFY_FAILURE, COUNTER ),
9+
DECLARE_METRIC( VERIFY_GOSSIPED_VOTES_RECEIVED, COUNTER ),
910
};

src/disco/metrics/generated/fd_metrics_verify.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@
3030
#define FD_METRICS_COUNTER_VERIFY_TRANSACTION_VERIFY_FAILURE_DESC "Count of transactions that failed to deduplicate in the verify stage"
3131
#define FD_METRICS_COUNTER_VERIFY_TRANSACTION_VERIFY_FAILURE_CVT (FD_METRICS_CONVERTER_NONE)
3232

33-
#define FD_METRICS_VERIFY_TOTAL (4UL)
33+
#define FD_METRICS_COUNTER_VERIFY_GOSSIPED_VOTES_RECEIVED_OFF (20UL)
34+
#define FD_METRICS_COUNTER_VERIFY_GOSSIPED_VOTES_RECEIVED_NAME "verify_gossiped_votes_received"
35+
#define FD_METRICS_COUNTER_VERIFY_GOSSIPED_VOTES_RECEIVED_TYPE (FD_METRICS_TYPE_COUNTER)
36+
#define FD_METRICS_COUNTER_VERIFY_GOSSIPED_VOTES_RECEIVED_DESC "Count of simple vote transactions received over gossip instead of via the normal TPU path"
37+
#define FD_METRICS_COUNTER_VERIFY_GOSSIPED_VOTES_RECEIVED_CVT (FD_METRICS_CONVERTER_NONE)
38+
39+
#define FD_METRICS_VERIFY_TOTAL (5UL)
3440
extern const fd_metrics_meta_t FD_METRICS_VERIFY[FD_METRICS_VERIFY_TOTAL];
3541

3642
#endif /* HEADER_fd_src_disco_metrics_generated_fd_metrics_verify_h */

src/disco/metrics/metrics.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ metric introduced.
290290
<counter name="LeaderNotFound" summary="Total number of times slot leader not found" />
291291
<counter name="UnstakedCi" summary="Total number of times we received contact info for an unstaked node" />
292292
<counter name="CiRemoved" summary="Total number of times we removed contact info" />
293+
<counter name="Votes" summary="Total number of simple vote transactions sent into the normal TPU path" />
293294

294295
<counter name="NewContactInfoQuicVote" enum="NewContactOutcome" summary="Total number of contact infos received and handled for QUIC Vote port" />
295296
<counter name="NewContactInfoQuicTpu" enum="NewContactOutcome" summary="Total number of contact infos received and handled for QUIC TPU port" />
@@ -403,6 +404,7 @@ metric introduced.
403404
<counter name="TransactionParseFailure" summary="Count of transactions that failed to parse" />
404405
<counter name="TransactionDedupFailure" summary="Count of transactions that failed to deduplicate in the verify stage" />
405406
<counter name="TransactionVerifyFailure" summary="Count of transactions that failed to deduplicate in the verify stage" />
407+
<counter name="GossipedVotesReceived" summary="Count of simple vote transactions received over gossip instead of via the normal TPU path" />
406408
</tile>
407409

408410
<tile name="dedup">

src/disco/verify/fd_verify_tile.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ scratch_footprint( fd_topo_tile_t const * tile ) {
2727

2828
static inline void
2929
metrics_write( fd_verify_ctx_t * ctx ) {
30+
FD_MCNT_SET( VERIFY, TRANSACTION_BUNDLE_PEER_FAILURE, ctx->metrics.bundle_peer_fail_cnt );
3031
FD_MCNT_SET( VERIFY, TRANSACTION_BUNDLE_PEER_FAILURE, ctx->metrics.bundle_peer_fail_cnt );
3132
FD_MCNT_SET( VERIFY, TRANSACTION_PARSE_FAILURE, ctx->metrics.parse_fail_cnt );
3233
FD_MCNT_SET( VERIFY, TRANSACTION_DEDUP_FAILURE, ctx->metrics.dedup_fail_cnt );
33-
FD_MCNT_SET( VERIFY, TRANSACTION_VERIFY_FAILURE, ctx->metrics.verify_fail_cnt );
34+
FD_MCNT_SET( VERIFY, GOSSIPED_VOTES_RECEIVED, ctx->metrics.gossiped_votes_cnt );
3435
}
3536

3637
static int
@@ -151,6 +152,8 @@ after_frag( fd_verify_ctx_t * ctx,
151152
return;
152153
}
153154

155+
if( FD_UNLIKELY( ctx->in_kind[ in_idx ]==IN_KIND_GOSSIP ) ) ctx->metrics.gossiped_votes_cnt++;
156+
154157
ulong realized_sz = fd_txn_m_realized_footprint( txnm, 1, 0 );
155158
ulong tspub = (ulong)fd_frag_meta_ts_comp( fd_tickcount() );
156159
fd_stem_publish( stem, 0UL, 0UL, ctx->out_chunk, realized_sz, 0UL, tsorig, tspub );

src/disco/verify/fd_verify_tile.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ typedef struct {
5353
ulong verify_fail_cnt;
5454
ulong dedup_fail_cnt;
5555
ulong bundle_peer_fail_cnt;
56+
ulong gossiped_votes_cnt;
5657
} metrics;
5758
} fd_verify_ctx_t;
5859

src/discof/send/fd_send_tile.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,8 @@ handle_vote_msg( fd_send_tile_ctx_t * ctx,
503503
msg_sz,
504504
gossip_verify_out->chunk0,
505505
gossip_verify_out->wmark );
506+
507+
ctx->metrics.votes_sent++;
506508
}
507509

508510
/* Stem callbacks */
@@ -803,6 +805,7 @@ metrics_write( fd_send_tile_ctx_t * ctx ) {
803805
FD_MCNT_SET( SEND, LEADER_NOT_FOUND, ctx->metrics.leader_not_found );
804806
FD_MCNT_SET( SEND, UNSTAKED_CI, ctx->metrics.unstaked_ci_rcvd );
805807
FD_MCNT_SET( SEND, CI_REMOVED, ctx->metrics.ci_removed );
808+
FD_MCNT_SET( SEND, VOTES, ctx->metrics.votes_sent );
806809

807810
/* Port-separated contact info metrics */
808811
FD_MCNT_ENUM_COPY( SEND, NEW_CONTACT_INFO_QUIC_VOTE, ctx->metrics.new_contact_info[FD_SEND_PORT_QUIC_VOTE_IDX] );

0 commit comments

Comments
 (0)