From ef9b8b97a402e673929ea54dcf2bc8d2e0428037 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Mon, 4 Apr 2022 13:23:50 +0200 Subject: statistics: also count completed uncached actions --- src/buildtool/common/statistics.hpp | 6 ++++++ src/buildtool/execution_engine/executor/executor.hpp | 3 +++ 2 files changed, 9 insertions(+) (limited to 'src') 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 num_actions_queued_{}; + std::atomic num_actions_executed_{}; std::atomic num_actions_cached_{}; std::atomic num_actions_flaky_{}; std::atomic 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; -- cgit v1.2.3