From 7ffc8485306dddc24d963b7993cd66c5ebd346d6 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Fri, 2 Aug 2024 17:10:42 +0200 Subject: just: report completion of analyse earlier ... right after having successfully finished analysing the target. As a side effect, we also get the statistics of the export targets reported on analysis requests. As cached export targets project artifacts to known ones, that information is highly relevant there. --- src/buildtool/main/main.cpp | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/buildtool/main/main.cpp') diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp index 8f66e0d6..d62edf9f 100644 --- a/src/buildtool/main/main.cpp +++ b/src/buildtool/main/main.cpp @@ -1126,6 +1126,27 @@ auto main(int argc, char* argv[]) -> int { os << serve_errors.dump() << std::endl; } if (result) { + Logger::Log(LogLevel::Info, + "Analysed target {}", + result->id.ToShortString()); + + { + auto cached = stats.ExportsCachedCounter(); + auto served = stats.ExportsServedCounter(); + auto uncached = stats.ExportsUncachedCounter(); + auto not_eligible = stats.ExportsNotEligibleCounter(); + Logger::Log( + served + cached + uncached + not_eligible > 0 + ? LogLevel::Info + : LogLevel::Debug, + "Export targets found: {} cached, {}{} uncached, " + "{} not eligible for caching", + cached, + served > 0 ? fmt::format("{} served, ", served) : "", + uncached, + not_eligible); + } + if (arguments.analysis.graph_file) { result_map.ToFile( *arguments.analysis.graph_file, &stats, &progress); @@ -1149,27 +1170,6 @@ auto main(int argc, char* argv[]) -> int { return kExitSuccess; } #ifndef BOOTSTRAP_BUILD_TOOL - Logger::Log(LogLevel::Info, - "Analysed target {}", - result->id.ToShortString()); - - { - auto cached = stats.ExportsCachedCounter(); - auto served = stats.ExportsServedCounter(); - auto uncached = stats.ExportsUncachedCounter(); - auto not_eligible = stats.ExportsNotEligibleCounter(); - Logger::Log( - served + cached + uncached + not_eligible > 0 - ? LogLevel::Info - : LogLevel::Debug, - "Export targets found: {} cached, {}{} uncached, " - "{} not eligible for caching", - cached, - served > 0 ? fmt::format("{} served, ", served) : "", - uncached, - not_eligible); - } - ReportTaintedness(*result); auto const& [actions, blobs, trees] = result_map.ToResult(&stats, &progress); -- cgit v1.2.3