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 7, 2024
1 parent 680eaca commit 355d262
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/new_index/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,19 @@ impl Mempool {
indexed_txids.len() + fetched_txs.len(),
new_txids.len()
);

mempool.write().unwrap().count
.with_label_values(&["all_txs"])
.set(all_txids.len() as f64);

mempool.write().unwrap().count
.with_label_values(&["fetched_txs"])
.set((indexed_txids.len() + fetched_txs.len()) as f64);

mempool.write().unwrap().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

0 comments on commit 355d262

Please sign in to comment.