[Feature] Update TPS metrics
vicsn opened this issue Β· comments
π Feature
Currently we are only tracking TPS via transactions.len() included in blocks. Additionally, it would be great if we can add five new metrics:
- track solutions.len() in blocks
- track transmissions.len() (transactions.len() + solutions.len()) in blocks
- track transactions.len() in consensus in
add_unconfirmed_transaction
, e.g.:
pub async fn add_unconfirmed_transaction(&self, transaction: Transaction<N>) -> Result<()> {
#[cfg(feature = "metrics")]
{
metrics::increment_gauge(metrics::consensus::TRANSACTIONS, 1 as f64);
}
...
}
and:
pub mod consensus {
...
pub const TRANSACTIONS: &str = "snarkos_consensus_transactions_total";
}
- track solutions.len() in consensus in
add_unconfirmed_solution
- track transmissions.len() in consensus in
add_unconfirmed_solution
andadd_unconfirmed_transaction
Motivation
The added metrics will help us track how many transactions/solutions are hitting snarkOS, and how many actually land into blocks. The transmissions metric is somewhat duplicate logic, but makes things easier for end users.
PR has been merged