Skip to content

Commit

Permalink
skip reporting all-zero stats (#22054)
Browse files Browse the repository at this point in the history
(cherry picked from commit 9c5d825)

Co-authored-by: Tao Zhu <tao@solana.com>
  • Loading branch information
mergify[bot] and tao-stones authored Dec 28, 2021
1 parent 16f821e commit 810ca36
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions core/src/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,42 @@ impl BankingStageStats {
}
}

fn is_empty(&self) -> bool {
0 == self.process_packets_count.load(Ordering::Relaxed) as u64
+ self.new_tx_count.load(Ordering::Relaxed) as u64
+ self.dropped_packet_batches_count.load(Ordering::Relaxed) as u64
+ self.dropped_packets_count.load(Ordering::Relaxed) as u64
+ self
.dropped_duplicated_packets_count
.load(Ordering::Relaxed) as u64
+ self.newly_buffered_packets_count.load(Ordering::Relaxed) as u64
+ self.current_buffered_packets_count.load(Ordering::Relaxed) as u64
+ self
.current_buffered_packet_batches_count
.load(Ordering::Relaxed) as u64
+ self.rebuffered_packets_count.load(Ordering::Relaxed) as u64
+ self.consumed_buffered_packets_count.load(Ordering::Relaxed) as u64
+ self
.consume_buffered_packets_elapsed
.load(Ordering::Relaxed)
+ self.process_packets_elapsed.load(Ordering::Relaxed)
+ self
.handle_retryable_packets_elapsed
.load(Ordering::Relaxed)
+ self.filter_pending_packets_elapsed.load(Ordering::Relaxed)
+ self.packet_duplicate_check_elapsed.load(Ordering::Relaxed)
+ self.packet_conversion_elapsed.load(Ordering::Relaxed)
+ self
.unprocessed_packet_conversion_elapsed
.load(Ordering::Relaxed)
+ self.transaction_processing_elapsed.load(Ordering::Relaxed)
}

fn report(&self, report_interval_ms: u64) {
// skip repoting metrics if stats is empty
if self.is_empty() {
return;
}
if self.last_report.should_update(report_interval_ms) {
datapoint_info!(
"banking_stage-loop-stats",
Expand Down

0 comments on commit 810ca36

Please sign in to comment.