diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2022-08-08 17:25:57 +0200 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2022-08-19 18:18:53 +0200 |
commit | 61ee4517214cd8547ba7088fb4a53ec543d986b2 (patch) | |
tree | 09426e13ebac07fbec58d84c979fa759f9cea8cb /src/buildtool/execution_engine/executor | |
parent | f19c4d9296881083b8dc313e03c6535c68daa7a2 (diff) | |
download | justbuild-61ee4517214cd8547ba7088fb4a53ec543d986b2.tar.gz |
Rebuild: Support proper progress printing
Diffstat (limited to 'src/buildtool/execution_engine/executor')
-rw-r--r-- | src/buildtool/execution_engine/executor/executor.hpp | 16 |
1 files changed, 10 insertions, 6 deletions
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<DependencyGraph::ActionNode const*> const& action) - -> bool { + gsl::not_null<DependencyGraph::ActionNode const*> 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( |