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

Unified Diff: components/password_manager/core/browser/login_database.cc

Issue 715193002: [Password Generation] Breakout UMA stats for generated passwords (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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: components/password_manager/core/browser/login_database.cc
diff --git a/components/password_manager/core/browser/login_database.cc b/components/password_manager/core/browser/login_database.cc
index e1cf8a2f928901493ad163d1cf42c37bad08f5dd..9eb7e3f718612b1dd7bf9e2040fe055a9b245fa3 100644
--- a/components/password_manager/core/browser/login_database.cc
+++ b/components/password_manager/core/browser/login_database.cc
@@ -311,8 +311,9 @@ void LoginDatabase::ReportMetrics(const std::string& sync_username,
bool custom_passphrase_sync_enabled) {
sql::Statement s(db_.GetCachedStatement(
SQL_FROM_HERE,
- "SELECT signon_realm, blacklisted_by_user, COUNT(username_value) "
- "FROM logins GROUP BY signon_realm, blacklisted_by_user"));
+ "SELECT signon_realm, password_type, blacklisted_by_user,"
+ "COUNT(username_value) FROM logins GROUP BY "
+ "signon_realm, password_type, blacklisted_by_user"));
if (!s.is_valid())
return;
@@ -323,22 +324,37 @@ void LoginDatabase::ReportMetrics(const std::string& sync_username,
}
int total_accounts = 0;
Ilya Sherman 2014/11/13 01:54:53 Perhaps this should be renamed to something like "
Garrett Casto 2014/11/18 22:30:24 Done.
+ int total_generated_accounts = 0;
int blacklisted_sites = 0;
while (s.Step()) {
- int blacklisted = s.ColumnInt(1);
- int accounts_per_site = s.ColumnInt(2);
+ PasswordForm::Type password_type =
+ static_cast<PasswordForm::Type>(s.ColumnInt(1));
+ int blacklisted = s.ColumnInt(2);
+ int accounts_per_site = s.ColumnInt(3);
if (blacklisted) {
++blacklisted_sites;
+ } else if (password_type == PasswordForm::TYPE_GENERATED) {
+ total_generated_accounts += accounts_per_site;
+ LogAccountStat(
+ base::StringPrintf("PasswordManager.AccountsPerSite.AutoGenerated.%s",
+ custom_passphrase.c_str()),
+ accounts_per_site);
} else {
total_accounts += accounts_per_site;
- LogAccountStat(base::StringPrintf("PasswordManager.AccountsPerSite.%s",
- custom_passphrase.c_str()),
- accounts_per_site);
+ LogAccountStat(
+ base::StringPrintf("PasswordManager.AccountsPerSite.UserCreated.%s",
+ custom_passphrase.c_str()),
+ accounts_per_site);
}
}
- LogAccountStat(base::StringPrintf("PasswordManager.TotalAccounts.%s",
- custom_passphrase.c_str()),
- total_accounts);
+ LogAccountStat(
+ base::StringPrintf("PasswordManager.TotalAccounts.UserCreated.%s",
+ custom_passphrase.c_str()),
+ total_accounts);
+ LogAccountStat(
+ base::StringPrintf("PasswordManager.TotalAccounts.AutoGenerated.%s",
+ custom_passphrase.c_str()),
+ total_generated_accounts);
LogAccountStat(base::StringPrintf("PasswordManager.BlacklistedSites.%s",
custom_passphrase.c_str()),
blacklisted_sites);
@@ -355,13 +371,13 @@ void LoginDatabase::ReportMetrics(const std::string& sync_username,
usage_statement.ColumnInt(0));
if (type == PasswordForm::TYPE_GENERATED) {
- LogTimesUsedStat(
- base::StringPrintf("PasswordManager.TimesGeneratedPasswordUsed.%s",
- custom_passphrase.c_str()),
- usage_statement.ColumnInt(1));
+ LogTimesUsedStat(base::StringPrintf(
+ "PasswordManager.TimesPasswordUsed.AutoGenerated.%s",
+ custom_passphrase.c_str()),
+ usage_statement.ColumnInt(1));
} else {
LogTimesUsedStat(
- base::StringPrintf("PasswordManager.TimesPasswordUsed.%s",
+ base::StringPrintf("PasswordManager.TimesPasswordUsed.UserCreated.%s",
custom_passphrase.c_str()),
usage_statement.ColumnInt(1));
}

Powered by Google App Engine
This is Rietveld 408576698