Commit 14d67837 authored by erikchen's avatar erikchen Committed by Commit bot

Add histograms for deletion of session cookies on startup.

The new histograms measure the performance of session cookie deletion.

BUG=485694

Review URL: https://codereview.chromium.org/1131413004

Cr-Commit-Position: refs/heads/master@{#329529}
parent d0eae580
......@@ -1305,8 +1305,14 @@ void SQLitePersistentCookieStore::Backend::SetForceKeepSessionState() {
void SQLitePersistentCookieStore::Backend::DeleteSessionCookiesOnStartup() {
DCHECK(background_task_runner_->RunsTasksOnCurrentThread());
base::Time start_time = base::Time::Now();
if (!db_->Execute("DELETE FROM cookies WHERE persistent != 1"))
LOG(WARNING) << "Unable to delete session cookies.";
UMA_HISTOGRAM_TIMES("Cookie.Startup.TimeSpentDeletingCookies",
base::Time::Now() - start_time);
UMA_HISTOGRAM_COUNTS("Cookie.Startup.NumberOfCookiesDeleted",
db_->GetLastChangeCount());
}
void SQLitePersistentCookieStore::Backend::PostBackgroundTask(
......
......@@ -3838,6 +3838,24 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary>
</histogram>
<histogram name="Cookie.Startup.NumberOfCookiesDeleted">
<owner>erikchen@chromium.org</owner>
<summary>
The number of session cookies deleted on startup. This metric is emitted
even if no cookies are deleted. This metric is not emitted if session
cookies are restored, rather than deleted on startup.
</summary>
</histogram>
<histogram name="Cookie.Startup.TimeSpentDeletingCookies" units="ms">
<owner>erikchen@chromium.org</owner>
<summary>
The amount of time required to delete session cookies on startup. This
metric is emitted even if no cookies are deleted. This metric is not emitted
if session cookies are restored, rather than deleted on startup.
</summary>
</histogram>
<histogram name="Cookie.TimeBlockedOnLoad" units="ms">
<owner>erikwright@chromium.org</owner>
<summary>
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