Skip to content

Commit 3fabe0f

Browse files
committed
report mempool fetched and missing counts to prometheus
1 parent 680eaca commit 3fabe0f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/new_index/mempool.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,19 @@ impl Mempool {
526526
indexed_txids.len() + fetched_txs.len(),
527527
new_txids.len()
528528
);
529+
530+
mempool.read().unwrap().count
531+
.with_label_values(&["all_txs"])
532+
.set(all_txids.len() as f64);
533+
534+
mempool.read().unwrap().count
535+
.with_label_values(&["fetched_txs"])
536+
.set((indexed_txids.len() + fetched_txs.len()) as f64);
537+
538+
mempool.read().unwrap().count
539+
.with_label_values(&["missing_txs"])
540+
.set(new_txids.len() as f64);
541+
529542
let new_txs = daemon.gettransactions_available(&new_txids)?;
530543

531544
// Abort if the chain tip moved while fetching transactions

0 commit comments

Comments
 (0)