-
Notifications
You must be signed in to change notification settings - Fork 331
metrics, bank, pack, quic: use MACRO_CNT in def #6543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
metrics, bank, pack, quic: use MACRO_CNT in def #6543
Conversation
Use the MACRO_CNT variables in the definition of the metrics arrays. This is to provide drift in the future which could result in over/ under reads/writes.
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 ]; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
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 */ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
Use the MACRO_CNT variables in the definition of the metrics arrays.
This is to avoid drift in the future which could result in over/ under reads/writes.
(Apologies for all the review requests...)