use once_cell::sync::Lazy;
use tari_metrics::{IntCounter, IntGauge};
pub fn inbound_transactions() -> IntCounter {
static METER: Lazy<IntCounter> = Lazy::new(|| {
tari_metrics::register_int_counter(
"base_node::mempool::inbound_transactions",
"Number of valid inbound transactions in the mempool",
)
.unwrap()
});
METER.clone()
}
pub fn rejected_inbound_transactions() -> IntCounter {
static METER: Lazy<IntCounter> = Lazy::new(|| {
tari_metrics::register_int_counter(
"base_node::mempool::rejected_inbound_transactions",
"Number of valid inbound transactions in the mempool",
)
.unwrap()
});
METER.clone()
}
pub fn unconfirmed_pool_size() -> IntGauge {
static METER: Lazy<IntGauge> = Lazy::new(|| {
tari_metrics::register_int_gauge(
"base_node::mempool::unconfirmed",
"Number of unconfirmed transactions in the mempool",
)
.unwrap()
});
METER.clone()
}
pub fn reorg_pool_size() -> IntGauge {
static METER: Lazy<IntGauge> = Lazy::new(|| {
tari_metrics::register_int_gauge(
"base_node::mempool::reorg",
"Number of published transactions in the reorg mempool",
)
.unwrap()
});
METER.clone()
}
pub fn reorg_invalid_transactions() -> IntGauge {
static METER: Lazy<IntGauge> = Lazy::new(|| {
tari_metrics::register_int_gauge(
"base_node::mempool::reorg_invalid_transactions",
"Number of transactions invalidated in the mempool due to a chain reorg",
)
.unwrap()
});
METER.clone()
}