Skip to content

Commit

Permalink
Track number of consensus transaction calls (MystenLabs#3542)
Browse files Browse the repository at this point in the history
  • Loading branch information
mystenmark authored Jul 27, 2022
1 parent abe57fc commit 261d379
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/sui-core/src/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ pub struct AuthorityMetrics {
num_shared_objects: Histogram,
batch_size: Histogram,

total_consensus_txns: IntCounter,

pub follower_items_streamed: IntCounter,
pub follower_items_loaded: IntCounter,
pub follower_connections: IntCounter,
Expand Down Expand Up @@ -200,6 +202,12 @@ impl AuthorityMetrics {
registry,
)
.unwrap(),
total_consensus_txns: register_int_counter_with_registry!(
"total_consensus_txns",
"Total number of consensus transactions received from narwhal",
registry,
)
.unwrap(),
follower_items_streamed: register_int_counter_with_registry!(
"follower_items_streamed",
"Number of transactions/signed batches streamed to followers",
Expand Down Expand Up @@ -1499,6 +1507,7 @@ impl ExecutionState for AuthorityState {
consensus_index: ExecutionIndices,
transaction: Self::Transaction,
) -> Result<Vec<u8>, Self::Error> {
self.metrics.total_consensus_txns.inc();
match transaction {
ConsensusTransaction::UserTransaction(certificate) => {
// Ensure the input is a shared object certificate. Remember that Byzantine authorities
Expand Down

0 comments on commit 261d379

Please sign in to comment.