From b6570041416dbb2edf783c2a871c94e36d4529e7 Mon Sep 17 00:00:00 2001 From: Andrew Fitzgerald Date: Fri, 14 Apr 2023 13:15:31 -0700 Subject: [PATCH] store slot on BlockBatchUpdate (#31190) --- core/src/banking_stage/consumer.rs | 2 +- core/src/qos_service.rs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/src/banking_stage/consumer.rs b/core/src/banking_stage/consumer.rs index ee53170881..0d4c1490c6 100644 --- a/core/src/banking_stage/consumer.rs +++ b/core/src/banking_stage/consumer.rs @@ -441,7 +441,7 @@ impl Consumer { self.qos_service.accumulate_actual_execute_time(us); // reports qos service stats for this batch - self.qos_service.report_metrics(bank.clone()); + self.qos_service.report_metrics(bank.slot()); debug!( "bank: {} lock: {}us unlock: {}us txs_len: {}", diff --git a/core/src/qos_service.rs b/core/src/qos_service.rs index 81efa7df1e..4345e7efe6 100644 --- a/core/src/qos_service.rs +++ b/core/src/qos_service.rs @@ -28,14 +28,14 @@ use { }; pub enum QosMetrics { - BlockBatchUpdate { bank: Arc }, + BlockBatchUpdate { slot: Slot }, } // QosService is local to each banking thread, each instance of QosService provides services to // one banking thread. -// It hosts a private thread for async metrics reporting, tagged with banking thredas ID. Banking -// threda calls `report_metrics(&bank)` at end of `process_and_record_tramsaction()`, or any time -// it wants, QosService sends `&bank` to reporting thread via channel, signalling stats to be +// It hosts a private thread for async metrics reporting, tagged with banking threads ID. Banking +// thread calls `report_metrics(slot)` at end of `process_and_record_tramsaction()`, or any time +// it wants, QosService sends `slot` to reporting thread via channel, signalling stats to be // reported if new bank slot has changed. // pub struct QosService { @@ -244,9 +244,9 @@ impl QosService { } // metrics are reported by bank slot - pub fn report_metrics(&self, bank: Arc) { + pub fn report_metrics(&self, slot: Slot) { self.report_sender - .send(QosMetrics::BlockBatchUpdate { bank }) + .send(QosMetrics::BlockBatchUpdate { slot }) .unwrap_or_else(|err| warn!("qos service report metrics failed: {:?}", err)); } @@ -427,8 +427,8 @@ impl QosService { while running_flag.load(Ordering::Relaxed) { for qos_metrics in report_receiver.try_iter() { match qos_metrics { - QosMetrics::BlockBatchUpdate { bank } => { - metrics.report(bank.slot()); + QosMetrics::BlockBatchUpdate { slot: bank_slot } => { + metrics.report(bank_slot); } } }