Commit 33a35e22 authored by Brian White's avatar Brian White Committed by Commit Bot

Remove unused Profile.AuthResult histogram.

Also converted all other calls from macros to functions which is the
recommended method for any histogram emitted more than 1 per second
or so.

Bug: 1053105
Change-Id: Id9af6e33098de961f5e8cebf334615a12a0602e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2108802
Commit-Queue: Brian White <bcwhite@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751993}
parent e10fd0ab
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_functions.h"
#include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
...@@ -202,10 +202,10 @@ void ProfileMetrics::LogNumberOfProfiles(ProfileAttributesStorage* storage) { ...@@ -202,10 +202,10 @@ void ProfileMetrics::LogNumberOfProfiles(ProfileAttributesStorage* storage) {
void ProfileMetrics::LogProfileAddNewUser(ProfileAdd metric) { void ProfileMetrics::LogProfileAddNewUser(ProfileAdd metric) {
DCHECK(metric < NUM_PROFILE_ADD_METRICS); DCHECK(metric < NUM_PROFILE_ADD_METRICS);
UMA_HISTOGRAM_ENUMERATION("Profile.AddNewUser", metric, base::UmaHistogramEnumeration("Profile.AddNewUser", metric,
NUM_PROFILE_ADD_METRICS); NUM_PROFILE_ADD_METRICS);
UMA_HISTOGRAM_ENUMERATION("Profile.NetUserCount", base::UmaHistogramEnumeration("Profile.NetUserCount",
ProfileNetUserCounts::ADD_NEW_USER); ProfileNetUserCounts::ADD_NEW_USER);
} }
void ProfileMetrics::LogProfileAvatarSelection(size_t icon_index) { void ProfileMetrics::LogProfileAvatarSelection(size_t icon_index) {
...@@ -386,51 +386,46 @@ void ProfileMetrics::LogProfileAvatarSelection(size_t icon_index) { ...@@ -386,51 +386,46 @@ void ProfileMetrics::LogProfileAvatarSelection(size_t icon_index) {
default: default:
NOTREACHED(); NOTREACHED();
} }
UMA_HISTOGRAM_ENUMERATION("Profile.Avatar", icon_name, base::UmaHistogramEnumeration("Profile.Avatar", icon_name,
NUM_PROFILE_AVATAR_METRICS); NUM_PROFILE_AVATAR_METRICS);
} }
void ProfileMetrics::LogProfileDeleteUser(ProfileDelete metric) { void ProfileMetrics::LogProfileDeleteUser(ProfileDelete metric) {
DCHECK(metric < NUM_DELETE_PROFILE_METRICS); DCHECK(metric < NUM_DELETE_PROFILE_METRICS);
UMA_HISTOGRAM_ENUMERATION("Profile.DeleteProfileAction", metric, base::UmaHistogramEnumeration("Profile.DeleteProfileAction", metric,
NUM_DELETE_PROFILE_METRICS); NUM_DELETE_PROFILE_METRICS);
if (metric != DELETE_PROFILE_USER_MANAGER_SHOW_WARNING && if (metric != DELETE_PROFILE_USER_MANAGER_SHOW_WARNING &&
metric != DELETE_PROFILE_SETTINGS_SHOW_WARNING && metric != DELETE_PROFILE_SETTINGS_SHOW_WARNING &&
metric != DELETE_PROFILE_ABORTED) { metric != DELETE_PROFILE_ABORTED) {
// If a user was actually deleted, update the net user count. // If a user was actually deleted, update the net user count.
UMA_HISTOGRAM_ENUMERATION("Profile.NetUserCount", base::UmaHistogramEnumeration("Profile.NetUserCount",
ProfileNetUserCounts::PROFILE_DELETED); ProfileNetUserCounts::PROFILE_DELETED);
} }
} }
void ProfileMetrics::LogProfileSwitchGaia(ProfileGaia metric) { void ProfileMetrics::LogProfileSwitchGaia(ProfileGaia metric) {
if (metric == GAIA_OPT_IN) if (metric == GAIA_OPT_IN)
LogProfileAvatarSelection(SIZE_MAX); LogProfileAvatarSelection(SIZE_MAX);
UMA_HISTOGRAM_ENUMERATION("Profile.SwitchGaiaPhotoSettings", base::UmaHistogramEnumeration("Profile.SwitchGaiaPhotoSettings", metric,
metric, NUM_PROFILE_GAIA_METRICS);
NUM_PROFILE_GAIA_METRICS);
} }
void ProfileMetrics::LogProfileSyncInfo(ProfileSync metric) { void ProfileMetrics::LogProfileSyncInfo(ProfileSync metric) {
DCHECK(metric < NUM_PROFILE_SYNC_METRICS); DCHECK(metric < NUM_PROFILE_SYNC_METRICS);
UMA_HISTOGRAM_ENUMERATION("Profile.SyncCustomize", metric, base::UmaHistogramEnumeration("Profile.SyncCustomize", metric,
NUM_PROFILE_SYNC_METRICS); NUM_PROFILE_SYNC_METRICS);
}
void ProfileMetrics::LogProfileAuthResult(ProfileAuth metric) {
UMA_HISTOGRAM_ENUMERATION("Profile.AuthResult", metric,
NUM_PROFILE_AUTH_METRICS);
} }
void ProfileMetrics::LogProfileDelete(bool profile_was_signed_in) { void ProfileMetrics::LogProfileDelete(bool profile_was_signed_in) {
UMA_HISTOGRAM_BOOLEAN("Profile.Delete", profile_was_signed_in); base::UmaHistogramBoolean("Profile.Delete", profile_was_signed_in);
} }
void ProfileMetrics::LogTimeToOpenUserManager( void ProfileMetrics::LogTimeToOpenUserManager(
const base::TimeDelta& time_to_open) { const base::TimeDelta& time_to_open) {
UMA_HISTOGRAM_CUSTOM_TIMES("Profile.TimeToOpenUserManagerUpTo1min", base::UmaHistogramCustomTimes("Profile.TimeToOpenUserManagerUpTo1min",
time_to_open, base::TimeDelta::FromMilliseconds(1), time_to_open,
base::TimeDelta::FromMinutes(1), 50); base::TimeDelta::FromMilliseconds(1),
base::TimeDelta::FromMinutes(1), 50);
} }
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
...@@ -438,43 +433,37 @@ void ProfileMetrics::LogProfileAndroidAccountManagementMenu( ...@@ -438,43 +433,37 @@ void ProfileMetrics::LogProfileAndroidAccountManagementMenu(
ProfileAndroidAccountManagementMenu metric, ProfileAndroidAccountManagementMenu metric,
signin::GAIAServiceType gaia_service) { signin::GAIAServiceType gaia_service) {
// The first parameter to the histogram needs to be literal, because of the // The first parameter to the histogram needs to be literal, because of the
// optimized implementation of |UMA_HISTOGRAM_ENUMERATION|. Do not attempt // optimized implementation of |base::UmaHistogramEnumeration|. Do not attempt
// to refactor. // to refactor.
switch (gaia_service) { switch (gaia_service) {
case signin::GAIA_SERVICE_TYPE_NONE: case signin::GAIA_SERVICE_TYPE_NONE:
UMA_HISTOGRAM_ENUMERATION( base::UmaHistogramEnumeration(
"Profile.AndroidAccountManagementMenu.NonGAIA", "Profile.AndroidAccountManagementMenu.NonGAIA", metric,
metric,
NUM_PROFILE_ANDROID_ACCOUNT_MANAGEMENT_MENU_METRICS); NUM_PROFILE_ANDROID_ACCOUNT_MANAGEMENT_MENU_METRICS);
break; break;
case signin::GAIA_SERVICE_TYPE_SIGNOUT: case signin::GAIA_SERVICE_TYPE_SIGNOUT:
UMA_HISTOGRAM_ENUMERATION( base::UmaHistogramEnumeration(
"Profile.AndroidAccountManagementMenu.GAIASignout", "Profile.AndroidAccountManagementMenu.GAIASignout", metric,
metric,
NUM_PROFILE_ANDROID_ACCOUNT_MANAGEMENT_MENU_METRICS); NUM_PROFILE_ANDROID_ACCOUNT_MANAGEMENT_MENU_METRICS);
break; break;
case signin::GAIA_SERVICE_TYPE_INCOGNITO: case signin::GAIA_SERVICE_TYPE_INCOGNITO:
UMA_HISTOGRAM_ENUMERATION( base::UmaHistogramEnumeration(
"Profile.AndroidAccountManagementMenu.GAIASignoutIncognito", "Profile.AndroidAccountManagementMenu.GAIASignoutIncognito", metric,
metric,
NUM_PROFILE_ANDROID_ACCOUNT_MANAGEMENT_MENU_METRICS); NUM_PROFILE_ANDROID_ACCOUNT_MANAGEMENT_MENU_METRICS);
break; break;
case signin::GAIA_SERVICE_TYPE_ADDSESSION: case signin::GAIA_SERVICE_TYPE_ADDSESSION:
UMA_HISTOGRAM_ENUMERATION( base::UmaHistogramEnumeration(
"Profile.AndroidAccountManagementMenu.GAIAAddSession", "Profile.AndroidAccountManagementMenu.GAIAAddSession", metric,
metric,
NUM_PROFILE_ANDROID_ACCOUNT_MANAGEMENT_MENU_METRICS); NUM_PROFILE_ANDROID_ACCOUNT_MANAGEMENT_MENU_METRICS);
break; break;
case signin::GAIA_SERVICE_TYPE_SIGNUP: case signin::GAIA_SERVICE_TYPE_SIGNUP:
UMA_HISTOGRAM_ENUMERATION( base::UmaHistogramEnumeration(
"Profile.AndroidAccountManagementMenu.GAIASignup", "Profile.AndroidAccountManagementMenu.GAIASignup", metric,
metric,
NUM_PROFILE_ANDROID_ACCOUNT_MANAGEMENT_MENU_METRICS); NUM_PROFILE_ANDROID_ACCOUNT_MANAGEMENT_MENU_METRICS);
break; break;
case signin::GAIA_SERVICE_TYPE_DEFAULT: case signin::GAIA_SERVICE_TYPE_DEFAULT:
UMA_HISTOGRAM_ENUMERATION( base::UmaHistogramEnumeration(
"Profile.AndroidAccountManagementMenu.GAIADefault", "Profile.AndroidAccountManagementMenu.GAIADefault", metric,
metric,
NUM_PROFILE_ANDROID_ACCOUNT_MANAGEMENT_MENU_METRICS); NUM_PROFILE_ANDROID_ACCOUNT_MANAGEMENT_MENU_METRICS);
break; break;
} }
...@@ -489,5 +478,5 @@ void ProfileMetrics::LogProfileLaunch(Profile* profile) { ...@@ -489,5 +478,5 @@ void ProfileMetrics::LogProfileLaunch(Profile* profile) {
} }
void ProfileMetrics::LogProfileUpdate(const base::FilePath& profile_path) { void ProfileMetrics::LogProfileUpdate(const base::FilePath& profile_path) {
UMA_HISTOGRAM_ENUMERATION("Profile.Update", GetProfileType(profile_path)); base::UmaHistogramEnumeration("Profile.Update", GetProfileType(profile_path));
} }
...@@ -140,7 +140,6 @@ class ProfileMetrics { ...@@ -140,7 +140,6 @@ class ProfileMetrics {
static void LogProfileDeleteUser(ProfileDelete metric); static void LogProfileDeleteUser(ProfileDelete metric);
static void LogProfileSwitchGaia(ProfileGaia metric); static void LogProfileSwitchGaia(ProfileGaia metric);
static void LogProfileSyncInfo(ProfileSync metric); static void LogProfileSyncInfo(ProfileSync metric);
static void LogProfileAuthResult(ProfileAuth metric);
static void LogProfileDelete(bool profile_was_signed_in); static void LogProfileDelete(bool profile_was_signed_in);
static void LogTimeToOpenUserManager(const base::TimeDelta& time_to_open); static void LogTimeToOpenUserManager(const base::TimeDelta& time_to_open);
......
...@@ -484,7 +484,6 @@ void UserManagerScreenHandler::HandleLaunchUser(const base::ListValue* args) { ...@@ -484,7 +484,6 @@ void UserManagerScreenHandler::HandleLaunchUser(const base::ListValue* args) {
// not needing authentication. If it is, just ignore the "launch" request. // not needing authentication. If it is, just ignore the "launch" request.
if (entry->IsSigninRequired()) if (entry->IsSigninRequired())
return; return;
ProfileMetrics::LogProfileAuthResult(ProfileMetrics::AUTH_UNNECESSARY);
profiles::SwitchToProfile( profiles::SwitchToProfile(
profile_path, false, /* reuse any existing windows */ profile_path, false, /* reuse any existing windows */
...@@ -833,7 +832,6 @@ void UserManagerScreenHandler::SendUserList() { ...@@ -833,7 +832,6 @@ void UserManagerScreenHandler::SendUserList() {
void UserManagerScreenHandler::ReportAuthenticationResult( void UserManagerScreenHandler::ReportAuthenticationResult(
bool success, bool success,
ProfileMetrics::ProfileAuth auth) { ProfileMetrics::ProfileAuth auth) {
ProfileMetrics::LogProfileAuthResult(auth);
email_address_.clear(); email_address_.clear();
if (success) { if (success) {
......
...@@ -127511,6 +127511,10 @@ uploading your change for review. ...@@ -127511,6 +127511,10 @@ uploading your change for review.
</histogram> </histogram>
<histogram name="Profile.AuthResult" enum="ProfileAuth" expires_after="M82"> <histogram name="Profile.AuthResult" enum="ProfileAuth" expires_after="M82">
<obsolete>
Not accessed in months. All results say &quot;authentication was
unnecessary&quot;. Removed 2020-03.
</obsolete>
<owner>bcwhite@chromium.org</owner> <owner>bcwhite@chromium.org</owner>
<summary> <summary>
Counts of authorization results when trying to open a locked profile from Counts of authorization results when trying to open a locked profile from
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