summaryrefslogtreecommitdiff
path: root/src/buildtool/profile/profile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildtool/profile/profile.cpp')
-rw-r--r--src/buildtool/profile/profile.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/buildtool/profile/profile.cpp b/src/buildtool/profile/profile.cpp
index 3ee7f2a6..9a7eaf7d 100644
--- a/src/buildtool/profile/profile.cpp
+++ b/src/buildtool/profile/profile.cpp
@@ -26,6 +26,9 @@ void Profile::Write(int exit_code) {
for (auto const& [k, v] : actions_) {
auto entry = nlohmann::json::object();
entry["cached"] = v.cached;
+ if (not v.cached) {
+ entry["duration"] = v.duration;
+ }
actions[k] = entry;
}
profile_["actions"] = actions;
@@ -48,5 +51,6 @@ void Profile::SetConfiguration(nlohmann::json configuration) {
void Profile::NoteActionCompleted(std::string const& id,
IExecutionResponse::Ptr const& response) {
std::unique_lock lock{mutex_};
- actions_[id] = ActionData{.cached = response->IsCached()};
+ actions_[id] = ActionData{.cached = response->IsCached(),
+ .duration = response->ExecutionDuration()};
}