Skip to content

Commit

Permalink
report mempool fetched and missing counts to prometheus
Browse files Browse the repository at this point in the history
  • Loading branch information
philippem committed Dec 10, 2024
1 parent 680eaca commit f6bbac6
Show file tree
Hide file tree
Showing 2 changed files with 628 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/new_index/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit f6bbac6

Please sign in to comment.