Skip to content

Commit

Permalink
[narwhal fix subscriber metrics (MystenLabs#8061)
Browse files Browse the repository at this point in the history
Certificate specific metrics were placed into the loop that is
processing the certificate's batches. However, this doesn't allow us to
get signal when the certificate referencing no batches giving us wrong
impression in diagnostics.
  • Loading branch information
akichidis authored Feb 7, 2023
1 parent 617f120 commit fcc73e5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions narwhal/executor/src/subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,17 @@ impl<Network: SubscriberNetwork> Fetcher<Network> {
for cert in &sub_dag.certificates {
let mut batches = Vec::with_capacity(num_batches);
let output_cert = cert.clone();

self.metrics
.subscriber_current_round
.set(cert.round() as i64);

self.metrics
.subscriber_certificate_latency
.observe(cert.metadata.created_at.elapsed().as_secs_f64());

for (digest, (worker_id, _)) in cert.header.payload.iter() {
self.metrics
.subscriber_current_round
.set(cert.round() as i64);
self.metrics.subscriber_processed_batches.inc();
self.metrics
.subscriber_certificate_latency
.observe(cert.metadata.created_at.elapsed().as_secs_f64());

let mut workers = self.network.workers_for_certificate(cert, worker_id);

Expand Down

0 comments on commit fcc73e5

Please sign in to comment.