aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc/src')
-rw-r--r--toolsrc/src/commands_build.cpp6
-rw-r--r--toolsrc/src/commands_install.cpp2
-rw-r--r--toolsrc/src/commands_version.cpp2
-rw-r--r--toolsrc/src/metrics.cpp2
-rw-r--r--toolsrc/src/vcpkg.cpp24
-rw-r--r--toolsrc/src/vcpkg_Input.cpp2
-rw-r--r--toolsrc/src/vcpkg_cmd_arguments.cpp8
-rw-r--r--toolsrc/src/vcpkg_metrics_uploader.cpp2
-rw-r--r--toolsrc/src/vcpkg_paths.cpp6
-rw-r--r--toolsrc/src/vcpkglib.cpp2
10 files changed, 28 insertions, 28 deletions
diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp
index 3c3fbeb66..7b4e4cf37 100644
--- a/toolsrc/src/commands_build.cpp
+++ b/toolsrc/src/commands_build.cpp
@@ -68,12 +68,12 @@ namespace vcpkg::Commands::Build
int return_code = System::cmd_execute_clean(command);
auto buildtimeus = timer.microseconds();
- TrackMetric("buildtimeus-" + spec.toString(), buildtimeus);
+ Metrics::TrackMetric("buildtimeus-" + spec.toString(), buildtimeus);
if (return_code != 0)
{
- TrackProperty("error", "build failed");
- TrackProperty("build_error", spec.toString());
+ Metrics::TrackProperty("error", "build failed");
+ Metrics::TrackProperty("build_error", spec.toString());
return BuildResult::BUILD_FAILED;
}
diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/commands_install.cpp
index bba3c665f..a7347902f 100644
--- a/toolsrc/src/commands_install.cpp
+++ b/toolsrc/src/commands_install.cpp
@@ -210,7 +210,7 @@ namespace vcpkg::Commands::Install
specs_string.push_back(',');
specs_string.append(install_plan[i].spec.toString());
}
- TrackProperty("installplan", specs_string);
+ Metrics::TrackProperty("installplan", specs_string);
// execute the plan
for (const package_spec_with_install_plan& action : install_plan)
diff --git a/toolsrc/src/commands_version.cpp b/toolsrc/src/commands_version.cpp
index 7e8b4d1cb..e834a8564 100644
--- a/toolsrc/src/commands_version.cpp
+++ b/toolsrc/src/commands_version.cpp
@@ -19,7 +19,7 @@ namespace vcpkg::Commands::Version
#ifndef NDEBUG
+ std::string("-debug")
#endif
- + std::string(GetCompiledMetricsEnabled() ? "" : "-external");
+ + std::string(Metrics::GetCompiledMetricsEnabled() ? "" : "-external");
return s_version;
}
diff --git a/toolsrc/src/metrics.cpp b/toolsrc/src/metrics.cpp
index 2fdbe8f09..910d971aa 100644
--- a/toolsrc/src/metrics.cpp
+++ b/toolsrc/src/metrics.cpp
@@ -4,7 +4,7 @@
#include "vcpkg_Strings.h"
#include "vcpkg_System.h"
-namespace vcpkg
+namespace vcpkg::Metrics
{
static std::string GetCurrentDateTime()
{
diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp
index a716bcf65..1b3df2222 100644
--- a/toolsrc/src/vcpkg.cpp
+++ b/toolsrc/src/vcpkg.cpp
@@ -26,7 +26,7 @@ void invalid_command(const std::string& cmd)
static void inner(const vcpkg_cmd_arguments& args)
{
- TrackProperty("command", args.command);
+ Metrics::TrackProperty("command", args.command);
if (args.command.empty())
{
Commands::Help::print_usage();
@@ -130,7 +130,7 @@ static void loadConfig()
auto user_time = keys["User-Since"];
if (!user_id.empty() && !user_time.empty())
{
- SetUserInformation(user_id, user_time);
+ Metrics::SetUserInformation(user_id, user_time);
return;
}
}
@@ -139,8 +139,8 @@ static void loadConfig()
// config file not found, could not be read, or invalid
std::string user_id, user_time;
- InitUserInformation(user_id, user_time);
- SetUserInformation(user_id, user_time);
+ Metrics::InitUserInformation(user_id, user_time);
+ Metrics::SetUserInformation(user_id, user_time);
try
{
std::error_code ec;
@@ -183,23 +183,23 @@ int wmain(const int argc, const wchar_t* const* const argv)
atexit([]()
{
auto elapsed_us = g_timer.microseconds();
- TrackMetric("elapsed_us", elapsed_us);
- Flush();
+ Metrics::TrackMetric("elapsed_us", elapsed_us);
+ Metrics::Flush();
});
- TrackProperty("version", Commands::Version::version());
+ Metrics::TrackProperty("version", Commands::Version::version());
const std::string trimmed_command_line = trim_path_from_command_line(Strings::utf16_to_utf8(GetCommandLineW()));
- TrackProperty("cmdline", trimmed_command_line);
+ Metrics::TrackProperty("cmdline", trimmed_command_line);
loadConfig();
- TrackProperty("sqmuser", GetSQMUser());
+ Metrics::TrackProperty("sqmuser", Metrics::GetSQMUser());
const vcpkg_cmd_arguments args = vcpkg_cmd_arguments::create_from_command_line(argc, argv);
if (args.printmetrics != opt_bool_t::UNSPECIFIED)
- SetPrintMetrics(args.printmetrics == opt_bool_t::ENABLED);
+ Metrics::SetPrintMetrics(args.printmetrics == opt_bool_t::ENABLED);
if (args.sendmetrics != opt_bool_t::UNSPECIFIED)
- SetSendMetrics(args.sendmetrics == opt_bool_t::ENABLED);
+ Metrics::SetSendMetrics(args.sendmetrics == opt_bool_t::ENABLED);
if (args.debug != opt_bool_t::UNSPECIFIED)
{
@@ -226,7 +226,7 @@ int wmain(const int argc, const wchar_t* const* const argv)
{
exc_msg = "unknown error(...)";
}
- TrackProperty("error", exc_msg);
+ Metrics::TrackProperty("error", exc_msg);
fflush(stdout);
System::print(
diff --git a/toolsrc/src/vcpkg_Input.cpp b/toolsrc/src/vcpkg_Input.cpp
index 552ddc3da..8687732e4 100644
--- a/toolsrc/src/vcpkg_Input.cpp
+++ b/toolsrc/src/vcpkg_Input.cpp
@@ -26,7 +26,7 @@ namespace vcpkg::Input
if (!paths.is_valid_triplet(t))
{
System::println(System::color::error, "Error: invalid triplet: %s", t.canonical_name());
- TrackProperty("error", "invalid triplet: " + t.canonical_name());
+ Metrics::TrackProperty("error", "invalid triplet: " + t.canonical_name());
Commands::Help::help_topic_valid_triplet(paths);
Checks::exit_fail(VCPKG_LINE_INFO);
}
diff --git a/toolsrc/src/vcpkg_cmd_arguments.cpp b/toolsrc/src/vcpkg_cmd_arguments.cpp
index 8c80e81fa..0e61f39c4 100644
--- a/toolsrc/src/vcpkg_cmd_arguments.cpp
+++ b/toolsrc/src/vcpkg_cmd_arguments.cpp
@@ -15,7 +15,7 @@ namespace vcpkg
if (arg_begin == arg_end)
{
System::println(System::color::error, "Error: expected value after %s", option_name);
- TrackProperty("error", "error option name");
+ Metrics::TrackProperty("error", "error option name");
Commands::Help::print_usage();
Checks::exit_fail(VCPKG_LINE_INFO);
}
@@ -23,7 +23,7 @@ namespace vcpkg
if (option_field != nullptr)
{
System::println(System::color::error, "Error: %s specified multiple times", option_name);
- TrackProperty("error", "error option specified multiple times");
+ Metrics::TrackProperty("error", "error option specified multiple times");
Commands::Help::print_usage();
Checks::exit_fail(VCPKG_LINE_INFO);
}
@@ -39,7 +39,7 @@ namespace vcpkg
if (option_field != opt_bool_t::UNSPECIFIED && option_field != new_setting)
{
System::println(System::color::error, "Error: conflicting values specified for --%s", option_name);
- TrackProperty("error", "error conflicting switches");
+ Metrics::TrackProperty("error", "error conflicting switches");
Commands::Help::print_usage();
Checks::exit_fail(VCPKG_LINE_INFO);
}
@@ -72,7 +72,7 @@ namespace vcpkg
if (arg[0] == '-' && arg[1] != '-')
{
- TrackProperty("error", "error short options are not supported");
+ Metrics::TrackProperty("error", "error short options are not supported");
Checks::exit_with_message(VCPKG_LINE_INFO, "Error: short options are not supported: %s", arg);
}
diff --git a/toolsrc/src/vcpkg_metrics_uploader.cpp b/toolsrc/src/vcpkg_metrics_uploader.cpp
index fd6afe63b..2b36ed236 100644
--- a/toolsrc/src/vcpkg_metrics_uploader.cpp
+++ b/toolsrc/src/vcpkg_metrics_uploader.cpp
@@ -13,5 +13,5 @@ int WINAPI WinMain(_In_ HINSTANCE, _In_opt_ HINSTANCE, _In_ LPSTR, _In_ int)
szArgList = CommandLineToArgvW(GetCommandLineW(), &argCount);
Checks::check_exit(VCPKG_LINE_INFO, argCount == 2, "Requires exactly one argument, the path to the payload file");
- Upload(Files::read_contents(szArgList[1]).value_or_exit(VCPKG_LINE_INFO));
+ Metrics::Upload(Files::read_contents(szArgList[1]).value_or_exit(VCPKG_LINE_INFO));
}
diff --git a/toolsrc/src/vcpkg_paths.cpp b/toolsrc/src/vcpkg_paths.cpp
index eb2478f2e..50f2f78dd 100644
--- a/toolsrc/src/vcpkg_paths.cpp
+++ b/toolsrc/src/vcpkg_paths.cpp
@@ -74,8 +74,8 @@ namespace vcpkg
if (rc.exit_code)
{
System::println(System::color::error, "Launching powershell failed or was denied");
- TrackProperty("error", "powershell install failed");
- TrackProperty("installcmd", install_cmd);
+ Metrics::TrackProperty("error", "powershell install failed");
+ Metrics::TrackProperty("installcmd", install_cmd);
Checks::exit_with_code(VCPKG_LINE_INFO, rc.exit_code);
}
@@ -166,7 +166,7 @@ namespace vcpkg
if (paths.root.empty())
{
- TrackProperty("error", "Invalid vcpkg root directory");
+ Metrics::TrackProperty("error", "Invalid vcpkg root directory");
Checks::exit_with_message(VCPKG_LINE_INFO, "Invalid vcpkg root directory: %s", paths.root.string());
}
diff --git a/toolsrc/src/vcpkglib.cpp b/toolsrc/src/vcpkglib.cpp
index 8dff013bd..adec9163f 100644
--- a/toolsrc/src/vcpkglib.cpp
+++ b/toolsrc/src/vcpkglib.cpp
@@ -120,7 +120,7 @@ namespace vcpkg
if (!was_tracked)
{
was_tracked = true;
- TrackProperty("listfile", "update to new format");
+ Metrics::TrackProperty("listfile", "update to new format");
}
// The files are sorted such that directories are placed just before the files they contain