Skip to content

Commit

Permalink
emit warning if bl merge slower than 50 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasBrady committed Jun 4, 2024
1 parent 5f8144d commit a484e88
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions src/bucket/FutureBucket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,25 @@ FutureBucket::startMerge(Application& app, uint32_t maxProtocolVersion,
CLOG_TRACE(
Bucket, "Worker finished merging curr={} with snap={}",
hexAbbrev(curr->getHash()), hexAbbrev(snap->getHash()));

std::chrono::duration<double> time(timeScope.Stop());
double timePct = time.count() / availableTime.count() * 100;
CLOG_DEBUG(
Perf,
"Bucket merge on level {} finished in {} seconds "
"({}% of available time)",
level, time.count(), timePct);
auto time = timeScope.Stop();
std::chrono::duration<double> doubleTime(time);
double timePct = doubleTime.count() / availableTime.count() * 100;
auto timeSec = std::chrono::duration_cast<std::chrono::seconds>(
time);
if (time > std::chrono::seconds(50))
{
CLOG_WARNING(
Bucket,
"Bucket merge on level {} finished in {} seconds "
"({}% of available time)",
level, timeSec.count(), timePct);
} else {
CLOG_DEBUG(
Perf,
"Bucket merge on level {} finished in {} seconds "
"({}% of available time)",
level, timeSec.count(), timePct);
}
}

return res;
Expand Down

0 comments on commit a484e88

Please sign in to comment.