diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-04-04 13:23:50 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-04-04 19:31:22 +0200 |
commit | ef9b8b97a402e673929ea54dcf2bc8d2e0428037 (patch) | |
tree | 55cbf52962d6d548231318294aa903e52d30c640 /src | |
parent | c22ddd7f8c1ddc3682e5c3c0abe9e90f598a399b (diff) | |
download | justbuild-ef9b8b97a402e673929ea54dcf2bc8d2e0428037.tar.gz |
statistics: also count completed uncached actions
Diffstat (limited to 'src')
-rw-r--r-- | src/buildtool/common/statistics.hpp | 6 | ||||
-rw-r--r-- | src/buildtool/execution_engine/executor/executor.hpp | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/buildtool/common/statistics.hpp b/src/buildtool/common/statistics.hpp index a7b89791..6ddcf7d3 100644 --- a/src/buildtool/common/statistics.hpp +++ b/src/buildtool/common/statistics.hpp @@ -12,6 +12,7 @@ class Statistics { void Reset() noexcept { num_actions_queued_ = 0; + num_actions_executed_ = 0; num_actions_cached_ = 0; num_actions_flaky_ = 0; num_actions_flaky_tainted_ = 0; @@ -19,6 +20,7 @@ class Statistics { num_rebuilt_actions_missing_ = 0; } void IncrementActionsQueuedCounter() noexcept { ++num_actions_queued_; } + void IncrementActionsExecutedCounter() noexcept { ++num_actions_executed_; } void IncrementActionsCachedCounter() noexcept { ++num_actions_cached_; } void IncrementActionsFlakyCounter() noexcept { ++num_actions_flaky_; } void IncrementActionsFlakyTaintedCounter() noexcept { @@ -33,6 +35,9 @@ class Statistics { [[nodiscard]] auto ActionsQueuedCounter() const noexcept -> int { return num_actions_queued_; } + [[nodiscard]] auto ActionsExecutedCounter() const noexcept -> int { + return num_actions_executed_; + } [[nodiscard]] auto ActionsCachedCounter() const noexcept -> int { return num_actions_cached_; } @@ -51,6 +56,7 @@ class Statistics { private: std::atomic<int> num_actions_queued_{}; + std::atomic<int> num_actions_executed_{}; std::atomic<int> num_actions_cached_{}; std::atomic<int> num_actions_flaky_{}; std::atomic<int> num_actions_flaky_tainted_{}; diff --git a/src/buildtool/execution_engine/executor/executor.hpp b/src/buildtool/execution_engine/executor/executor.hpp index 94c32b1f..9caa7bee 100644 --- a/src/buildtool/execution_engine/executor/executor.hpp +++ b/src/buildtool/execution_engine/executor/executor.hpp @@ -261,6 +261,9 @@ class ExecutorImpl { logger.Emit(LogLevel::Trace, " - served from cache"); Statistics::Instance().IncrementActionsCachedCounter(); } + else { + Statistics::Instance().IncrementActionsExecutedCounter(); + } PrintInfo(logger, action->Command(), response); bool should_fail_outputs = false; |