store slot on BlockBatchUpdate (#31190)
This commit is contained in:
parent
93d0d25d77
commit
b657004141
|
@ -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: {}",
|
||||
|
|
|
@ -28,14 +28,14 @@ use {
|
|||
};
|
||||
|
||||
pub enum QosMetrics {
|
||||
BlockBatchUpdate { bank: Arc<Bank> },
|
||||
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<Bank>) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue