ProvableHQ / snarkOS

A Decentralized Operating System for ZK Applications

Home Page:http://snarkos.org

Repository from Github https://github.comProvableHQ/snarkOSRepository from Github https://github.comProvableHQ/snarkOS

[Feature] Update TPS metrics

vicsn opened this issue Β· comments

commented

πŸš€ 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:

  1. track solutions.len() in blocks
  2. track transmissions.len() (transactions.len() + solutions.len()) in blocks
  3. 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";
}
  1. track solutions.len() in consensus in add_unconfirmed_solution
  2. track transmissions.len() in consensus in add_unconfirmed_solution and add_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.

commented

PR has been merged