Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[consensus] record timeout author with reason in metrics #15157

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion consensus/src/counters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ pub static AGGREGATED_ROUND_TIMEOUT_REASON: Lazy<IntCounterVec> = Lazy::new(|| {
register_int_counter_vec!(
"aptos_consensus_agg_round_timeout_reason",
"Count of round timeouts by reason",
&["reason", "is_next_proposer"],
&["reason", "author", "is_next_proposer"],
)
.unwrap()
});
Expand Down
12 changes: 10 additions & 2 deletions consensus/src/round_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,13 @@ impl RoundManager {
&mut self,
new_round_event: NewRoundEvent,
) -> anyhow::Result<()> {
let new_round = new_round_event.round;
let is_current_proposer = self
.proposer_election
.is_valid_proposer(self.proposal_generator.author(), new_round_event.round);
.is_valid_proposer(self.proposal_generator.author(), new_round);
let prev_proposer = self
.proposer_election
.get_valid_proposer(new_round.saturating_sub(1));

counters::CURRENT_ROUND.set(new_round_event.round as i64);
counters::ROUND_TIMEOUT_MS.set(new_round_event.timeout.as_millis() as i64);
Expand All @@ -368,7 +372,11 @@ impl RoundManager {
NewRoundReason::Timeout(ref reason) => {
counters::TIMEOUT_ROUNDS_COUNT.inc();
counters::AGGREGATED_ROUND_TIMEOUT_REASON
.with_label_values(&[&reason.to_string(), &is_current_proposer.to_string()])
.with_label_values(&[
&reason.to_string(),
prev_proposer.short_str().as_str(),
&is_current_proposer.to_string(),
])
.inc();
if is_current_proposer {
if let RoundTimeoutReason::PayloadUnavailable { missing_authors } = reason {
Expand Down
Loading