diff options
Diffstat (limited to 'src/buildtool/execution_engine/executor')
-rw-r--r-- | src/buildtool/execution_engine/executor/TARGETS | 2 | ||||
-rw-r--r-- | src/buildtool/execution_engine/executor/context.hpp | 4 | ||||
-rw-r--r-- | src/buildtool/execution_engine/executor/executor.hpp | 34 |
3 files changed, 30 insertions, 10 deletions
diff --git a/src/buildtool/execution_engine/executor/TARGETS b/src/buildtool/execution_engine/executor/TARGETS index 4e3d1abd..049efe44 100644 --- a/src/buildtool/execution_engine/executor/TARGETS +++ b/src/buildtool/execution_engine/executor/TARGETS @@ -30,6 +30,7 @@ , ["src/buildtool/file_system", "object_type"] , ["src/buildtool/logging", "log_level"] , ["src/buildtool/logging", "logging"] + , ["src/buildtool/profile", "profile"] , ["src/buildtool/progress_reporting", "progress"] , ["src/buildtool/progress_reporting", "task_tracker"] , ["src/utils/cpp", "back_map"] @@ -50,6 +51,7 @@ , ["src/buildtool/common", "statistics"] , ["src/buildtool/execution_api/common", "api_bundle"] , ["src/buildtool/execution_api/remote", "context"] + , ["src/buildtool/profile", "profile"] , ["src/buildtool/progress_reporting", "progress"] ] , "stage": ["src", "buildtool", "execution_engine", "executor"] diff --git a/src/buildtool/execution_engine/executor/context.hpp b/src/buildtool/execution_engine/executor/context.hpp index 315ab805..cbc2af15 100644 --- a/src/buildtool/execution_engine/executor/context.hpp +++ b/src/buildtool/execution_engine/executor/context.hpp @@ -15,11 +15,14 @@ #ifndef INCLUDED_SRC_BUILDTOOL_EXECUTION_ENGINE_EXECUTOR_CONTEXT_HPP #define INCLUDED_SRC_BUILDTOOL_EXECUTION_ENGINE_EXECUTOR_CONTEXT_HPP +#include <optional> + #include "gsl/gsl" #include "src/buildtool/common/repository_config.hpp" #include "src/buildtool/common/statistics.hpp" #include "src/buildtool/execution_api/common/api_bundle.hpp" #include "src/buildtool/execution_api/remote/context.hpp" +#include "src/buildtool/profile/profile.hpp" #include "src/buildtool/progress_reporting/progress.hpp" /// \brief Aggregate to be passed to graph traverser. @@ -30,6 +33,7 @@ struct ExecutionContext final { gsl::not_null<RemoteContext const*> const remote_context; gsl::not_null<Statistics*> const statistics; gsl::not_null<Progress*> const progress; + std::optional<gsl::not_null<Profile*>> const profile; }; #endif // INCLUDED_SRC_BUILDTOOL_EXECUTION_ENGINE_EXECUTOR_CONTEXT_HPP diff --git a/src/buildtool/execution_engine/executor/executor.hpp b/src/buildtool/execution_engine/executor/executor.hpp index 93cb9655..e030d2d6 100644 --- a/src/buildtool/execution_engine/executor/executor.hpp +++ b/src/buildtool/execution_engine/executor/executor.hpp @@ -64,6 +64,7 @@ #include "src/buildtool/file_system/object_type.hpp" #include "src/buildtool/logging/log_level.hpp" #include "src/buildtool/logging/logger.hpp" +#include "src/buildtool/profile/profile.hpp" #include "src/buildtool/progress_reporting/progress.hpp" #include "src/buildtool/progress_reporting/task_tracker.hpp" #include "src/utils/cpp/back_map.hpp" @@ -828,11 +829,19 @@ class Executor { context_.statistics, context_.progress); // check response and save digests of results - return not response or Impl::ParseResponse(*logger_, - *response, - action, - context_.statistics, - context_.progress); + if (not response) { + return true; + } + auto result = Impl::ParseResponse(*logger_, + *response, + action, + context_.statistics, + context_.progress); + if (context_.profile) { + (*context_.profile) + ->NoteActionCompleted(action->Content().Id(), *response); + } + return result; } Logger logger("action:" + action->Content().Id()); @@ -851,11 +860,16 @@ class Executor { context_.progress); // check response and save digests of results - return not response or Impl::ParseResponse(logger, - *response, - action, - context_.statistics, - context_.progress); + if (not response) { + return true; + } + auto result = Impl::ParseResponse( + logger, *response, action, context_.statistics, context_.progress); + if (context_.profile) { + (*context_.profile) + ->NoteActionCompleted(action->Content().Id(), *response); + } + return result; } /// \brief Check artifact is available to the CAS or upload it. |