Commit 28a195e3 authored by rlp@chromium.org's avatar rlp@chromium.org

Updating the UMA metrics for profiles to make them more readable.

BUG=93825
TEST=none

Review URL: http://codereview.chromium.org/8520024

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110414 0039d316-1c4b-4281-b951-d872f2087c98
parent eb04cd03
...@@ -83,7 +83,7 @@ void AvatarMenuModel::SwitchToProfile(size_t index) { ...@@ -83,7 +83,7 @@ void AvatarMenuModel::SwitchToProfile(size_t index) {
ProfileSwitchObserver* observer = new ProfileSwitchObserver(); ProfileSwitchObserver* observer = new ProfileSwitchObserver();
g_browser_process->profile_manager()->CreateProfileAsync( g_browser_process->profile_manager()->CreateProfileAsync(
path, observer); path, observer);
ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::SWITCH_PROFILE_ICON); ProfileMetrics::LogProfileSwitchUser(ProfileMetrics::SWITCH_PROFILE_ICON);
} }
void AvatarMenuModel::EditProfile(size_t index) { void AvatarMenuModel::EditProfile(size_t index) {
...@@ -101,8 +101,7 @@ void AvatarMenuModel::EditProfile(size_t index) { ...@@ -101,8 +101,7 @@ void AvatarMenuModel::EditProfile(size_t index) {
void AvatarMenuModel::AddNewProfile() { void AvatarMenuModel::AddNewProfile() {
ProfileManager::CreateMultiProfileAsync(); ProfileManager::CreateMultiProfileAsync();
ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ADD_NEW_USER); ProfileMetrics::LogProfileAddNewUser(ProfileMetrics::ADD_NEW_USER_ICON);
ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ADD_NEW_USER_ICON);
} }
size_t AvatarMenuModel::GetNumberOfItems() { size_t AvatarMenuModel::GetNumberOfItems() {
......
...@@ -37,58 +37,85 @@ void ProfileMetrics::LogProfileAvatarSelection(size_t icon_index) { ...@@ -37,58 +37,85 @@ void ProfileMetrics::LogProfileAvatarSelection(size_t icon_index) {
switch (icon_index) { switch (icon_index) {
case 0: case 0:
icon_name = AVATAR_GENERIC; icon_name = AVATAR_GENERIC;
break;
case 1: case 1:
icon_name = AVATAR_GENERIC_AQUA; icon_name = AVATAR_GENERIC_AQUA;
break;
case 2: case 2:
icon_name = AVATAR_GENERIC_BLUE; icon_name = AVATAR_GENERIC_BLUE;
break;
case 3: case 3:
icon_name = AVATAR_GENERIC_GREEN; icon_name = AVATAR_GENERIC_GREEN;
break;
case 4: case 4:
icon_name = AVATAR_GENERIC_ORANGE; icon_name = AVATAR_GENERIC_ORANGE;
break;
case 5: case 5:
icon_name = AVATAR_GENERIC_PURPLE; icon_name = AVATAR_GENERIC_PURPLE;
break;
case 6: case 6:
icon_name = AVATAR_GENERIC_RED; icon_name = AVATAR_GENERIC_RED;
break;
case 7: case 7:
icon_name = AVATAR_GENERIC_YELLOW; icon_name = AVATAR_GENERIC_YELLOW;
break;
case 8: case 8:
icon_name = AVATAR_SECRET_AGENT; icon_name = AVATAR_SECRET_AGENT;
break;
case 9: case 9:
icon_name = AVATAR_SUPERHERO; icon_name = AVATAR_SUPERHERO;
break;
case 10: case 10:
icon_name = AVATAR_VOLLEYBALL; icon_name = AVATAR_VOLLEYBALL;
break;
case 11: case 11:
icon_name = AVATAR_BUSINESSMAN; icon_name = AVATAR_BUSINESSMAN;
break;
case 12: case 12:
icon_name = AVATAR_NINJA; icon_name = AVATAR_NINJA;
break;
case 13: case 13:
icon_name = AVATAR_ALIEN; icon_name = AVATAR_ALIEN;
break;
case 14: case 14:
icon_name = AVATAR_AWESOME; icon_name = AVATAR_AWESOME;
break;
case 15: case 15:
icon_name = AVATAR_FLOWER; icon_name = AVATAR_FLOWER;
break;
case 16: case 16:
icon_name = AVATAR_PIZZA; icon_name = AVATAR_PIZZA;
break;
case 17: case 17:
icon_name = AVATAR_SOCCER; icon_name = AVATAR_SOCCER;
break;
case 18: case 18:
icon_name = AVATAR_BURGER; icon_name = AVATAR_BURGER;
break;
case 19: case 19:
icon_name = AVATAR_CAT; icon_name = AVATAR_CAT;
break;
case 20: case 20:
icon_name = AVATAR_CUPCAKE; icon_name = AVATAR_CUPCAKE;
break;
case 21: case 21:
icon_name = AVATAR_DOG; icon_name = AVATAR_DOG;
break;
case 22: case 22:
icon_name = AVATAR_HORSE; icon_name = AVATAR_HORSE;
break;
case 23: case 23:
icon_name = AVATAR_MARGARITA; icon_name = AVATAR_MARGARITA;
break;
case 24: case 24:
icon_name = AVATAR_NOTE; icon_name = AVATAR_NOTE;
break;
case 25: case 25:
icon_name = AVATAR_SUN_CLOUD; icon_name = AVATAR_SUN_CLOUD;
break;
default: // We should never actually get here, but just in case default: // We should never actually get here, but just in case
icon_name = AVATAR_UNKNOWN; icon_name = AVATAR_UNKNOWN;
break;
} }
UMA_HISTOGRAM_ENUMERATION("Profile.Avatar", icon_name, UMA_HISTOGRAM_ENUMERATION("Profile.Avatar", icon_name,
NUM_PROFILE_AVATAR_METRICS); NUM_PROFILE_AVATAR_METRICS);
...@@ -96,13 +123,33 @@ void ProfileMetrics::LogProfileAvatarSelection(size_t icon_index) { ...@@ -96,13 +123,33 @@ void ProfileMetrics::LogProfileAvatarSelection(size_t icon_index) {
void ProfileMetrics::LogProfileOpenMethod(ProfileOpen metric) { void ProfileMetrics::LogProfileOpenMethod(ProfileOpen metric) {
DCHECK(metric < NUM_PROFILE_OPEN_METRICS); DCHECK(metric < NUM_PROFILE_OPEN_METRICS);
UMA_HISTOGRAM_ENUMERATION("Profile.Opening", metric, UMA_HISTOGRAM_ENUMERATION("Profile.OpenMethod", metric,
NUM_PROFILE_OPEN_METRICS); NUM_PROFILE_OPEN_METRICS);
} }
void ProfileMetrics::LogProfileAddNewUser(ProfileAdd metric) {
DCHECK(metric < NUM_PROFILE_ADD_METRICS);
UMA_HISTOGRAM_ENUMERATION("Profile.AddNewUser", metric,
NUM_PROFILE_ADD_METRICS);
UMA_HISTOGRAM_ENUMERATION("Profile.NetUserCount", ADD_NEW_USER,
NUM_PROFILE_NET_METRICS);
}
void ProfileMetrics::LogProfileSwitchUser(ProfileOpen metric) {
DCHECK(metric < NUM_PROFILE_OPEN_METRICS);
UMA_HISTOGRAM_ENUMERATION("Profile.OpenMethod", metric,
NUM_PROFILE_OPEN_METRICS);
}
void ProfileMetrics::LogProfileDeleteUser(ProfileNetUserCounts metric) {
DCHECK(metric < NUM_PROFILE_NET_METRICS);
UMA_HISTOGRAM_ENUMERATION("Profile.NetUserCount", metric,
NUM_PROFILE_NET_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.Sync", metric, UMA_HISTOGRAM_ENUMERATION("Profile.SyncCustomize", metric,
NUM_PROFILE_SYNC_METRICS); NUM_PROFILE_SYNC_METRICS);
} }
...@@ -113,12 +160,7 @@ void ProfileMetrics::LogProfileUpdate(FilePath& profile_path) { ...@@ -113,12 +160,7 @@ void ProfileMetrics::LogProfileUpdate(FilePath& profile_path) {
} }
void ProfileMetrics::LogProfileSyncSignIn(FilePath& profile_path) { void ProfileMetrics::LogProfileSyncSignIn(FilePath& profile_path) {
ProfileSync metric = SYNC_SIGN_IN_ORIGINAL; UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn",
if (GetProfileType(profile_path) == SECONDARY) { GetProfileType(profile_path),
metric = SYNC_SIGN_IN_SECONDARY; NUM_PROFILE_TYPE_METRICS);
}
UMA_HISTOGRAM_ENUMERATION("Profile.Sync", SYNC_SIGN_IN,
NUM_PROFILE_SYNC_METRICS);
UMA_HISTOGRAM_ENUMERATION("Profile.Sync", metric,
NUM_PROFILE_SYNC_METRICS);
} }
...@@ -45,30 +45,38 @@ class ProfileMetrics { ...@@ -45,30 +45,38 @@ class ProfileMetrics {
NUM_PROFILE_AVATAR_METRICS NUM_PROFILE_AVATAR_METRICS
}; };
// Enum for counting the ways users were added.
enum ProfileAdd {
ADD_NEW_USER_ICON = 0, // User adds new user from icon menu
ADD_NEW_USER_MENU, // User adds new user from menu bar
NUM_PROFILE_ADD_METRICS
};
// Enum for counting the ways user profiles and menus were opened.
enum ProfileOpen { enum ProfileOpen {
ADD_NEW_USER = 0, // Total count of add new user NTP_AVATAR_BUBBLE = 0, // User opens avatar icon menu from NTP
ADD_NEW_USER_ICON, // User adds new user from icon menu ICON_AVATAR_BUBBLE, // User opens avatar icon menu from icon
ADD_NEW_USER_MENU, // User adds new user from menu bar SWITCH_PROFILE_ICON, // User switches profiles from icon menu
SWITCH_PROFILE_ICON, // User switches profiles from icon menu SWITCH_PROFILE_MENU, // User switches profiles from menu bar
SWITCH_PROFILE_MENU, // User switches profiles from menu bar
NTP_AVATAR_BUBBLE, // User opens avatar icon menu from NTP
ICON_AVATAR_BUBBLE, // User opens avatar icon menu from icon
PROFILE_DELETED, // User deleted a profile
NUM_PROFILE_OPEN_METRICS NUM_PROFILE_OPEN_METRICS
}; };
// Enum for getting net counts for adding and deleting users.
enum ProfileNetUserCounts {
ADD_NEW_USER = 0, // Total count of add new user
PROFILE_DELETED, // User deleted a profile
NUM_PROFILE_NET_METRICS
};
// Sign in is logged once the user has entered their GAIA information. // Sign in is logged once the user has entered their GAIA information.
// See sync_setup_flow.h. // See sync_setup_flow.h.
// The options for sync are logged after the user has submitted the options // The options for sync are logged after the user has submitted the options
// form. See sync_setup_handler.h. // form. See sync_setup_handler.h.
enum ProfileSync { enum ProfileSync {
SYNC_SIGN_IN = 0, // User signed into sync SYNC_CUSTOMIZE = 0, // User decided to customize sync
SYNC_SIGN_IN_ORIGINAL, // User signed into sync in original profile SYNC_CHOOSE, // User chose what to sync
SYNC_SIGN_IN_SECONDARY, // User signed into sync in secondary profile SYNC_ENCRYPT, // User has chosen to encrypt all data
SYNC_CUSTOMIZE, // User decided to customize sync SYNC_PASSPHRASE, // User is using a passphrase
SYNC_CHOOSE, // User chose what to sync
SYNC_ENCRYPT, // User has chosen to encrypt all data
SYNC_PASSPHRASE, // User is using a passphrase
NUM_PROFILE_SYNC_METRICS NUM_PROFILE_SYNC_METRICS
}; };
...@@ -80,6 +88,9 @@ class ProfileMetrics { ...@@ -80,6 +88,9 @@ class ProfileMetrics {
static void LogProfileAvatarSelection(size_t icon_index); static void LogProfileAvatarSelection(size_t icon_index);
static void LogProfileOpenMethod(ProfileOpen metric); static void LogProfileOpenMethod(ProfileOpen metric);
static void LogProfileAddNewUser(ProfileAdd metric);
static void LogProfileSwitchUser(ProfileOpen metric);
static void LogProfileDeleteUser(ProfileNetUserCounts metric);
static void LogProfileSyncInfo(ProfileSync metric); static void LogProfileSyncInfo(ProfileSync metric);
static void LogProfileUpdate(FilePath& profile_path); static void LogProfileUpdate(FilePath& profile_path);
static void LogProfileSyncSignIn(FilePath& profile_path); static void LogProfileSyncSignIn(FilePath& profile_path);
......
...@@ -82,7 +82,7 @@ class Observer : public BrowserList::Observer, ...@@ -82,7 +82,7 @@ class Observer : public BrowserList::Observer,
- (IBAction)switchToProfile:(id)sender { - (IBAction)switchToProfile:(id)sender {
model_->SwitchToProfile([sender tag]); model_->SwitchToProfile([sender tag]);
ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::SWITCH_PROFILE_MENU); ProfileMetrics::LogProfileSwitchUser(ProfileMetrics::SWITCH_PROFILE_MENU);
} }
- (IBAction)editProfile:(id)sender { - (IBAction)editProfile:(id)sender {
...@@ -91,8 +91,7 @@ class Observer : public BrowserList::Observer, ...@@ -91,8 +91,7 @@ class Observer : public BrowserList::Observer,
- (IBAction)newProfile:(id)sender { - (IBAction)newProfile:(id)sender {
model_->AddNewProfile(); model_->AddNewProfile();
ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ADD_NEW_USER); ProfileMetrics::LogProfileAddNewUser(ProfileMetrics::ADD_NEW_USER_MENU);
ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ADD_NEW_USER_MENU);
} }
// Private ///////////////////////////////////////////////////////////////////// // Private /////////////////////////////////////////////////////////////////////
......
...@@ -139,7 +139,7 @@ void ManageProfileHandler::SetProfileNameAndIcon(const ListValue* args) { ...@@ -139,7 +139,7 @@ void ManageProfileHandler::SetProfileNameAndIcon(const ListValue* args) {
void ManageProfileHandler::DeleteProfile(const ListValue* args) { void ManageProfileHandler::DeleteProfile(const ListValue* args) {
DCHECK(args); DCHECK(args);
ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::PROFILE_DELETED); ProfileMetrics::LogProfileDeleteUser(ProfileMetrics::PROFILE_DELETED);
Value* file_path_value; Value* file_path_value;
FilePath profile_file_path; FilePath profile_file_path;
......
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