diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2025-05-26 14:14:20 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2025-05-26 14:21:24 +0200 |
commit | 349640e597477f57ab7d4de30f9d0bbc0e21fbd3 (patch) | |
tree | dd8d92f2f3393637dfb170940c63ef5152bfefea /src/buildtool | |
parent | 2ada58e9a8c7b95dd7da5bfe8a6f1e16bb7686f5 (diff) | |
download | justbuild-349640e597477f57ab7d4de30f9d0bbc0e21fbd3.tar.gz |
profile: include time of build start
When using a serve end point, the analysis phase might take quite
long if serve has to actually build a delegated target or, at
least, has to synchronize artifacts with the remote end point.
Therefore, also record the time the build phase started (if building
is requested) as an additional time stamp in the profile.
Diffstat (limited to 'src/buildtool')
-rw-r--r-- | src/buildtool/main/main.cpp | 3 | ||||
-rw-r--r-- | src/buildtool/profile/profile.cpp | 4 | ||||
-rw-r--r-- | src/buildtool/profile/profile.hpp | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp index 10abfa1a..3da6de93 100644 --- a/src/buildtool/main/main.cpp +++ b/src/buildtool/main/main.cpp @@ -1244,6 +1244,9 @@ auto main(int argc, char* argv[]) -> int { analyse_result->id.ToShortString( Evaluator::GetExpressionLogLimit())); + if (profile != nullptr) { + profile->StartBuild(); + } auto build_result = traverser.BuildAndStage(artifacts, runfiles, diff --git a/src/buildtool/profile/profile.cpp b/src/buildtool/profile/profile.cpp index 5ee9cd15..1d8a7b46 100644 --- a/src/buildtool/profile/profile.cpp +++ b/src/buildtool/profile/profile.cpp @@ -178,3 +178,7 @@ void Profile::SetRemoteExecutionConfig(RemoteExecutionConfig const& config) { remote["dispatch"] = dispatch; profile_["remote"] = remote; } + +void Profile::StartBuild() { + profile_["build start time"] = std::time(nullptr); +} diff --git a/src/buildtool/profile/profile.hpp b/src/buildtool/profile/profile.hpp index 0db655fb..099ce2cc 100644 --- a/src/buildtool/profile/profile.hpp +++ b/src/buildtool/profile/profile.hpp @@ -46,6 +46,7 @@ class Profile { IExecutionResponse::Ptr const& response, std::string const& cwd); void NoteAnalysisError(std::string const& error_message); + void StartBuild(); private: struct ActionData { |