[vcpkg] update telemetry
MODIFY
src/vcpkg.cpp
src/vcpkg.cpp
@@ -304,7 +304,6 @@ int main(const int argc, const char* const* const argv)
SetConsoleCP(CP_UTF8);
SetConsoleOutputCP(CP_UTF8);
- const std::string trimmed_command_line = trim_path_from_command_line(Strings::to_utf8(GetCommandLineW()));
#endif
Checks::register_global_shutdown_handler([]() {
@@ -335,9 +334,6 @@ int main(const int argc, const char* const* const argv)
{
auto locked_metrics = Metrics::g_metrics.lock();
locked_metrics->track_property("version", Commands::Version::version());
-#if defined(_WIN32)
- locked_metrics->track_property("cmdline", trimmed_command_line);
-#endif
}
System::register_console_ctrl_handler();

MODIFY
src/vcpkg/build.cpp
src/vcpkg/build.cpp
@@ -580,7 +580,15 @@ namespace vcpkg::Build
{
auto locked_metrics = Metrics::g_metrics.lock();
- locked_metrics->track_buildtime(spec.to_string() + ":[" + Strings::join(",", config.feature_list) + "]",
+
+ locked_metrics->track_buildtime(Hash::get_string_hash(spec.to_string(), Hash::Algorithm::Sha256) + ":[" +
+ Strings::join(",",
+ config.feature_list,
+ [](std::string feature) {
+ return Hash::get_string_hash(feature,
+ Hash::Algorithm::Sha256);
+ }) +
+ "]",
buildtimeus);
if (return_code != 0)
{

MODIFY
src/vcpkg/install.cpp
src/vcpkg/install.cpp
#include "pch.h"
#include <vcpkg/base/files.h>
+#include <vcpkg/base/hash.h>
#include <vcpkg/base/system.print.h>
#include <vcpkg/base/util.h>
#include <vcpkg/build.h>
@@ -690,9 +691,9 @@ namespace vcpkg::Install
// log the plan
const std::string specs_string = Strings::join(",", action_plan, [](const AnyAction& action) {
if (auto iaction = action.install_action.get())
- return iaction->spec.to_string();
+ return Hash::get_string_hash(iaction->spec.to_string(), Hash::Algorithm::Sha256);
else if (auto raction = action.remove_action.get())
- return "R$" + raction->spec.to_string();
+ return "R$" + Hash::get_string_hash(raction->spec.to_string(), Hash::Algorithm::Sha256);
Checks::unreachable(VCPKG_LINE_INFO);
});

MODIFY
src/vcpkg/metrics.cpp
src/vcpkg/metrics.cpp
@@ -184,8 +184,14 @@ namespace vcpkg::Metrics
if (buildtime_names.size() > 0)
{
if (props_plus_buildtimes.size() > 0) props_plus_buildtimes.push_back(',');
- props_plus_buildtimes.append(Strings::format(R"("buildnames": [%s], "buildtimes": [%s])",
- Strings::join(",", buildtime_names, to_json_string),
+ props_plus_buildtimes.append(
+ Strings::format(R"("buildnames": [%s], "buildtimes": [%s])",
+ Strings::join(",",
+ buildtime_names,
+ [](std::string buildname) {
+ return to_json_string(vcpkg::Hash::get_string_hash(
+ buildname, Hash::Algorithm::Sha256));
+ }),
Strings::join(",", buildtime_times)));
}

[vcpkg] update telemetry