Skip to content

Commit

Permalink
Trivial debug logging updates
Browse files Browse the repository at this point in the history
  • Loading branch information
hewison-chris committed Mar 30, 2022
1 parent fae0e6c commit 75c421a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions source/agora/consensus/protocol/Nominator.d
Original file line number Diff line number Diff line change
Expand Up @@ -1608,6 +1608,9 @@ extern(D):

if (callback is null || timeout == 0)
return;
log.dbg("{}: block {} slot idx {} timeout = {} msecs for {}",
__FUNCTION__, this.ledger.height() + 1, slot_idx, timeout,
type == 0 ? "NOMINATION_TIMER" : "BALLOT_PROTOCOL_TIMER" );
this.active_timers[type] = this.taskman.setTimer(
timeout.msecs, { callCPPDelegate(callback); });
}
Expand All @@ -1625,7 +1628,7 @@ extern(D):
if (Height(slot_idx) > this.heighest_ballot_height)
{
this.heighest_ballot_height = Height(slot_idx);
log.info("Balloting started for slot idx {}", slot_idx);
log.info("{}: Balloting started for slot idx {}", __FUNCTION__, slot_idx);
auto time_to_ballot = (this.clock.networkTime() -
this.ledger.getExpectedBlockTime(this.heighest_ballot_height)).total!"seconds";
this.slot_stat.setMetricTo!"time_to_ballot"(time_to_ballot, assumeWontThrow(Height(slot_idx).toString()));
Expand Down Expand Up @@ -1664,7 +1667,8 @@ extern(D):
auto val_multipler = 1 + this.ledger.validatorCount(this.ledger.height()) / 8;
this.round_timeout = base * val_multipler * roundNumber;
const timeout = milliseconds(round_timeout.total!"msecs".to!long);
log.dbg("{}: roundNumber {} timeout = {} msecs", __FUNCTION__, roundNumber, timeout);
log.dbg("{}: block {} roundNumber {} timeout = {} msecs",
__FUNCTION__, this.ledger.height() + 1, roundNumber, timeout);
return timeout;
}
}
Expand Down

0 comments on commit 75c421a

Please sign in to comment.