mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 18:11:10 +00:00
Add prometheus registry to transaction pool, with couple of initial metrics (#5657)
* make new contructor * add metrics to txpool * fix review * fix doc comment * change to counters * Update client/transaction-pool/src/metrics.rs Co-Authored-By: Max Inden <mail@max-inden.de> * Update client/transaction-pool/src/metrics.rs Co-Authored-By: Max Inden <mail@max-inden.de> * Update client/transaction-pool/src/metrics.rs Co-Authored-By: Max Inden <mail@max-inden.de> * Update client/transaction-pool/src/lib.rs Co-Authored-By: Max Inden <mail@max-inden.de> * Update client/transaction-pool/src/lib.rs Co-Authored-By: Max Inden <mail@max-inden.de> * use dedicated wrapper Co-authored-by: Max Inden <mail@max-inden.de>
This commit is contained in:
@@ -53,6 +53,7 @@ use wasm_timer::SystemTime;
|
||||
use sc_telemetry::{telemetry, SUBSTRATE_INFO};
|
||||
use sp_transaction_pool::{MaintainedTransactionPool, ChainEvent};
|
||||
use sp_blockchain;
|
||||
use prometheus_endpoint::Registry as PrometheusRegistry;
|
||||
|
||||
pub type BackgroundTask = Pin<Box<dyn Future<Output=()> + Send>>;
|
||||
|
||||
@@ -585,6 +586,7 @@ impl<TBl, TRtApi, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend>
|
||||
sc_transaction_pool::txpool::Options,
|
||||
Arc<TCl>,
|
||||
Option<TFchr>,
|
||||
Option<&PrometheusRegistry>,
|
||||
) -> Result<(UExPool, Option<BackgroundTask>), Error>
|
||||
) -> Result<ServiceBuilder<TBl, TRtApi, TCl, TFchr, TSc, TImpQu, TFprb, TFpp,
|
||||
UExPool, TRpc, Backend>, Error>
|
||||
@@ -593,6 +595,7 @@ impl<TBl, TRtApi, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend>
|
||||
self.config.transaction_pool.clone(),
|
||||
self.client.clone(),
|
||||
self.fetcher.clone(),
|
||||
self.config.prometheus_config.as_ref().map(|config| &config.registry),
|
||||
)?;
|
||||
|
||||
if let Some(background_task) = background_task{
|
||||
|
||||
@@ -696,6 +696,7 @@ mod tests {
|
||||
let pool = Arc::new(BasicPool::new(
|
||||
Default::default(),
|
||||
Arc::new(FullChainApi::new(client.clone())),
|
||||
None,
|
||||
).0);
|
||||
let source = sp_runtime::transaction_validity::TransactionSource::External;
|
||||
let best = longest_chain.best_chain().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user