Commit e2bb0435 authored by Alan Cutter's avatar Alan Cutter Committed by Chromium LUCI CQ

Revert "Add WebApp.Preinstalled.UninstallAndReplaceCount UMA histogram"

This reverts commit 1ca3c153.

Reason for revert:
Needed to land parent CL revert: https://chromium-review.googlesource.com/c/chromium/src/+/2567511

Original change's description:
> Add WebApp.Preinstalled.UninstallAndReplaceCount UMA histogram
>
> This CL adds metrics for how often preinstalled web apps migrate and
> remove an existing app install.
>
> This data is useful to monitor rollouts of default web apps that are
> replacing old Chrome apps to ensure the migration is happening as
> expected.
>
> Bug: 809304, 1058265
> Change-Id: Ie9edb4a1cf89e84d7e56a20bad028dd8ea1aeb07
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2561999
> Commit-Queue: Alan Cutter <alancutter@chromium.org>
> Reviewed-by: Glen Robertson <glenrob@chromium.org>
> Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#832148}

TBR=rkaplow@chromium.org,alancutter@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com,glenrob@chromium.org

Change-Id: I46c1a678e09111d210d1385bdb17ecc4fcabb093
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 809304
Bug: 1058265
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2567056Reviewed-by: default avatarAlan Cutter <alancutter@chromium.org>
Commit-Queue: Alan Cutter <alancutter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832227}
parent eb48b753
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/json/json_file_value_serializer.h" #include "base/json/json_file_value_serializer.h"
#include "base/json/json_reader.h" #include "base/json/json_reader.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_functions.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
#include "base/path_service.h" #include "base/path_service.h"
#include "base/stl_util.h" #include "base/stl_util.h"
...@@ -142,8 +142,6 @@ const char* ExternalWebAppManager::kHistogramDisabledCount = ...@@ -142,8 +142,6 @@ const char* ExternalWebAppManager::kHistogramDisabledCount =
"WebApp.Preinstalled.DisabledCount"; "WebApp.Preinstalled.DisabledCount";
const char* ExternalWebAppManager::kHistogramConfigErrorCount = const char* ExternalWebAppManager::kHistogramConfigErrorCount =
"WebApp.Preinstalled.ConfigErrorCount"; "WebApp.Preinstalled.ConfigErrorCount";
const char* ExternalWebAppManager::kHistogramUninstallAndReplaceCount =
"WebApp.Preinstalled.UninstallAndReplaceCount";
void ExternalWebAppManager::RegisterProfilePrefs( void ExternalWebAppManager::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) { user_prefs::PrefRegistrySyncable* registry) {
...@@ -317,12 +315,12 @@ void ExternalWebAppManager::PostProcessConfigs(ConsumeInstallOptions callback, ...@@ -317,12 +315,12 @@ void ExternalWebAppManager::PostProcessConfigs(ConsumeInstallOptions callback,
return false; return false;
}); });
UMA_HISTOGRAM_COUNTS_100(ExternalWebAppManager::kHistogramEnabledCount, base::UmaHistogramCounts100(ExternalWebAppManager::kHistogramEnabledCount,
total_count - disabled_count); total_count - disabled_count);
UMA_HISTOGRAM_COUNTS_100(ExternalWebAppManager::kHistogramDisabledCount, base::UmaHistogramCounts100(ExternalWebAppManager::kHistogramDisabledCount,
disabled_count); disabled_count);
UMA_HISTOGRAM_COUNTS_100(ExternalWebAppManager::kHistogramConfigErrorCount, base::UmaHistogramCounts100(ExternalWebAppManager::kHistogramConfigErrorCount,
parsed_configs.error_count); parsed_configs.error_count);
std::move(callback).Run(std::move(parsed_configs.options_list)); std::move(callback).Run(std::move(parsed_configs.options_list));
} }
...@@ -349,16 +347,10 @@ void ExternalWebAppManager::OnExternalWebAppsSynchronized( ...@@ -349,16 +347,10 @@ void ExternalWebAppManager::OnExternalWebAppsSynchronized(
prefs::kWebAppsLastPreinstallSynchronizeVersion, prefs::kWebAppsLastPreinstallSynchronizeVersion,
version_info::GetMajorVersionNumber()); version_info::GetMajorVersionNumber());
size_t uninstall_and_replace_count = 0;
for (const auto& url_and_result : install_results) { for (const auto& url_and_result : install_results) {
UMA_HISTOGRAM_ENUMERATION("Webapp.InstallResult.Default", base::UmaHistogramEnumeration("Webapp.InstallResult.Default",
url_and_result.second.code); url_and_result.second.code);
if (url_and_result.second.did_uninstall_and_replace)
++uninstall_and_replace_count;
} }
UMA_HISTOGRAM_COUNTS_100(
ExternalWebAppManager::kHistogramUninstallAndReplaceCount,
uninstall_and_replace_count);
if (callback) { if (callback) {
std::move(callback).Run(std::move(install_results), std::move(callback).Run(std::move(install_results),
......
...@@ -48,7 +48,6 @@ class ExternalWebAppManager { ...@@ -48,7 +48,6 @@ class ExternalWebAppManager {
static const char* kHistogramEnabledCount; static const char* kHistogramEnabledCount;
static const char* kHistogramDisabledCount; static const char* kHistogramDisabledCount;
static const char* kHistogramConfigErrorCount; static const char* kHistogramConfigErrorCount;
static const char* kHistogramUninstallAndReplaceCount;
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
......
...@@ -246,7 +246,6 @@ IN_PROC_BROWSER_TEST_F(ExternalWebAppMigrationBrowserTest, ...@@ -246,7 +246,6 @@ IN_PROC_BROWSER_TEST_F(ExternalWebAppMigrationBrowserTest,
EXPECT_TRUE(IsExtensionAppInstalled()); EXPECT_TRUE(IsExtensionAppInstalled());
{ {
base::HistogramTester histograms;
extensions::TestExtensionRegistryObserver uninstall_observer( extensions::TestExtensionRegistryObserver uninstall_observer(
extensions::ExtensionRegistry::Get(profile())); extensions::ExtensionRegistry::Get(profile()));
...@@ -257,8 +256,6 @@ IN_PROC_BROWSER_TEST_F(ExternalWebAppMigrationBrowserTest, ...@@ -257,8 +256,6 @@ IN_PROC_BROWSER_TEST_F(ExternalWebAppMigrationBrowserTest,
uninstall_observer.WaitForExtensionUninstalled(); uninstall_observer.WaitForExtensionUninstalled();
EXPECT_EQ(uninstalled_app->id(), kExtensionId); EXPECT_EQ(uninstalled_app->id(), kExtensionId);
EXPECT_FALSE(IsExtensionAppInstalled()); EXPECT_FALSE(IsExtensionAppInstalled());
histograms.ExpectUniqueSample(
ExternalWebAppManager::kHistogramUninstallAndReplaceCount, 1, 1);
} }
} }
...@@ -275,7 +272,6 @@ IN_PROC_BROWSER_TEST_F(ExternalWebAppMigrationBrowserTest, ...@@ -275,7 +272,6 @@ IN_PROC_BROWSER_TEST_F(ExternalWebAppMigrationBrowserTest,
// Re-run migration. // Re-run migration.
{ {
base::HistogramTester histograms;
base::AutoReset<bool> testing_scope = base::AutoReset<bool> testing_scope =
SetExternalAppInstallFeatureAlwaysEnabledForTesting(); SetExternalAppInstallFeatureAlwaysEnabledForTesting();
ASSERT_TRUE(IsExternalAppInstallFeatureEnabled(kMigrationFlag)); ASSERT_TRUE(IsExternalAppInstallFeatureEnabled(kMigrationFlag));
...@@ -290,8 +286,6 @@ IN_PROC_BROWSER_TEST_F(ExternalWebAppMigrationBrowserTest, ...@@ -290,8 +286,6 @@ IN_PROC_BROWSER_TEST_F(ExternalWebAppMigrationBrowserTest,
uninstall_observer.WaitForExtensionUninstalled(); uninstall_observer.WaitForExtensionUninstalled();
EXPECT_EQ(uninstalled_app->id(), kExtensionId); EXPECT_EQ(uninstalled_app->id(), kExtensionId);
EXPECT_FALSE(IsExtensionAppInstalled()); EXPECT_FALSE(IsExtensionAppInstalled());
histograms.ExpectUniqueSample(
ExternalWebAppManager::kHistogramUninstallAndReplaceCount, 1, 1);
} }
} }
...@@ -347,7 +341,6 @@ IN_PROC_BROWSER_TEST_F(ExternalWebAppMigrationBrowserTest, MigratePreferences) { ...@@ -347,7 +341,6 @@ IN_PROC_BROWSER_TEST_F(ExternalWebAppMigrationBrowserTest, MigratePreferences) {
EXPECT_TRUE(IsExtensionAppInstalled()); EXPECT_TRUE(IsExtensionAppInstalled());
{ {
base::HistogramTester histograms;
extensions::TestExtensionRegistryObserver uninstall_observer( extensions::TestExtensionRegistryObserver uninstall_observer(
extensions::ExtensionRegistry::Get(profile())); extensions::ExtensionRegistry::Get(profile()));
...@@ -358,8 +351,6 @@ IN_PROC_BROWSER_TEST_F(ExternalWebAppMigrationBrowserTest, MigratePreferences) { ...@@ -358,8 +351,6 @@ IN_PROC_BROWSER_TEST_F(ExternalWebAppMigrationBrowserTest, MigratePreferences) {
uninstall_observer.WaitForExtensionUninstalled(); uninstall_observer.WaitForExtensionUninstalled();
EXPECT_EQ(uninstalled_app->id(), kExtensionId); EXPECT_EQ(uninstalled_app->id(), kExtensionId);
EXPECT_FALSE(IsExtensionAppInstalled()); EXPECT_FALSE(IsExtensionAppInstalled());
histograms.ExpectUniqueSample(
ExternalWebAppManager::kHistogramUninstallAndReplaceCount, 1, 1);
} }
} }
...@@ -503,8 +494,6 @@ IN_PROC_BROWSER_TEST_F(ExternalWebAppMigrationBrowserTest, ...@@ -503,8 +494,6 @@ IN_PROC_BROWSER_TEST_F(ExternalWebAppMigrationBrowserTest,
ExternalWebAppManager::kHistogramDisabledCount, 0, 1); ExternalWebAppManager::kHistogramDisabledCount, 0, 1);
histograms.ExpectUniqueSample( histograms.ExpectUniqueSample(
ExternalWebAppManager::kHistogramConfigErrorCount, 0, 1); ExternalWebAppManager::kHistogramConfigErrorCount, 0, 1);
histograms.ExpectUniqueSample(
ExternalWebAppManager::kHistogramUninstallAndReplaceCount, 1, 1);
} }
} }
} }
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/callback.h" #include "base/callback.h"
#include "base/callback_helpers.h" #include "base/callback_helpers.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/favicon/favicon_utils.h" #include "chrome/browser/favicon/favicon_utils.h"
......
...@@ -16984,17 +16984,6 @@ regressions. --> ...@@ -16984,17 +16984,6 @@ regressions. -->
</summary> </summary>
</histogram> </histogram>
<histogram name="WebApp.Preinstalled.UninstallAndReplaceCount" units="apps"
expires_after="2021-04-01">
<owner>alancutter@chromium.org</owner>
<owner>desktop-pwas-team@google.com</owner>
<summary>
Records how many preinstalled web app installations uninstalled and replaced
an old default app (web app or Chrome app). This corresponds to the
&quot;uninstall_and_replace&quot; field in preinstalled web app configs.
</summary>
</histogram>
<histogram name="WebApp.Shortcuts.Creation.Result" <histogram name="WebApp.Shortcuts.Creation.Result"
enum="ShortcutsCreationResult" expires_after="M93"> enum="ShortcutsCreationResult" expires_after="M93">
<owner>phillis@chromium.org</owner> <owner>phillis@chromium.org</owner>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment