This repository was archived by the owner on Jan 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
skip reporting all-zero stats #21907
Merged
tao-stones
merged 1 commit into
solana-labs:master
from
tao-stones:skip_empty_banking_stage_stats_reporting
Dec 21, 2021
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: repoting -> reporting
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed...thanks. (I need find a plugin for vim to spell-check for me)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It's built in! |
||
| if self.is_empty() { | ||
| return; | ||
| } | ||
| if self.last_report.should_update(report_interval_ms) { | ||
| datapoint_info!( | ||
| "banking_stage-loop-stats", | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this may be a bit clunky to maintain every time we add a field.
What if we moved all the fields excluding
last_reportandidinto a separateBankingStageStatsInnerwhich derives default, and then thisis_empty()check can beself == BankingStageStatsInner::default()There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
brilliant, would work great if those counter are not
atomictype.self.inner == BankingStageStatsInner::default()would invoke==on AtomicU64, which I need to implemented counter by counter, would end to be the same effect. Maybe I missed some neat Rust feature.