Skip to content

Commit d2aec3e

Browse files
quic: update receive_duration hist within fd_quic
1 parent 1840786 commit d2aec3e

File tree

12 files changed

+35
-38
lines changed

12 files changed

+35
-38
lines changed

book/api/metrics-generated.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
| <span class="metrics-name">quic_&#8203;ack_&#8203;tx</span><br/>{quic_&#8203;ack_&#8203;tx="<span class="metrics-enum">drop</span>"} | counter | ACK events (out of buffers) |
145145
| <span class="metrics-name">quic_&#8203;ack_&#8203;tx</span><br/>{quic_&#8203;ack_&#8203;tx="<span class="metrics-enum">cancel</span>"} | counter | ACK events (ACK suppressed by handler) |
146146
| <span class="metrics-name">quic_&#8203;service_&#8203;duration_&#8203;seconds</span> | histogram | Duration spent in service |
147-
| <span class="metrics-name">quic_&#8203;receive_&#8203;duration_&#8203;seconds</span> | histogram | Duration spent receiving packets |
147+
| <span class="metrics-name">quic_&#8203;receive_&#8203;duration_&#8203;seconds</span> | histogram | Duration spent processing packets |
148148
| <span class="metrics-name">quic_&#8203;frame_&#8203;fail_&#8203;parse</span> | counter | Number of QUIC frames failed to parse. |
149149
| <span class="metrics-name">quic_&#8203;pkt_&#8203;crypto_&#8203;failed</span><br/>{quic_&#8203;enc_&#8203;level="<span class="metrics-enum">initial</span>"} | counter | Number of packets that failed decryption. (initial) |
150150
| <span class="metrics-name">quic_&#8203;pkt_&#8203;crypto_&#8203;failed</span><br/>{quic_&#8203;enc_&#8203;level="<span class="metrics-enum">early</span>"} | counter | Number of packets that failed decryption. (early data) |
@@ -788,7 +788,7 @@
788788
| <span class="metrics-name">send_&#8203;ack_&#8203;tx</span><br/>{quic_&#8203;ack_&#8203;tx="<span class="metrics-enum">drop</span>"} | counter | Total count of ACK frames transmitted (out of buffers) |
789789
| <span class="metrics-name">send_&#8203;ack_&#8203;tx</span><br/>{quic_&#8203;ack_&#8203;tx="<span class="metrics-enum">cancel</span>"} | counter | Total count of ACK frames transmitted (ACK suppressed by handler) |
790790
| <span class="metrics-name">send_&#8203;service_&#8203;duration_&#8203;seconds</span> | histogram | Duration spent in service |
791-
| <span class="metrics-name">send_&#8203;receive_&#8203;duration_&#8203;seconds</span> | histogram | Duration spent receiving packets |
791+
| <span class="metrics-name">send_&#8203;receive_&#8203;duration_&#8203;seconds</span> | histogram | Duration spent processing packets |
792792

793793
</div>
794794

@@ -798,7 +798,7 @@
798798

799799
| Metric | Type | Description |
800800
|--------|------|-------------|
801-
| <span class="metrics-name">snaprd_&#8203;state</span> | gauge | State of the tile. 0 = waiting for at least one peer from gossip, 1 = collecting peers from gossip, 2 = pinging peers, 3 = collecting ping responses, 4 = reading full snapshot file, 5 = reading incremental snapshot file, 6 = downloading full snapshot file, 7 = downloading incremental snapshot file, 8 = pinging peers before loading the incremental snapshot, 0 = collecting ping responses before loading the incremental snapshot, 10 = waiting for full snapshot to finish loading, 11 = waiting for incremental snapshot to finish loading, 12 = done |
801+
| <span class="metrics-name">snaprd_&#8203;state</span> | gauge | State of the tile. 0 = waiting for at least one peer from gossip, 1 = collecting peers from gossip, 2 = pinging peers, 3 = collecting ping responses, 4 = reading full snapshot file, 5 = reading incremental snapshot file, 6 = downloading full snapshot file, 7 = downloading incremental snapshot file, 8 = pinging peers before loading the incremental snapshot, 0 = collecting ping responses before loading the incremental snapshot, 10 = waiting for full snapshot to finish loading, 11 = waiting for incremental snapshot to finish loading, 12 = done. |
802802
| <span class="metrics-name">snaprd_&#8203;full_&#8203;num_&#8203;retries</span> | counter | Number of times we aborted and retried full snapshot download because the peer was too slow |
803803
| <span class="metrics-name">snaprd_&#8203;incremental_&#8203;num_&#8203;retries</span> | counter | Number of times we aborted and retried incremental snapshot download because the peer was too slow |
804804
| <span class="metrics-name">snaprd_&#8203;full_&#8203;bytes_&#8203;read</span> | gauge | Number of bytes read so far from the full snapshot. Might decrease if snapshot load is aborted and restarted |
@@ -816,7 +816,7 @@
816816

817817
| Metric | Type | Description |
818818
|--------|------|-------------|
819-
| <span class="metrics-name">snapdc_&#8203;state</span> | gauge | State of the tile. 0 = waiting for compressed byte stream, 1 = decompressing full snapshot, 2 = decompressing incremental snapshot, 3 = Done |
819+
| <span class="metrics-name">snapdc_&#8203;state</span> | gauge | State of the tile. 0 = waiting for compressed byte stream, 1 = decompressing full snapshot, 2 = decompressing incremental snapshot, 3 = done. |
820820
| <span class="metrics-name">snapdc_&#8203;full_&#8203;compressed_&#8203;bytes_&#8203;read</span> | gauge | Number of bytes read so far from the compressed full snapshot file. Might decrease if snapshot load is aborted and restarted |
821821
| <span class="metrics-name">snapdc_&#8203;full_&#8203;decompressed_&#8203;bytes_&#8203;read</span> | gauge | Number of bytes read so far from the decompressed file. Might decrease if snapshot load is aborted and restarted |
822822
| <span class="metrics-name">snapdc_&#8203;full_&#8203;decompressed_&#8203;bytes_&#8203;total</span> | gauge | Total size of the decompressed full snapshot file. Might change if snapshot load is aborted and restarted |
@@ -832,7 +832,7 @@
832832

833833
| Metric | Type | Description |
834834
|--------|------|-------------|
835-
| <span class="metrics-name">snapin_&#8203;state</span> | gauge | State of the tile. 0 = waiting for decompressed snapshot bytestream, 1 = processing full snapshot, 2 = processing incremental snapshot, 3 = Done |
835+
| <span class="metrics-name">snapin_&#8203;state</span> | gauge | State of the tile. 0 = waiting for decompressed snapshot bytestream, 1 = processing full snapshot, 2 = processing incremental snapshot, 3 = done. |
836836
| <span class="metrics-name">snapin_&#8203;full_&#8203;accounts_&#8203;files_&#8203;processed</span> | gauge | Number of accounts files (appendvecs) processed in the full snapshot. Might decrease if snapshot load is aborted and restarted |
837837
| <span class="metrics-name">snapin_&#8203;full_&#8203;accounts_&#8203;files_&#8203;total</span> | gauge | Total number of accounts files in the full snapshot. Might change if snapshot load is aborted and restarted |
838838
| <span class="metrics-name">snapin_&#8203;incremental_&#8203;accounts_&#8203;files_&#8203;processed</span> | gauge | Number of accounts files (appendvecs) processed in the incremental snapshot. Might decrease if snapshot load is aborted and restarted |

src/disco/metrics/generated/fd_metrics_quic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@
253253
#define FD_METRICS_HISTOGRAM_QUIC_RECEIVE_DURATION_SECONDS_OFF (95UL)
254254
#define FD_METRICS_HISTOGRAM_QUIC_RECEIVE_DURATION_SECONDS_NAME "quic_receive_duration_seconds"
255255
#define FD_METRICS_HISTOGRAM_QUIC_RECEIVE_DURATION_SECONDS_TYPE (FD_METRICS_TYPE_HISTOGRAM)
256-
#define FD_METRICS_HISTOGRAM_QUIC_RECEIVE_DURATION_SECONDS_DESC "Duration spent receiving packets"
256+
#define FD_METRICS_HISTOGRAM_QUIC_RECEIVE_DURATION_SECONDS_DESC "Duration spent processing packets"
257257
#define FD_METRICS_HISTOGRAM_QUIC_RECEIVE_DURATION_SECONDS_CVT (FD_METRICS_CONVERTER_SECONDS)
258258
#define FD_METRICS_HISTOGRAM_QUIC_RECEIVE_DURATION_SECONDS_MIN (1e-08)
259259
#define FD_METRICS_HISTOGRAM_QUIC_RECEIVE_DURATION_SECONDS_MAX (0.1)

src/disco/metrics/generated/fd_metrics_send.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@
296296
#define FD_METRICS_HISTOGRAM_SEND_RECEIVE_DURATION_SECONDS_OFF (109UL)
297297
#define FD_METRICS_HISTOGRAM_SEND_RECEIVE_DURATION_SECONDS_NAME "send_receive_duration_seconds"
298298
#define FD_METRICS_HISTOGRAM_SEND_RECEIVE_DURATION_SECONDS_TYPE (FD_METRICS_TYPE_HISTOGRAM)
299-
#define FD_METRICS_HISTOGRAM_SEND_RECEIVE_DURATION_SECONDS_DESC "Duration spent receiving packets"
299+
#define FD_METRICS_HISTOGRAM_SEND_RECEIVE_DURATION_SECONDS_DESC "Duration spent processing packets"
300300
#define FD_METRICS_HISTOGRAM_SEND_RECEIVE_DURATION_SECONDS_CVT (FD_METRICS_CONVERTER_SECONDS)
301301
#define FD_METRICS_HISTOGRAM_SEND_RECEIVE_DURATION_SECONDS_MIN (1e-08)
302302
#define FD_METRICS_HISTOGRAM_SEND_RECEIVE_DURATION_SECONDS_MAX (0.1)

src/disco/metrics/generated/fd_metrics_snapdc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#define FD_METRICS_GAUGE_SNAPDC_STATE_OFF (16UL)
77
#define FD_METRICS_GAUGE_SNAPDC_STATE_NAME "snapdc_state"
88
#define FD_METRICS_GAUGE_SNAPDC_STATE_TYPE (FD_METRICS_TYPE_GAUGE)
9-
#define FD_METRICS_GAUGE_SNAPDC_STATE_DESC "State of the tile. 0 = waiting for compressed byte stream, 1 = decompressing full snapshot, 2 = decompressing incremental snapshot, 3 = Done"
9+
#define FD_METRICS_GAUGE_SNAPDC_STATE_DESC "State of the tile. 0 = waiting for compressed byte stream, 1 = decompressing full snapshot, 2 = decompressing incremental snapshot, 3 = done."
1010
#define FD_METRICS_GAUGE_SNAPDC_STATE_CVT (FD_METRICS_CONVERTER_NONE)
1111

1212
#define FD_METRICS_GAUGE_SNAPDC_FULL_COMPRESSED_BYTES_READ_OFF (17UL)

src/disco/metrics/generated/fd_metrics_snapin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#define FD_METRICS_GAUGE_SNAPIN_STATE_OFF (16UL)
77
#define FD_METRICS_GAUGE_SNAPIN_STATE_NAME "snapin_state"
88
#define FD_METRICS_GAUGE_SNAPIN_STATE_TYPE (FD_METRICS_TYPE_GAUGE)
9-
#define FD_METRICS_GAUGE_SNAPIN_STATE_DESC "State of the tile. 0 = waiting for decompressed snapshot bytestream, 1 = processing full snapshot, 2 = processing incremental snapshot, 3 = Done"
9+
#define FD_METRICS_GAUGE_SNAPIN_STATE_DESC "State of the tile. 0 = waiting for decompressed snapshot bytestream, 1 = processing full snapshot, 2 = processing incremental snapshot, 3 = done."
1010
#define FD_METRICS_GAUGE_SNAPIN_STATE_CVT (FD_METRICS_CONVERTER_NONE)
1111

1212
#define FD_METRICS_GAUGE_SNAPIN_FULL_ACCOUNTS_FILES_PROCESSED_OFF (17UL)

src/disco/metrics/generated/fd_metrics_snaprd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#define FD_METRICS_GAUGE_SNAPRD_STATE_OFF (16UL)
77
#define FD_METRICS_GAUGE_SNAPRD_STATE_NAME "snaprd_state"
88
#define FD_METRICS_GAUGE_SNAPRD_STATE_TYPE (FD_METRICS_TYPE_GAUGE)
9-
#define FD_METRICS_GAUGE_SNAPRD_STATE_DESC "State of the tile. 0 = waiting for at least one peer from gossip, 1 = collecting peers from gossip, 2 = pinging peers, 3 = collecting ping responses, 4 = reading full snapshot file, 5 = reading incremental snapshot file, 6 = downloading full snapshot file, 7 = downloading incremental snapshot file, 8 = pinging peers before loading the incremental snapshot, 0 = collecting ping responses before loading the incremental snapshot, 10 = waiting for full snapshot to finish loading, 11 = waiting for incremental snapshot to finish loading, 12 = done"
9+
#define FD_METRICS_GAUGE_SNAPRD_STATE_DESC "State of the tile. 0 = waiting for at least one peer from gossip, 1 = collecting peers from gossip, 2 = pinging peers, 3 = collecting ping responses, 4 = reading full snapshot file, 5 = reading incremental snapshot file, 6 = downloading full snapshot file, 7 = downloading incremental snapshot file, 8 = pinging peers before loading the incremental snapshot, 0 = collecting ping responses before loading the incremental snapshot, 10 = waiting for full snapshot to finish loading, 11 = waiting for incremental snapshot to finish loading, 12 = done."
1010
#define FD_METRICS_GAUGE_SNAPRD_STATE_CVT (FD_METRICS_CONVERTER_NONE)
1111

1212
#define FD_METRICS_COUNTER_SNAPRD_FULL_NUM_RETRIES_OFF (17UL)

src/disco/metrics/metrics.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ metric introduced.
209209
<summary>Duration spent in service</summary>
210210
</histogram>
211211
<histogram name="ReceiveDurationSeconds" min="0.00000001" max="0.1" converter="seconds">
212-
<summary>Duration spent receiving packets</summary>
212+
<summary>Duration spent processing packets</summary>
213213
</histogram>
214214

215215
<counter name="FrameFailParse" summary="Number of QUIC frames failed to parse." />
@@ -300,7 +300,7 @@ metric introduced.
300300
<summary>Duration spent in service</summary>
301301
</histogram>
302302
<histogram name="ReceiveDurationSeconds" min="0.00000001" max="0.1" converter="seconds">
303-
<summary>Duration spent receiving packets</summary>
303+
<summary>Duration spent processing packets</summary>
304304
</histogram>
305305
</tile>
306306

src/disco/quic/fd_quic_tile.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,7 @@ after_frag( fd_quic_ctx_t * ctx,
223223
ulong ip_sz = sz - sizeof(fd_eth_hdr_t);
224224

225225
fd_quic_t * quic = ctx->quic;
226-
long dt = -fd_tickcount();
227226
fd_quic_process_packet( quic, ip_pkt, ip_sz );
228-
dt += fd_tickcount();
229-
fd_histf_sample( quic->metrics.receive_duration, (ulong)dt );
230-
quic->metrics.net_rx_byte_cnt += sz;
231-
quic->metrics.net_rx_pkt_cnt++;
232227
} else if( FD_LIKELY( proto==DST_PROTO_TPU_UDP ) ) {
233228
ulong network_hdr_sz = fd_disco_netmux_sig_hdr_sz( sig );
234229
if( FD_UNLIKELY( sz<=network_hdr_sz ) ) {
@@ -557,6 +552,7 @@ unprivileged_init( fd_topo_t * topo,
557552
if( FD_UNLIKELY( scratch_top > (ulong)scratch + scratch_footprint( tile ) ) )
558553
FD_LOG_ERR(( "scratch overflow %lu %lu %lu", scratch_top - (ulong)scratch - scratch_footprint( tile ), scratch_top, (ulong)scratch + scratch_footprint( tile ) ));
559554

555+
/* Call new/join here rather than in fd_quic so min/max can differ across uses */
560556
fd_histf_join( fd_histf_new( ctx->quic->metrics.service_duration, FD_MHIST_SECONDS_MIN( QUIC, SERVICE_DURATION_SECONDS ),
561557
FD_MHIST_SECONDS_MAX( QUIC, SERVICE_DURATION_SECONDS ) ) );
562558
fd_histf_join( fd_histf_new( ctx->quic->metrics.receive_duration, FD_MHIST_SECONDS_MIN( QUIC, RECEIVE_DURATION_SECONDS ),

src/disco/quic/test_quic_metrics.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ quic_service_duration_seconds_bucket{kind="quic",kind_id="0",le="+Inf"} 1368
180180
quic_service_duration_seconds_sum{kind="quic",kind_id="0"} 9.3999999999999995e-08
181181
quic_service_duration_seconds_count{kind="quic",kind_id="0"} 1368
182182

183-
# HELP quic_receive_duration_seconds Duration spent receiving packets
183+
# HELP quic_receive_duration_seconds Duration spent processing packets
184184
# TYPE quic_receive_duration_seconds histogram
185185
quic_receive_duration_seconds_bucket{kind="quic",kind_id="0",le="8.9999999999999995e-09"} 95
186186
quic_receive_duration_seconds_bucket{kind="quic",kind_id="0",le="3.1e-08"} 191

src/discof/send/fd_send_tile.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,10 +383,7 @@ after_frag( fd_send_tile_ctx_t * ctx,
383383
ulong ip_sz = sz - sizeof(fd_eth_hdr_t);
384384
fd_quic_t * quic = ctx->quic;
385385

386-
long dt = -fd_tickcount();
387386
fd_quic_process_packet( quic, ip_pkt, ip_sz );
388-
dt += fd_tickcount();
389-
fd_histf_sample( quic->metrics.receive_duration, (ulong)dt );
390387
}
391388

392389
if( FD_UNLIKELY( kind==IN_KIND_TOWER ) ) {
@@ -530,10 +527,11 @@ unprivileged_init( fd_topo_t * topo,
530527
fd_quic_set_clock_tickcount( quic );
531528
FD_TEST_CUSTOM( fd_quic_init( quic ), "fd_quic_init failed" );
532529

530+
/* Call new/join here rather than in fd_quic so min/max can differ across uses */
533531
fd_histf_join( fd_histf_new( quic->metrics.service_duration, FD_MHIST_SECONDS_MIN( SEND, SERVICE_DURATION_SECONDS ),
534-
FD_MHIST_SECONDS_MAX( SEND, SERVICE_DURATION_SECONDS ) ) );
532+
FD_MHIST_SECONDS_MAX( SEND, SERVICE_DURATION_SECONDS ) ) );
535533
fd_histf_join( fd_histf_new( quic->metrics.receive_duration, FD_MHIST_SECONDS_MIN( SEND, RECEIVE_DURATION_SECONDS ),
536-
FD_MHIST_SECONDS_MAX( SEND, RECEIVE_DURATION_SECONDS ) ) );
534+
FD_MHIST_SECONDS_MAX( SEND, RECEIVE_DURATION_SECONDS ) ) );
537535

538536
ctx->quic = quic;
539537

0 commit comments

Comments
 (0)