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

Unified Diff: content/browser/net/sqlite_persistent_cookie_store.cc

Issue 1131413004: Add histograms for deletion of session cookies on startup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/net/sqlite_persistent_cookie_store.cc
diff --git a/content/browser/net/sqlite_persistent_cookie_store.cc b/content/browser/net/sqlite_persistent_cookie_store.cc
index 6b2ff26ec3703f05d83b3d892ac16b6468a35700..00fb10e02dbe84bcc2e1e8d7a8437e808e0323b5 100644
--- a/content/browser/net/sqlite_persistent_cookie_store.cc
+++ b/content/browser/net/sqlite_persistent_cookie_store.cc
@@ -701,8 +701,27 @@ bool SQLitePersistentCookieStore::Backend::InitializeDatabase() {
initialized_ = true;
- if (!restore_old_session_cookies_)
+ int deleted_cookies_count = 0;
erikwright (departed) 2015/05/12 14:30:43 Assuming you agree with my comment below, move cou
erikchen 2015/05/12 18:50:34 I removed the variables elapsed_time and deleted_c
+ base::TimeDelta elapsed_time;
+ if (!restore_old_session_cookies_) {
+ base::Time start_time = base::Time::Now();
DeleteSessionCookiesOnStartup();
+
+ elapsed_time = base::Time::Now() - start_time;
+ UMA_HISTOGRAM_TIMES("Cookie.Startup.TimeSpentDeletingCookies",
+ elapsed_time);
+
+ deleted_cookies_count = db_->GetLastChangeCount();
+ UMA_HISTOGRAM_COUNTS("Cookie.Startup.NumberOfCookiesDeleted",
+ deleted_cookies_count);
+ }
+
+ if (deleted_cookies_count > 0) {
erikwright (departed) 2015/05/12 14:30:43 I'm not convinced that this is useful. In any case
erikchen 2015/05/12 18:50:34 I wasn't aware that this was easy to do with dreme
+ base::TimeDelta avg_deletion_time = elapsed_time / deleted_cookies_count;
+ UMA_HISTOGRAM_TIMES("Cookie.Startup.AverageTimeSpentDeletingOneCookie",
+ avg_deletion_time);
+ }
+
return true;
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698