diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-03 16:41:38 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-04 16:47:07 -0700 |
| commit | 3677b2c3c83bca770e3f78d48414629783a18295 (patch) | |
| tree | 6b1968590d54afb50d6c50ba89efb7c2b3e5468b /toolsrc/src/metrics.cpp | |
| parent | a266f2f5905b20c63465bcf038c264b3cf6e6011 (diff) | |
| download | vcpkg-3677b2c3c83bca770e3f78d48414629783a18295.tar.gz vcpkg-3677b2c3c83bca770e3f78d48414629783a18295.zip | |
metrics: functions to lower_case
Diffstat (limited to 'toolsrc/src/metrics.cpp')
| -rw-r--r-- | toolsrc/src/metrics.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/toolsrc/src/metrics.cpp b/toolsrc/src/metrics.cpp index 0c66d4443..515d7e574 100644 --- a/toolsrc/src/metrics.cpp +++ b/toolsrc/src/metrics.cpp @@ -6,19 +6,17 @@ namespace vcpkg::Metrics { - static std::string GetCurrentDateTime() + static std::string get_current_date_time() { struct tm newtime; - time_t now; - int milli; std::array<char, 80> date; date.fill(0); struct _timeb timebuffer; _ftime_s(&timebuffer); - now = timebuffer.time; - milli = timebuffer.millitm; + time_t now = timebuffer.time; + int milli = timebuffer.millitm; errno_t err = gmtime_s(&newtime, &now); if (err) @@ -30,7 +28,7 @@ namespace vcpkg::Metrics return std::string(&date[0]) + "." + std::to_string(milli) + "Z"; } - static std::string GenerateRandomUUID() + static std::string generate_random_UUID() { int partSizes[] = { 8, 4, 4, 4, 12 }; char uuid[37]; @@ -79,7 +77,7 @@ namespace vcpkg::Metrics static const std::string& get_session_id() { - static const std::string id = GenerateRandomUUID(); + static const std::string id = generate_random_UUID(); return id; } @@ -148,9 +146,9 @@ namespace vcpkg::Metrics struct MetricMessage { - std::string user_id = GenerateRandomUUID(); + std::string user_id = generate_random_UUID(); std::string user_timestamp; - std::string timestamp = GetCurrentDateTime(); + std::string timestamp = get_current_date_time(); std::string properties; std::string measurements; @@ -239,8 +237,8 @@ true void init_user_information(std::string& user_id, std::string& first_use_time) { - user_id = GenerateRandomUUID(); - first_use_time = GetCurrentDateTime(); + user_id = generate_random_UUID(); + first_use_time = get_current_date_time(); } void set_send_metrics(bool should_send_metrics) @@ -409,7 +407,7 @@ true return; } - const fs::path vcpkg_metrics_txt_path = temp_folder_path / ("vcpkg" + GenerateRandomUUID() + ".txt"); + const fs::path vcpkg_metrics_txt_path = temp_folder_path / ("vcpkg" + generate_random_UUID() + ".txt"); std::ofstream(vcpkg_metrics_txt_path) << payload; const std::wstring cmdLine = Strings::wformat(L"start %s %s", temp_folder_path_exe.native(), vcpkg_metrics_txt_path.native()); |
