Skip to content

Commit

Permalink
restored metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
pompon0 committed Nov 16, 2023
1 parent e3bb595 commit ba3bbda
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 17 deletions.
2 changes: 2 additions & 0 deletions node/actors/bft/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ pub(crate) struct ConsensusMetrics {
/// Latency of processing messages by the leader.
#[metrics(buckets = Buckets::LATENCIES, unit = Unit::Seconds)]
pub(crate) leader_processing_latency: Family<ProcessingLatencyLabels, Histogram<Duration>>,
/// Number of the last finalized block observed by the node.
pub(crate) finalized_block_number: Gauge<u64>,
}

/// Global instance of [`ConsensusMetrics`].
Expand Down
7 changes: 6 additions & 1 deletion node/actors/bft/src/replica/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ impl StateMachine {
self.storage
.put_block(ctx, &block)
.await
.context("store.put_block()")
.context("store.put_block()")?;

let number_metric = &crate::metrics::METRICS.finalized_block_number;
let current_number = number_metric.get();
number_metric.set(current_number.max(block.header.number.0));
Ok(())
}
}
1 change: 0 additions & 1 deletion node/actors/executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use zksync_consensus_utils::pipe;

mod config;
mod io;
mod metrics;
pub mod testonly;
#[cfg(test)]
mod tests;
Expand Down
15 changes: 0 additions & 15 deletions node/actors/executor/src/metrics.rs

This file was deleted.

0 comments on commit ba3bbda

Please sign in to comment.