Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: chrome/browser/profiles/profile_metrics.cc

Issue 8520024: Updating the UMA metrics for profiles to make them more readable. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/profiles/profile_metrics.h" 5 #include "chrome/browser/profiles/profile_metrics.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 19 matching lines...) Expand all
30 } 30 }
31 31
32 } // namespace 32 } // namespace
33 33
34 void ProfileMetrics::LogProfileAvatarSelection(size_t icon_index) { 34 void ProfileMetrics::LogProfileAvatarSelection(size_t icon_index) {
35 DCHECK(icon_index < NUM_PROFILE_AVATAR_METRICS); 35 DCHECK(icon_index < NUM_PROFILE_AVATAR_METRICS);
36 ProfileAvatar icon_name; 36 ProfileAvatar icon_name;
37 switch (icon_index) { 37 switch (icon_index) {
38 case 0: 38 case 0:
39 icon_name = AVATAR_GENERIC; 39 icon_name = AVATAR_GENERIC;
40 break;
40 case 1: 41 case 1:
41 icon_name = AVATAR_GENERIC_AQUA; 42 icon_name = AVATAR_GENERIC_AQUA;
43 break;
42 case 2: 44 case 2:
43 icon_name = AVATAR_GENERIC_BLUE; 45 icon_name = AVATAR_GENERIC_BLUE;
46 break;
44 case 3: 47 case 3:
45 icon_name = AVATAR_GENERIC_GREEN; 48 icon_name = AVATAR_GENERIC_GREEN;
49 break;
46 case 4: 50 case 4:
47 icon_name = AVATAR_GENERIC_ORANGE; 51 icon_name = AVATAR_GENERIC_ORANGE;
52 break;
48 case 5: 53 case 5:
49 icon_name = AVATAR_GENERIC_PURPLE; 54 icon_name = AVATAR_GENERIC_PURPLE;
55 break;
50 case 6: 56 case 6:
51 icon_name = AVATAR_GENERIC_RED; 57 icon_name = AVATAR_GENERIC_RED;
58 break;
52 case 7: 59 case 7:
53 icon_name = AVATAR_GENERIC_YELLOW; 60 icon_name = AVATAR_GENERIC_YELLOW;
61 break;
54 case 8: 62 case 8:
55 icon_name = AVATAR_SECRET_AGENT; 63 icon_name = AVATAR_SECRET_AGENT;
64 break;
56 case 9: 65 case 9:
57 icon_name = AVATAR_SUPERHERO; 66 icon_name = AVATAR_SUPERHERO;
67 break;
58 case 10: 68 case 10:
59 icon_name = AVATAR_VOLLEYBALL; 69 icon_name = AVATAR_VOLLEYBALL;
70 break;
60 case 11: 71 case 11:
61 icon_name = AVATAR_BUSINESSMAN; 72 icon_name = AVATAR_BUSINESSMAN;
73 break;
62 case 12: 74 case 12:
63 icon_name = AVATAR_NINJA; 75 icon_name = AVATAR_NINJA;
76 break;
64 case 13: 77 case 13:
65 icon_name = AVATAR_ALIEN; 78 icon_name = AVATAR_ALIEN;
79 break;
66 case 14: 80 case 14:
67 icon_name = AVATAR_AWESOME; 81 icon_name = AVATAR_AWESOME;
82 break;
68 case 15: 83 case 15:
69 icon_name = AVATAR_FLOWER; 84 icon_name = AVATAR_FLOWER;
85 break;
70 case 16: 86 case 16:
71 icon_name = AVATAR_PIZZA; 87 icon_name = AVATAR_PIZZA;
88 break;
72 case 17: 89 case 17:
73 icon_name = AVATAR_SOCCER; 90 icon_name = AVATAR_SOCCER;
91 break;
74 case 18: 92 case 18:
75 icon_name = AVATAR_BURGER; 93 icon_name = AVATAR_BURGER;
94 break;
76 case 19: 95 case 19:
77 icon_name = AVATAR_CAT; 96 icon_name = AVATAR_CAT;
97 break;
78 case 20: 98 case 20:
79 icon_name = AVATAR_CUPCAKE; 99 icon_name = AVATAR_CUPCAKE;
100 break;
80 case 21: 101 case 21:
81 icon_name = AVATAR_DOG; 102 icon_name = AVATAR_DOG;
103 break;
82 case 22: 104 case 22:
83 icon_name = AVATAR_HORSE; 105 icon_name = AVATAR_HORSE;
106 break;
84 case 23: 107 case 23:
85 icon_name = AVATAR_MARGARITA; 108 icon_name = AVATAR_MARGARITA;
109 break;
86 case 24: 110 case 24:
87 icon_name = AVATAR_NOTE; 111 icon_name = AVATAR_NOTE;
112 break;
88 case 25: 113 case 25:
89 icon_name = AVATAR_SUN_CLOUD; 114 icon_name = AVATAR_SUN_CLOUD;
115 break;
90 default: // We should never actually get here, but just in case 116 default: // We should never actually get here, but just in case
91 icon_name = AVATAR_UNKNOWN; 117 icon_name = AVATAR_UNKNOWN;
118 break;
92 } 119 }
93 UMA_HISTOGRAM_ENUMERATION("Profile.Avatar", icon_name, 120 UMA_HISTOGRAM_ENUMERATION("Profile.Avatar", icon_name,
94 NUM_PROFILE_AVATAR_METRICS); 121 NUM_PROFILE_AVATAR_METRICS);
95 } 122 }
96 123
97 void ProfileMetrics::LogProfileOpenMethod(ProfileOpen metric) { 124 void ProfileMetrics::LogProfileOpenMethod(ProfileOpen metric) {
98 DCHECK(metric < NUM_PROFILE_OPEN_METRICS); 125 DCHECK(metric < NUM_PROFILE_OPEN_METRICS);
99 UMA_HISTOGRAM_ENUMERATION("Profile.Opening", metric, 126 UMA_HISTOGRAM_ENUMERATION("Profile.OpenUser", metric,
Ilya Sherman 2011/11/16 03:29:19 nit: Perhaps "Profile.OpenMethod" rather than "Pro
rpetterson 2011/11/16 22:46:25 Done.
100 NUM_PROFILE_OPEN_METRICS); 127 NUM_PROFILE_OPEN_METRICS);
101 } 128 }
102 129
130 void ProfileMetrics::LogProfileAddNewUser(ProfileAdd metric) {
131 DCHECK(metric < NUM_PROFILE_ADD_METRICS);
132 UMA_HISTOGRAM_ENUMERATION("Profile.AddNewUser", metric,
133 NUM_PROFILE_ADD_METRICS);
134 UMA_HISTOGRAM_ENUMERATION("Profile.NetUserCount", ADD_NEW_USER,
135 NUM_PROFILE_NET_METRICS);
136 }
137
138 void ProfileMetrics::LogProfileSwitchUser(ProfileSwitch metric) {
139 DCHECK(metric < NUM_PROFILE_SWITCH_METRICS);
140 UMA_HISTOGRAM_ENUMERATION("Profile.SwitchUser", metric,
141 NUM_PROFILE_SWITCH_METRICS);
142 }
143
144 void ProfileMetrics::LogProfileDeleteUser(ProfileNetUserCounts metric) {
145 DCHECK(metric < NUM_PROFILE_NET_METRICS);
146 UMA_HISTOGRAM_ENUMERATION("Profile.NetUserCount", metric,
147 NUM_PROFILE_NET_METRICS);
148 }
149
103 void ProfileMetrics::LogProfileSyncInfo(ProfileSync metric) { 150 void ProfileMetrics::LogProfileSyncInfo(ProfileSync metric) {
104 DCHECK(metric < NUM_PROFILE_SYNC_METRICS); 151 DCHECK(metric < NUM_PROFILE_SYNC_METRICS);
105 UMA_HISTOGRAM_ENUMERATION("Profile.Sync", metric, 152 UMA_HISTOGRAM_ENUMERATION("Profile.Sync", metric,
106 NUM_PROFILE_SYNC_METRICS); 153 NUM_PROFILE_SYNC_METRICS);
107 } 154 }
108 155
109 void ProfileMetrics::LogProfileUpdate(FilePath& profile_path) { 156 void ProfileMetrics::LogProfileUpdate(FilePath& profile_path) {
110 UMA_HISTOGRAM_ENUMERATION("Profile.Update", 157 UMA_HISTOGRAM_ENUMERATION("Profile.Update",
111 GetProfileType(profile_path), 158 GetProfileType(profile_path),
112 NUM_PROFILE_TYPE_METRICS); 159 NUM_PROFILE_TYPE_METRICS);
113 } 160 }
114 161
115 void ProfileMetrics::LogProfileSyncSignIn(FilePath& profile_path) { 162 void ProfileMetrics::LogProfileSyncSignIn(FilePath& profile_path) {
116 ProfileSync metric = SYNC_SIGN_IN_ORIGINAL; 163 UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn",
117 if (GetProfileType(profile_path) == SECONDARY) { 164 GetProfileType(profile_path),
118 metric = SYNC_SIGN_IN_SECONDARY; 165 NUM_PROFILE_TYPE_METRICS);
119 }
120 UMA_HISTOGRAM_ENUMERATION("Profile.Sync", SYNC_SIGN_IN,
121 NUM_PROFILE_SYNC_METRICS);
122 UMA_HISTOGRAM_ENUMERATION("Profile.Sync", metric,
123 NUM_PROFILE_SYNC_METRICS);
124 } 166 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698