Skip to content

Commit

Permalink
[core] Added debug info log for worker status reports
Browse files Browse the repository at this point in the history
  • Loading branch information
pajama-coder committed Jan 3, 2025
1 parent 6ee6ddb commit b28b492
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,20 @@ class StatusReporter : public PeriodicJob {
static Data::Producer s_dp("Status Reports");
if (s_has_shutdown) return;
if (!m_fetch->busy()) {
Log::debug(Log::CODEBASE, "[codebase] Start collecting status");

WorkerManager::get().status(
[this](Status &status) {
if (m_send_metrics) {
Log::debug(Log::CODEBASE, "[codebase] Start collecting metrics");
WorkerManager::get().stats(
[&](stats::MetricDataSum &metric_data_sum) {
Log::debug(Log::CODEBASE, "[codebase] Start sending status report");
send(status, &metric_data_sum);
}
);
} else {
Log::debug(Log::CODEBASE, "[codebase] Start sending status report");
send(status, nullptr);
}
}
Expand Down Expand Up @@ -283,8 +288,8 @@ class StatusReporter : public PeriodicJob {

Log::debug(
Log::CODEBASE,
"[codebase] Sent status report in %dms (size = %d)",
int(utils::now() - time), size
"[codebase] Sent status report in %dms (size = %d, response = %d)",
int(utils::now() - time), size, head->status
);
}
);
Expand Down

0 comments on commit b28b492

Please sign in to comment.