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

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

Issue 12033021: Add UMA metrics and histograms for locally managed users. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 months 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 AVATAR_MARGARITA, 60 AVATAR_MARGARITA,
61 AVATAR_NOTE, 61 AVATAR_NOTE,
62 AVATAR_SUN_CLOUD, 62 AVATAR_SUN_CLOUD,
63 AVATAR_UNKNOWN, // 26 63 AVATAR_UNKNOWN, // 26
64 AVATAR_GAIA, // 27 64 AVATAR_GAIA, // 27
65 NUM_PROFILE_AVATAR_METRICS 65 NUM_PROFILE_AVATAR_METRICS
66 }; 66 };
67 67
68 void ProfileMetrics::LogNumberOfProfiles(ProfileManager* manager, 68 void ProfileMetrics::LogNumberOfProfiles(ProfileManager* manager,
69 ProfileEvent startup) { 69 ProfileEvent startup) {
70 size_t number_of_profiles = 70 const ProfileInfoCache& info_cache = manager->GetProfileInfoCache();
71 manager->GetProfileInfoCache().GetNumberOfProfiles(); 71 size_t number_of_profiles = info_cache.GetNumberOfProfiles();
72 if (startup == STARTUP_PROFILE_EVENT) { 72 if (startup == STARTUP_PROFILE_EVENT) {
73 UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfProfilesOnStartup", 73 UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfProfilesOnStartup",
74 number_of_profiles); 74 number_of_profiles);
75
76 size_t number_of_managed_profiles = 0;
77 for (size_t i = 0; i < number_of_profiles; ++i) {
78 if (info_cache.ProfileIsManagedAtIndex(i))
79 ++number_of_managed_profiles;
80 }
81 UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfManagedProfilesOnStartup",
82 number_of_managed_profiles);
75 } else { 83 } else {
76 UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfProfilesAfterAddOrDelete", 84 UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfProfilesAfterAddOrDelete",
77 number_of_profiles); 85 number_of_profiles);
78 } 86 }
79 } 87 }
80 88
81 void ProfileMetrics::LogProfileAddNewUser(ProfileAdd metric) { 89 void ProfileMetrics::LogProfileAddNewUser(ProfileAdd metric) {
82 DCHECK(metric < NUM_PROFILE_ADD_METRICS); 90 DCHECK(metric < NUM_PROFILE_ADD_METRICS);
83 UMA_HISTOGRAM_ENUMERATION("Profile.AddNewUser", metric, 91 UMA_HISTOGRAM_ENUMERATION("Profile.AddNewUser", metric,
84 NUM_PROFILE_ADD_METRICS); 92 NUM_PROFILE_ADD_METRICS);
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn", 229 UMA_HISTOGRAM_ENUMERATION("Profile.SyncSignIn",
222 GetProfileType(profile_path), 230 GetProfileType(profile_path),
223 NUM_PROFILE_TYPE_METRICS); 231 NUM_PROFILE_TYPE_METRICS);
224 } 232 }
225 233
226 void ProfileMetrics::LogProfileUpdate(const FilePath& profile_path) { 234 void ProfileMetrics::LogProfileUpdate(const FilePath& profile_path) {
227 UMA_HISTOGRAM_ENUMERATION("Profile.Update", 235 UMA_HISTOGRAM_ENUMERATION("Profile.Update",
228 GetProfileType(profile_path), 236 GetProfileType(profile_path),
229 NUM_PROFILE_TYPE_METRICS); 237 NUM_PROFILE_TYPE_METRICS);
230 } 238 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_info_cache.h ('k') | chrome/browser/resources/options/manage_profile_overlay.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698