Commit 3a3ed1e4 authored by Jan Krcal's avatar Jan Krcal Committed by Commit Bot

[Profiles] Log the sync status of profiles

This CL adds another information to the Profile.Status.* collection of
histograms, namely the is-sync-enabled boolean.

Bug: 1136483
Change-Id: Ibd589d9f6fb75b3732abcf83279f6f2345f39969
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2461274
Commit-Queue: David Roger <droger@chromium.org>
Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Auto-Submit: Jan Krcal <jkrcal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815525}
parent 5cb87631
...@@ -216,6 +216,10 @@ void RecordProfileState(ProfileAttributesEntry* entry, ...@@ -216,6 +216,10 @@ void RecordProfileState(ProfileAttributesEntry* entry,
profile_metrics::LogProfileName(GetNameState(entry), suffix); profile_metrics::LogProfileName(GetNameState(entry), suffix);
profile_metrics::LogProfileAccountType( profile_metrics::LogProfileAccountType(
GetUnconsentedPrimaryAccountType(entry), suffix); GetUnconsentedPrimaryAccountType(entry), suffix);
profile_metrics::LogProfileSyncEnabled(
entry->GetSigninState() ==
SigninState::kSignedInWithConsentedPrimaryAccount,
suffix);
profile_metrics::LogProfileDaysSinceLastUse( profile_metrics::LogProfileDaysSinceLastUse(
(base::Time::Now() - entry->GetActiveTime()).InDays(), suffix); (base::Time::Now() - entry->GetActiveTime()).InDays(), suffix);
} }
......
...@@ -46,6 +46,11 @@ void LogProfileAccountType(UnconsentedPrimaryAccountType account_type, ...@@ -46,6 +46,11 @@ void LogProfileAccountType(UnconsentedPrimaryAccountType account_type,
account_type); account_type);
} }
void LogProfileSyncEnabled(bool sync_enabled, StateSuffix suffix) {
base::UmaHistogramBoolean(
"Profile.State.SyncEnabled" + GetStateSuffix(suffix), sync_enabled);
}
void LogProfileDaysSinceLastUse(int days_since_last_use, StateSuffix suffix) { void LogProfileDaysSinceLastUse(int days_since_last_use, StateSuffix suffix) {
base::UmaHistogramCounts1000( base::UmaHistogramCounts1000(
"Profile.State.LastUsed" + GetStateSuffix(suffix), days_since_last_use); "Profile.State.LastUsed" + GetStateSuffix(suffix), days_since_last_use);
......
...@@ -103,6 +103,9 @@ void LogProfileName(NameState name_state, StateSuffix suffix); ...@@ -103,6 +103,9 @@ void LogProfileName(NameState name_state, StateSuffix suffix);
void LogProfileAccountType(UnconsentedPrimaryAccountType account_type, void LogProfileAccountType(UnconsentedPrimaryAccountType account_type,
StateSuffix suffix); StateSuffix suffix);
// Records the state of profile's sync.
void LogProfileSyncEnabled(bool sync_enabled, StateSuffix suffix);
// Records the days since last use of a profile. // Records the days since last use of a profile.
void LogProfileDaysSinceLastUse(int days_since_last_use, StateSuffix suffix); void LogProfileDaysSinceLastUse(int days_since_last_use, StateSuffix suffix);
......
...@@ -14839,6 +14839,7 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -14839,6 +14839,7 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<affected-histogram name="Profile.State.Avatar"/> <affected-histogram name="Profile.State.Avatar"/>
<affected-histogram name="Profile.State.LastUsed"/> <affected-histogram name="Profile.State.LastUsed"/>
<affected-histogram name="Profile.State.Name"/> <affected-histogram name="Profile.State.Name"/>
<affected-histogram name="Profile.State.SyncEnabled"/>
<affected-histogram name="Profile.State.UnconsentedPrimaryAccountType"/> <affected-histogram name="Profile.State.UnconsentedPrimaryAccountType"/>
</histogram_suffixes> </histogram_suffixes>
......
...@@ -449,6 +449,16 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -449,6 +449,16 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary> </summary>
</histogram> </histogram>
<histogram base="true" name="Profile.State.SyncEnabled" enum="BooleanEnabled"
expires_after="2021-10-08">
<owner>jkrcal@chromium.org</owner>
<owner>droger@chromium.org</owner>
<summary>
The sync status of the profile. Recorded on startup of Chrome and whenever
Chrome is used after at least 30 minutes of inactivity.
</summary>
</histogram>
<histogram base="true" name="Profile.State.UnconsentedPrimaryAccountType" <histogram base="true" name="Profile.State.UnconsentedPrimaryAccountType"
enum="ProfileUnconsentedPrimaryAccountType" expires_after="2021-03-11"> enum="ProfileUnconsentedPrimaryAccountType" expires_after="2021-03-11">
<owner>jkrcal@chromium.org</owner> <owner>jkrcal@chromium.org</owner>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment