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

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

Issue 141663004: Separate tracking for profiles that haven't been accessed in 4 weeks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_metrics.cc
diff --git a/chrome/browser/profiles/profile_metrics.cc b/chrome/browser/profiles/profile_metrics.cc
index bd4ac3b248a3ddd656b8946f1e09e5254e7ac4dc..2b68860e6ee2ddf77fbd00c82ff3cf1f1abc04c6 100644
--- a/chrome/browser/profiles/profile_metrics.cc
+++ b/chrome/browser/profiles/profile_metrics.cc
@@ -19,13 +19,15 @@
namespace {
const int kMaximumReportedProfileCount = 5;
+const int kMaximumDaysOfDisuse = 4 * 7; // Should be integral number of weeks.
struct ProfileCounts {
size_t total;
size_t signedin;
size_t managed;
+ size_t unused;
- ProfileCounts() : total(0), signedin(0), managed(0) {}
+ ProfileCounts() : total(0), signedin(0), managed(0), unused(0) {}
};
ProfileMetrics::ProfileType GetProfileType(
@@ -59,11 +61,19 @@ bool CountProfileInformation(ProfileManager* manager, ProfileCounts* counts) {
if (!number_of_profiles)
return false;
+ // Maximum age for "active" profile is 4 weeks.
+ base::Time oldest = base::Time::Now() -
+ base::TimeDelta::FromDays(kMaximumDaysOfDisuse);
+
for (size_t i = 0; i < number_of_profiles; ++i) {
- if (info_cache.ProfileIsManagedAtIndex(i))
- counts->managed++;
- if (!info_cache.GetUserNameOfProfileAtIndex(i).empty())
- counts->signedin++;
+ if (info_cache.GetProfileActiveTimeAtIndex(i) < oldest) {
rpetterson 2014/01/22 21:40:27 Overall I think this is an interesting metric to r
bcwhite 2014/01/23 14:07:38 From the point-of-view of "signed in" tracking, we
+ counts->unused++;
+ } else {
+ if (info_cache.ProfileIsManagedAtIndex(i))
+ counts->managed++;
+ if (!info_cache.GetUserNameOfProfileAtIndex(i).empty())
+ counts->signedin++;
+ }
}
return true;
}
@@ -130,6 +140,8 @@ void ProfileMetrics::LogNumberOfProfiles(ProfileManager* manager) {
100 * counts.managed / counts.total);
UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfSignedInProfiles",
counts.signedin);
+ UMA_HISTOGRAM_COUNTS_100("Profile.NumberOfUnusedProfiles",
+ counts.unused);
UpdateReportedOSProfileStatistics(counts.total, counts.signedin);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698