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

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

Issue 844193005: Add UMA metrics for profile switching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_metrics.cc
diff --git a/chrome/browser/profiles/profile_metrics.cc b/chrome/browser/profiles/profile_metrics.cc
index 05ac76ba25a4d7c2be066981ab7a7d08eca3e059..6276baabb78a915a040df0ef086a3677d6df45ba 100644
--- a/chrome/browser/profiles/profile_metrics.cc
+++ b/chrome/browser/profiles/profile_metrics.cc
@@ -22,6 +22,8 @@ namespace {
const int kMaximumReportedProfileCount = 5;
const int kMaximumDaysOfDisuse = 4 * 7; // Should be integral number of weeks.
+size_t number_of_switches_ = 0;
Mike Lerman 2015/01/21 20:58:02 call this "number_of_profile_switches_" please.
anthonyvd 2015/01/23 16:01:30 Done.
+
ProfileMetrics::ProfileType GetProfileType(
const base::FilePath& profile_path) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
@@ -163,6 +165,14 @@ void ProfileMetrics::UpdateReportedProfilesStatistics(ProfileManager* manager) {
}
}
+void ProfileMetrics::IncrementNumberOfSwitches() {
+ ++number_of_switches_;
Mike Lerman 2015/01/21 20:58:03 I don't think this needs to be a separate method;
anthonyvd 2015/01/23 16:01:31 Done.
+}
+
+void ProfileMetrics::LogNumberOfSwitches() {
+ UMA_HISTOGRAM_COUNTS_100("Profile.NumberofSwitches", number_of_switches_);
Mike Lerman 2015/01/21 20:58:03 nit: NumberOfSwitches (capital O)
anthonyvd 2015/01/23 16:01:31 Done.
+}
+
void ProfileMetrics::LogNumberOfProfiles(ProfileManager* manager) {
ProfileCounts counts;
bool success = CountProfileInformation(manager, &counts);
@@ -306,6 +316,29 @@ void ProfileMetrics::LogProfileOpenMethod(ProfileOpen metric) {
NUM_PROFILE_OPEN_METRICS);
}
+void ProfileMetrics::LogProfileSwitch(
+ ProfileOpen metric,
+ bool profile_already_open) {
+ DCHECK(metric < NUM_PROFILE_OPEN_METRICS);
+ if(profile_already_open) {
+ UMA_HISTOGRAM_ENUMERATION("Profile.ProfileSwitch.ToOpenedProfile",
+ metric,
+ NUM_PROFILE_OPEN_METRICS);
+ } else {
+ UMA_HISTOGRAM_ENUMERATION("Profile.ProfileSwitch.ToUnopenedProfile",
+ metric,
+ NUM_PROFILE_OPEN_METRICS);
+ }
+ UMA_HISTOGRAM_ENUMERATION("Profile.ProfileSwitch",
Mike Lerman 2015/01/21 20:58:02 We really try not to rename histograms - doing so
anthonyvd 2015/01/21 21:12:18 So I preserved the Profile.OpenMethod histogram an
Mike Lerman 2015/01/21 21:24:18 Ah, I understand. I'm leery of duplicating the dat
anthonyvd 2015/01/23 16:01:31 Done.
+ metric,
+ NUM_PROFILE_OPEN_METRICS);
+
+ IncrementNumberOfSwitches();
+ //The LogOpenMethod histogram aggregates data from profile switches
+ //as well as opening of profile related UI elements
Mike Lerman 2015/01/21 21:24:18 nit: Add spaces after the //'s, and end it all wit
anthonyvd 2015/01/23 16:01:30 Done.
+ LogProfileOpenMethod(metric);
+}
+
void ProfileMetrics::LogProfileSwitchGaia(ProfileGaia metric) {
if (metric == GAIA_OPT_IN)
LogProfileAvatarSelection(AVATAR_GAIA);
@@ -314,12 +347,6 @@ void ProfileMetrics::LogProfileSwitchGaia(ProfileGaia metric) {
NUM_PROFILE_GAIA_METRICS);
}
-void ProfileMetrics::LogProfileSwitchUser(ProfileOpen metric) {
- DCHECK(metric < NUM_PROFILE_OPEN_METRICS);
- UMA_HISTOGRAM_ENUMERATION("Profile.OpenMethod", metric,
- NUM_PROFILE_OPEN_METRICS);
-}
-
void ProfileMetrics::LogProfileSyncInfo(ProfileSync metric) {
DCHECK(metric < NUM_PROFILE_SYNC_METRICS);
UMA_HISTOGRAM_ENUMERATION("Profile.SyncCustomize", metric,

Powered by Google App Engine
This is Rietveld 408576698