Skip to content

Commit

Permalink
Merge branch 'main' into GH-985-interrupt-apply
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner authored Nov 11, 2024
2 parents af67e0d + f871bf2 commit c7b42ad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3531,8 +3531,9 @@ struct controller_impl {

void log_applied(controller::block_status s) const {
fc::time_point now = fc::time_point::now();
// if syncing and not current block, then only report every 1000 blocks
if (now - chain_head.timestamp() > fc::minutes(5) && chain_head.block_num() % 1000 != 0)
// * if syncing and not current block, then only report every 1000 blocks;
// * if replaying, do not report.
if ((now - chain_head.timestamp() > fc::minutes(5) && chain_head.block_num() % 1000 != 0) || replaying)
return;

const auto& br = pending->_block_report;
Expand Down Expand Up @@ -3568,6 +3569,7 @@ struct controller_impl {
("count", chain_head.block()->transactions.size())("lib", chain_head.irreversible_blocknum())
("net", br.total_net_usage)("cpu", br.total_cpu_usage_us)
("elapsed", br.total_elapsed_time)("time", now - br.start_time)("latency", (now - chain_head.timestamp()).count() / 1000));

if (_update_incoming_block_metrics) {
_update_incoming_block_metrics({.trxs_incoming_total = chain_head.block()->transactions.size(),
.cpu_usage_us = br.total_cpu_usage_us,
Expand Down

0 comments on commit c7b42ad

Please sign in to comment.