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

Unified Diff: chrome/browser/profiles/profile_metrics.cc

Issue 8890054: Adding metrics to track browser launches per primary/secondary profile. Adding metrics to track n... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years 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 side-by-side diff with in-line comments
Download patch
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);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698