From ebc93120877e23cd0c3132d0c907fd5b5bb4c85d Mon Sep 17 00:00:00 2001 From: Philippe McLean Date: Thu, 5 Dec 2024 10:39:47 -0800 Subject: [PATCH] report mempool fetched and missing counts to prometheus --- src/new_index/mempool.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/new_index/mempool.rs b/src/new_index/mempool.rs index 4ccd4cd59..4a243d7b8 100644 --- a/src/new_index/mempool.rs +++ b/src/new_index/mempool.rs @@ -526,6 +526,15 @@ impl Mempool { indexed_txids.len() + fetched_txs.len(), new_txids.len() ); + + { + let mempool = mempool.read().unwrap(); + + mempool.count.with_label_values(&["all_txs"]).set(all_txids.len() as f64); + mempool.count.with_label_values(&["fetched_txs"]).set((indexed_txids.len() + fetched_txs.len()) as f64); + mempool.count.with_label_values(&["missing_txs"]).set(new_txids.len() as f64); + } + let new_txs = daemon.gettransactions_available(&new_txids)?; // Abort if the chain tip moved while fetching transactions