-
Notifications
You must be signed in to change notification settings - Fork 852
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
Expose transaction count by type metrics for the layered txpool #6903
Conversation
Signed-off-by: Fabio Di Fabio <[email protected]>
Signed-off-by: Fabio Di Fabio <[email protected]>
389a174
to
6257d7f
Compare
.forEach( | ||
type -> | ||
metrics.initTransactionCountByType( | ||
() -> txCountByType[type.ordinal()], name(), type)); |
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.
using ordinal to track the external feels fragile, but if experimental tx types start showing up they may leave large gaps. However... it's what we express externally, so this looks like it will work. See my other comment on the metric.
"number_of_transactions_by_type", | ||
"The number of transactions, of a specified type, currently present in the layer", | ||
"layer", | ||
"type"); |
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.
In addition to the type name, should we expose the EIP-2718 type number? We shouldn't use ordinal and should encode it in TransactionType but that has some weirdness for frontier types. May be best for a future PR.
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.
yes I think it makes sense to explicitly add the EIP-2718 type number to the tx type, and expose it in the metric label.
About the use of type.ordinal()
, it is only used internally to index the array of int for the counters, and not exposed outside.
…rledger#6903) Signed-off-by: Fabio Di Fabio <[email protected]> Signed-off-by: amsmota <[email protected]>
…rledger#6903) Signed-off-by: Fabio Di Fabio <[email protected]> Signed-off-by: amsmota <[email protected]>
…rledger#6903) Signed-off-by: Fabio Di Fabio <[email protected]>
…rledger#6903) Signed-off-by: Fabio Di Fabio <[email protected]>
PR description
Expose transaction count by type metrics for each layer of the layered txpool
The new metric name is
besu_transaction_pool_number_of_transactions_by_type
and haslayer
andtype
as labels.Example panel
Besu Full Grafana dashboard will be updated to render this metrics once the PR will be merged.
Fixed Issue(s)
Thanks for sending a pull request! Have you done the following?
doc-change-required
label to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew build
./gradlew acceptanceTest
./gradlew integrationTest
./gradlew ethereum:referenceTests:referenceTests