From 9ff01a766d98359c7dcf199aa6c4fba7fb427140 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 7 May 2025 10:22:39 +0200 Subject: profile: include remote-execution properties Include in the profile also the effective remote-execution endpoint, properties, and dispatch list. Software projects are often tested in a variety of environments or hardware configurations; as, obviously, the performance might differ significantly (especially depending on the used hardware) a proper analysis therefore requires the possibility to distinguish the various backends. Adding the effective configuration adds this posibility. --- src/buildtool/profile/profile.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/buildtool/profile/profile.cpp') diff --git a/src/buildtool/profile/profile.cpp b/src/buildtool/profile/profile.cpp index f37629f1..1407ddbd 100644 --- a/src/buildtool/profile/profile.cpp +++ b/src/buildtool/profile/profile.cpp @@ -20,6 +20,7 @@ #include "gsl/gsl" #include "src/buildtool/common/artifact_digest.hpp" #include "src/buildtool/common/cli.hpp" +#include "src/buildtool/common/remote/remote_common.hpp" #include "src/utils/cpp/expected.hpp" void Profile::Write(int exit_code) { @@ -156,3 +157,20 @@ void Profile::NoteAnalysisError(std::string const& error_message) { std::unique_lock lock{mutex_}; analysis_errors_.emplace_back(error_message); } + +void Profile::SetRemoteExecutionConfig(RemoteExecutionConfig const& config) { + auto remote = nlohmann::json::object(); + if (config.remote_address) { + remote["address"] = config.remote_address->ToJson(); + } + remote["properties"] = config.platform_properties; + auto dispatch = nlohmann::json::array(); + for (auto const& dispatch_entry : config.dispatch) { + auto entry = nlohmann::json::array(); + entry.emplace_back(dispatch_entry.first); + entry.emplace_back(dispatch_entry.second.ToJson()); + dispatch.emplace_back(entry); + } + remote["dispatch"] = dispatch; + profile_["remote"] = remote; +} -- cgit v1.2.3