-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Txpool metrics update #2385
Txpool metrics update #2385
Conversation
…ctions_time_nanoseconds`
…time` use microseconds
…action_insertion_time_in_thread_pool_microseconds` metrics
CHANGELOG.md
Outdated
@@ -6,18 +6,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/). | |||
|
|||
## [Unreleased] | |||
|
|||
### Added | |||
- [2321](https://github.com/FuelLabs/fuel-core/pull/2321): New metrics for the txpool: |
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.
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 think it should. I wanted to keep the "one PR per line" rule, so this is how I have changed it:
dadaaa6
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.
LGTM
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.
LGTM
if metrics { | ||
record_tx_size(&checked_tx) | ||
let size = checked_tx.metered_bytes_size(); | ||
txpool_metrics().tx_size.observe(size as f64); | ||
}; |
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.
Do we want to record the size of inserted transaction or size of all transactions that entered the pool? If the first one, then maybe it makes sense to move this metric into TxPool::insert
function. If the second, then we need to do it along with .number_of_transactions_pending_verification.inc()
.
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.
As discussed, we're interested in logging transactions that has been inserted into the TxPool, meaning: every transaction that passed all validations and is actually being inserted.
Other cases (i.e. log rejected transactions) are still to be handled, as per the original issue: #1937 - this will be delivered as a separate 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.
The tx_size
metric is now recorded the moment it is actually accepted and inserted into the TxPool: fbb0a54
@@ -76,6 +62,44 @@ fn initialize_buckets() -> HashMap<Buckets, Vec<f64>> { | |||
256.0 * 1024.0, | |||
] | |||
), | |||
( | |||
Buckets::TransactionInsertionTimeInThreadPool, |
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.
not for this PR, but I think having the name of the buckets implying their use is not optimal. That said, we discussed this already and IIRC we could not find a good naming convention :)
Linked Issues/PRs
This PR addresses the outstanding comments to the TxPool metrics PR: #2321
Description
There are a couple of changes to how and when metrics are registered and some histogram buckets are redefined.
Additionally there is also a small clean-up of the changelog file.
Before requesting review