From 0a0440c1a89037866f091dae33a3859f40f41fa2 Mon Sep 17 00:00:00 2001 From: dan-shaw <51385773+dan-shaw@users.noreply.github.com> Date: Fri, 22 Nov 2019 15:07:00 -0800 Subject: [PATCH] update telemetry --- docs/about/privacy.md | 9 ++------- scripts/bootstrap.ps1 | 2 +- scripts/bootstrap.sh | 2 +- toolsrc/src/vcpkg/build.cpp | 2 +- toolsrc/src/vcpkg/install.cpp | 2 +- toolsrc/src/vcpkg/metrics.cpp | 12 +++--------- 6 files changed, 9 insertions(+), 20 deletions(-) diff --git a/docs/about/privacy.md b/docs/about/privacy.md index aa89e303ee..542f276147 100644 --- a/docs/about/privacy.md +++ b/docs/about/privacy.md @@ -5,12 +5,7 @@ For more information about how Microsoft protects your privacy, see https://priv ## Scope -We explicitly ONLY collect information from invocations of the tool itself; we do NOT add any tracking information into the produced libraries. Telemetry is collected when using any of the `vcpkg` commands, such as: - -``` -vcpkg install -vcpkg build -``` +We explicitly ONLY collect information from invocations of the tool itself; we do NOT add any tracking information into the produced libraries. Telemetry is collected when using any of the `vcpkg` commands. ## How to opt out @@ -27,7 +22,7 @@ vcpkg displays text similar to the following when you build vcpkg. This is how M ``` Telemetry --------- -vcpkg collects usage data in order to help us improve your experience. The data collected by Microsoft is anonymous. You can opt-out of telemetry by adding -disableMetrics after the bootstrap-vcpkg script. +vcpkg collects usage data in order to help us improve your experience. The data collected by Microsoft is anonymous. You can opt-out of telemetry by re-running the bootstrap-vcpkg script with -disableMetrics. Read more about vcpkg telemetry at docs/about/privacy.md ``` diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index ce92f0c821..3817fd6913 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -415,7 +415,7 @@ Write-Host "`nBuilding vcpkg.exe... done.`n" Write-Host @" Telemetry --------- -vcpkg collects usage data in order to help us improve your experience. The data collected by Microsoft is anonymous. You can opt-out of telemetry by adding -disableMetrics after the bootstrap-vcpkg.bat script. +vcpkg collects usage data in order to help us improve your experience. The data collected by Microsoft is anonymous. You can opt-out of telemetry by re-running bootstrap-vcpkg.bat with -disableMetrics. Read more about vcpkg telemetry at docs/about/privacy.md "@ diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 4ebe970f6a..0af6b37ff7 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -265,6 +265,6 @@ cp "$buildDir/vcpkg" "$vcpkgRootDir/" echo "Telemetry" echo "---------" -echo "vcpkg collects usage data in order to help us improve your experience. The data collected by Microsoft is anonymous. You can opt-out of telemetry by adding -disableMetrics after the bootstrap-vcpkg.sh script." +echo "vcpkg collects usage data in order to help us improve your experience. The data collected by Microsoft is anonymous. You can opt-out of telemetry by re-running bootstrap-vcpkg.sh with -disableMetrics" echo "Read more about vcpkg telemetry at docs/about/privacy.md" echo "" \ No newline at end of file diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index c606594af6..2037e8d263 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -584,7 +584,7 @@ namespace vcpkg::Build locked_metrics->track_buildtime(Hash::get_string_hash(spec.to_string(), Hash::Algorithm::Sha256) + ":[" + Strings::join(",", config.feature_list, - [](std::string feature) { + [](const std::string& feature) { return Hash::get_string_hash(feature, Hash::Algorithm::Sha256); }) + diff --git a/toolsrc/src/vcpkg/install.cpp b/toolsrc/src/vcpkg/install.cpp index d1c4a4b2d8..a082f1b952 100644 --- a/toolsrc/src/vcpkg/install.cpp +++ b/toolsrc/src/vcpkg/install.cpp @@ -697,7 +697,7 @@ namespace vcpkg::Install Checks::unreachable(VCPKG_LINE_INFO); }); - Metrics::g_metrics.lock()->track_property("installplan", specs_string); + Metrics::g_metrics.lock()->track_property("installplan_1", specs_string); Dependencies::print_plan(action_plan, is_recursive, paths.ports); diff --git a/toolsrc/src/vcpkg/metrics.cpp b/toolsrc/src/vcpkg/metrics.cpp index 7aaa852c30..b971d96da8 100644 --- a/toolsrc/src/vcpkg/metrics.cpp +++ b/toolsrc/src/vcpkg/metrics.cpp @@ -184,15 +184,9 @@ 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, - [](std::string buildname) { - return to_json_string(vcpkg::Hash::get_string_hash( - buildname, Hash::Algorithm::Sha256)); - }), - Strings::join(",", buildtime_times))); + props_plus_buildtimes.append(Strings::format(R"("buildnames_1": [%s], "buildtimes": [%s])", + Strings::join(",", buildtime_names, to_json_string), + Strings::join(",", buildtime_times))); } const std::string& session_id = get_session_id();