From 61ee4517214cd8547ba7088fb4a53ec543d986b2 Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Mon, 8 Aug 2022 17:25:57 +0200 Subject: Rebuild: Support proper progress printing --- src/buildtool/execution_engine/executor/executor.hpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/buildtool/execution_engine/executor') diff --git a/src/buildtool/execution_engine/executor/executor.hpp b/src/buildtool/execution_engine/executor/executor.hpp index 02a56f49..546c5165 100644 --- a/src/buildtool/execution_engine/executor/executor.hpp +++ b/src/buildtool/execution_engine/executor/executor.hpp @@ -72,8 +72,11 @@ class ExecutorImpl { return std::nullopt; } - Progress::Instance().Start(action->Content().Id()); - Statistics::Instance().IncrementActionsQueuedCounter(); + // do not count statistics for rebuilder fetching from cache + if (cache_flag != IExecutionAction::CacheFlag::FromCacheOnly) { + Progress::Instance().Start(action->Content().Id()); + Statistics::Instance().IncrementActionsQueuedCounter(); + } auto remote_action = api->CreateAction(*root_digest, action->Command(), @@ -414,8 +417,8 @@ class ExecutorImpl { [[nodiscard]] static auto ParseResponse( Logger const& logger, IExecutionResponse::Ptr const& response, - gsl::not_null const& action) - -> bool { + gsl::not_null const& action, + bool count_as_executed = false) -> bool { logger.Emit(LogLevel::Trace, "finished execution"); if (!response) { @@ -423,7 +426,7 @@ class ExecutorImpl { return false; } - if (response->IsCached()) { + if (not count_as_executed and response->IsCached()) { logger.Emit(LogLevel::Trace, " - served from cache"); Statistics::Instance().IncrementActionsCachedCounter(); } @@ -618,7 +621,8 @@ class Rebuilder { } DetectFlakyAction(*response, *response_cached, action->Content()); - return Impl::ParseResponse(logger, *response, action); + return Impl::ParseResponse( + logger, *response, action, /*count_as_executed=*/true); } [[nodiscard]] auto Process( -- cgit v1.2.3