-
Notifications
You must be signed in to change notification settings - Fork 632
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: Add metric measuring size of transaction pool (#9052)
This will allow us to understand how big the transaction pools get in practice and what is the realistic limit to set for them. The logic within pool iterator is a bit complex due to the need to return transactions back to the pool and I'm working on a way to simplify it in a separate PR, but for now this accounting should do the job. This is one of the steps for #3284
- Loading branch information
Showing
2 changed files
with
24 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
use near_o11y::metrics::IntGauge; | ||
use once_cell::sync::Lazy; | ||
|
||
pub static TRANSACTION_POOL_TOTAL: Lazy<IntGauge> = Lazy::new(|| { | ||
pub static TRANSACTION_POOL_COUNT: Lazy<IntGauge> = Lazy::new(|| { | ||
near_o11y::metrics::try_create_int_gauge( | ||
"near_transaction_pool_entries", | ||
"Total number of transactions currently in the pools tracked by the node", | ||
) | ||
.unwrap() | ||
}); | ||
|
||
pub static TRANSACTION_POOL_SIZE: Lazy<IntGauge> = Lazy::new(|| { | ||
near_o11y::metrics::try_create_int_gauge( | ||
"near_transaction_pool_size", | ||
"Total size in bytes of transactions currently in the pools tracked by the node", | ||
) | ||
.unwrap() | ||
}); |