Chromium Code Reviews| Index: chrome/browser/profiles/profile_metrics.cc |
| =================================================================== |
| --- chrome/browser/profiles/profile_metrics.cc (revision 113419) |
| +++ chrome/browser/profiles/profile_metrics.cc (working copy) |
| @@ -31,6 +31,9 @@ |
| } // namespace |
| +// Anything above 20 is lumped together as one metric. |
| +const size_t kMaxNumberOfProfilesTracked = 21; |
| + |
| enum ProfileAvatar { |
| AVATAR_GENERIC = 0, // The names for avatar icons |
| AVATAR_GENERIC_AQUA, |
| @@ -207,3 +210,26 @@ |
| metric, |
| NUM_PROFILE_GAIA_METRICS); |
| } |
| + |
| +void ProfileMetrics::LogProfileLaunch(FilePath& profile_path) { |
| + UMA_HISTOGRAM_ENUMERATION("Profile.LaunchBrowser", |
| + GetProfileType(profile_path), |
| + NUM_PROFILE_TYPE_METRICS); |
| +} |
| + |
| +void ProfileMetrics::LogNumberOfProfiles(bool startup) { |
| + ProfileManager* manager = g_browser_process->profile_manager(); |
| + size_t number_of_profiles = |
| + manager->GetProfileInfoCache().GetNumberOfProfiles(); |
| + if (number_of_profiles > kMaxNumberOfProfilesTracked) |
| + number_of_profiles = kMaxNumberOfProfilesTracked; |
|
Ilya Sherman
2011/12/09 00:53:41
There shouldn't be any need to do this -- the last
rpetterson
2011/12/09 01:44:35
Cool. Done.
|
| + if (startup) { |
| + UMA_HISTOGRAM_ENUMERATION("Profile.NumberOfProfilesOnStartup", |
| + number_of_profiles, |
| + NUM_PROFILE_TYPE_METRICS); |
|
Ilya Sherman
2011/12/09 00:53:41
I think you want UMA_HISTOGRAM_COUNTS_100 (or some
rpetterson
2011/12/09 01:44:35
Done.
|
| + } else { |
| + UMA_HISTOGRAM_ENUMERATION("Profile.NumberOfProfilesOnAddDelete", |
|
Ilya Sherman
2011/12/09 00:53:41
ditto
rpetterson
2011/12/09 01:44:35
Done.
|
| + number_of_profiles, |
| + NUM_PROFILE_TYPE_METRICS); |
| + } |
| +} |