Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/disco/pack/fd_pack_tile.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ typedef struct {
struct {
uint metric_state;
long metric_state_begin;
long metric_timing[ 16 ];
long metric_timing[ FD_METRICS_ENUM_PACK_TIMING_STATE_CNT ];
};

struct {
Expand Down Expand Up @@ -298,7 +298,7 @@ typedef struct {
fd_keyswitch_t * keyswitch;
fd_keyguard_client_t keyguard_client[1];

ulong metrics[4];
ulong metrics[FD_METRICS_ENUM_BUNDLE_CRANK_RESULT_CNT];
} crank[1];


Expand Down
4 changes: 2 additions & 2 deletions src/discoh/bank/fd_bank_tile.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ typedef struct {
fd_pack_rebate_sum_t rebater[ 1 ];

struct {
ulong txn_load_address_lookup_tables[ 6 ];
ulong transaction_result[ 41 ];
ulong txn_load_address_lookup_tables[ FD_METRICS_COUNTER_BANK_TRANSACTION_LOAD_ADDRESS_TABLES_CNT ];
ulong transaction_result[ FD_METRICS_COUNTER_BANK_TRANSACTION_RESULT_CNT ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is actually TRANSACTION_ERROR_CNT I believe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both FD_METRICS_COUNTER_BANK_TRANSACTION_RESULT_CNT and FD_METRICS_ENUM_TRANSACTION_ERROR_CNT map to the correct value, 41.

transaction_result is used in FD_MCNT_ENUM_COPY( BANK, TRANSACTION_RESULT, ctx->metrics.transaction_result ); so FD_METRICS_COUNTER_BANK_TRANSACTION_RESULT_CNT definitely aligns with that.

I do agree that it's confusing to have ..._RESULT as well as ..._ERROR, but that's how it's defined in metrics.xml.

I don't think it would make sense to change the enum name to TransactionResult as that would deviate from agave and clash with TransactionError from bankf tile.

Should I instead rename the field to transaction_err and the counter name in metrics.xml to TransactionError?

ulong processing_failed;
ulong fee_only;
ulong exec_failed;
Expand Down
3 changes: 3 additions & 0 deletions src/waltz/quic/crypto/fd_quic_crypto_suites.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "../fd_quic_enum.h"
#include "../../../ballet/aes/fd_aes_gcm.h"
#include "../../../disco/metrics/generated/fd_metrics_quic.h"

/* Defines the crypto suites used by QUIC v1.

Expand Down Expand Up @@ -49,6 +50,8 @@ struct fd_quic_crypto_keys {
#define fd_quic_enc_level_appdata_id 3
#define FD_QUIC_NUM_ENC_LEVELS 4

FD_STATIC_ASSERT( FD_METRICS_ENUM_QUIC_ENC_LEVEL_CNT==FD_QUIC_NUM_ENC_LEVELS, "quic_num_enc_level_cnt_mismatch" );

/* labels defined in rfc9001 */
#define FD_QUIC_CRYPTO_LABEL_CLIENT_IN "client in"
#define FD_QUIC_CRYPTO_LABEL_SERVER_IN "server in"
Expand Down
47 changes: 24 additions & 23 deletions src/waltz/quic/fd_quic.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@

#include "fd_quic_common.h"
#include "fd_quic_enum.h"
#include "../../disco/metrics/generated/fd_metrics_quic.h"

#include "../aio/fd_aio.h"
#include "../tls/fd_tls.h"
Expand Down Expand Up @@ -313,32 +314,32 @@ union fd_quic_metrics {
ulong retry_tx_cnt; /* number of Retry packets sent */

/* Conn metrics */
ulong conn_alloc_cnt; /* number of conns currently allocated */
ulong conn_created_cnt; /* number of conns created */
ulong conn_closed_cnt; /* number of conns gracefully closed */
ulong conn_aborted_cnt; /* number of conns aborted */
ulong conn_timeout_cnt; /* number of conns timed out */
ulong conn_retry_cnt; /* number of conns established with retry */
ulong conn_err_no_slots_cnt; /* number of conns that failed to create due to lack of slots */
ulong conn_err_retry_fail_cnt; /* number of conns that failed during retry (e.g. invalid token) */
ulong conn_state_cnt[ 8 ]; /* current number of conns in each state */
ulong conn_alloc_cnt; /* number of conns currently allocated */
ulong conn_created_cnt; /* number of conns created */
ulong conn_closed_cnt; /* number of conns gracefully closed */
ulong conn_aborted_cnt; /* number of conns aborted */
ulong conn_timeout_cnt; /* number of conns timed out */
ulong conn_retry_cnt; /* number of conns established with retry */
ulong conn_err_no_slots_cnt; /* number of conns that failed to create due to lack of slots */
ulong conn_err_retry_fail_cnt; /* number of conns that failed during retry (e.g. invalid token) */
ulong conn_state_cnt[ FD_METRICS_ENUM_QUIC_CONN_STATE_CNT ]; /* current number of conns in each state */

/* Packet metrics */
ulong pkt_net_hdr_err_cnt; /* number of packets dropped due to weird IPv4/UDP headers */
ulong pkt_quic_hdr_err_cnt; /* number of packets dropped due to weird QUIC header */
ulong pkt_undersz_cnt; /* number of QUIC packets dropped due to being too small */
ulong pkt_oversz_cnt; /* number of QUIC packets dropped due to being too large */
ulong pkt_decrypt_fail_cnt[4]; /* number of packets that failed decryption due to auth tag */
ulong pkt_no_key_cnt[4]; /* number of packets that failed decryption due to missing key */
ulong pkt_no_conn_cnt[4]; /* number of packets with unknown conn ID (initial, retry, hs, 1-RTT) */
ulong frame_tx_alloc_cnt[3]; /* number of pkt_meta alloc successes, fails for empty pool, fails at conn max */
ulong pkt_verneg_cnt; /* number of QUIC version negotiation packets or packets with wrong version */
ulong pkt_retransmissions_cnt; /* number of pkt_meta retries */
ulong initial_token_len_cnt[3]; /* number of Initial packets grouped by token length */
ulong pkt_net_hdr_err_cnt; /* number of packets dropped due to weird IPv4/UDP headers */
ulong pkt_quic_hdr_err_cnt; /* number of packets dropped due to weird QUIC header */
ulong pkt_undersz_cnt; /* number of QUIC packets dropped due to being too small */
ulong pkt_oversz_cnt; /* number of QUIC packets dropped due to being too large */
ulong pkt_decrypt_fail_cnt[ FD_METRICS_ENUM_QUIC_ENC_LEVEL_CNT ]; /* number of packets that failed decryption due to auth tag */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Number of encryption levels shouldn't come from metrics. Use FD_QUIC_NUM_ENC_LEVELS

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should ASSERT somewhere that they are equal

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually - FD_METRICS_ENUM_QUIC_ENC_LEVEL_CNT is fine. Ignore me

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i like the idea of adding an ASSERT to check they are equal
would be gr8 to also ASSERT that for FD_METRICS_ENUM_QUIC_CONN_STATE_CNT and FD_QUIC_CONN_STATE_CNT (in fd_quic_conn.h)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

ulong pkt_no_key_cnt[ FD_METRICS_ENUM_QUIC_ENC_LEVEL_CNT ]; /* number of packets that failed decryption due to missing key */
ulong pkt_no_conn_cnt[ FD_METRICS_ENUM_QUIC_PKT_HANDLE_CNT ]; /* number of packets with unknown conn ID (initial, retry, hs, 1-RTT) */
ulong frame_tx_alloc_cnt[ FD_METRICS_ENUM_FRAME_TX_ALLOC_RESULT_CNT ]; /* number of pkt_meta alloc successes, fails for empty pool, fails at conn max */
ulong pkt_verneg_cnt; /* number of QUIC version negotiation packets or packets with wrong version */
ulong pkt_retransmissions_cnt; /* number of pkt_meta retries */
ulong initial_token_len_cnt[FD_METRICS_ENUM_QUIC_INITIAL_TOKEN_LEN_CNT]; /* number of Initial packets grouped by token length */

/* Frame metrics */
ulong frame_rx_cnt[ 22 ]; /* number of frames received (indexed by implementation-defined IDs) */
ulong frame_rx_err_cnt; /* number of frames failed */
ulong frame_rx_cnt[ FD_METRICS_ENUM_QUIC_FRAME_TYPE_CNT ]; /* number of frames received (indexed by implementation-defined IDs) */
ulong frame_rx_err_cnt; /* number of frames failed */

/* Handshake metrics */
ulong hs_created_cnt; /* number of handshake flows created */
Expand All @@ -353,7 +354,7 @@ union fd_quic_metrics {
ulong stream_rx_byte_cnt; /* total stream payload bytes received */

/* ACK metrics */
ulong ack_tx[ 5 ];
ulong ack_tx[ FD_METRICS_ENUM_QUIC_ACK_TX_CNT ];

/* Performance metrics */
fd_histf_t service_duration[ 1 ]; /* time spent in service */
Expand Down
3 changes: 3 additions & 0 deletions src/waltz/quic/fd_quic_ack_tx.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
parameter. */

#include "fd_quic_common.h"
#include "../../disco/metrics/generated/fd_metrics_quic.h"

#define FD_ACK_DEBUG(...)
//#define FD_ACK_DEBUG(...) __VA_ARGS__
Expand Down Expand Up @@ -95,6 +96,8 @@ fd_quic_ack_pkt( fd_quic_ack_gen_t * gen,
#define FD_QUIC_ACK_TX_CANCEL (4)
#define FD_QUIC_ACK_TX_CNT (5)

FD_STATIC_ASSERT( FD_METRICS_ENUM_QUIC_ACK_TX_CNT==FD_QUIC_ACK_TX_CNT, "quic_ack_tx_cnt_mismatch" );

/* fd_quic_ack_queue_ele returns the ack_queue element indexed by a
sequence number. */

Expand Down
4 changes: 3 additions & 1 deletion src/waltz/quic/fd_quic_conn.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
#define FD_QUIC_CONN_STATE_DEAD 7 /* connection about to be freed */
#define FD_QUIC_CONN_STATE_CNT 8

FD_STATIC_ASSERT( FD_QUIC_CONN_STATE_CNT == sizeof(((fd_quic_metrics_t*)0)->conn_state_cnt)/sizeof(((fd_quic_metrics_t*)0)->conn_state_cnt[0]),
FD_STATIC_ASSERT( FD_QUIC_CONN_STATE_CNT == sizeof(((fd_quic_metrics_t*)0)->conn_state_cnt)/sizeof(((fd_quic_metrics_t*)0)->conn_state_cnt[0]),
"metrics conn_state_cnt is the wrong size" );
FD_STATIC_ASSERT( FD_METRICS_ENUM_QUIC_CONN_STATE_CNT == FD_QUIC_CONN_STATE_CNT,
"quic_conn_state_cnt_mismatch" );

#define FD_QUIC_REASON_CODES(X,SEP) \
X(NO_ERROR , 0x00 , "No error" ) SEP \
Expand Down
Loading