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

Unified Diff: chrome/browser/page_load_metrics/observers/aborts_page_load_metrics_observer.cc

Issue 1984173002: Log First User Interaction in Page Load Metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: chrome/browser/page_load_metrics/observers/aborts_page_load_metrics_observer.cc
diff --git a/chrome/browser/page_load_metrics/observers/aborts_page_load_metrics_observer.cc b/chrome/browser/page_load_metrics/observers/aborts_page_load_metrics_observer.cc
index ed9428b122096dd3382552eb2ea0eeeade788bad..08326035a405570835c754dc6f9db8fd8c244483 100644
--- a/chrome/browser/page_load_metrics/observers/aborts_page_load_metrics_observer.cc
+++ b/chrome/browser/page_load_metrics/observers/aborts_page_load_metrics_observer.cc
@@ -36,6 +36,17 @@ const char kHistogramAbortStopBeforePaint[] =
const char kHistogramAbortCloseBeforePaint[] =
"PageLoad.AbortTiming.Close.AfterCommit.BeforePaint";
+const char kHistogramAbortForwardBackBeforeInteraction[] =
+ "PageLoad.AbortTiming.ForwardBackNavigation.AfterPaint.BeforeInteraction";
+const char kHistogramAbortReloadBeforeInteraction[] =
+ "PageLoad.AbortTiming.Reload.AfterPaint.BeforeInteraction";
+const char kHistogramAbortNewNavigationBeforeInteraction[] =
+ "PageLoad.AbortTiming.NewNavigation.AfterPaint.BeforeInteraction";
+const char kHistogramAbortStopBeforeInteraction[] =
+ "PageLoad.AbortTiming.Stop.AfterPaint.BeforeInteraction";
+const char kHistogramAbortCloseBeforeInteraction[] =
+ "PageLoad.AbortTiming.Close.AfterPaint.BeforeInteraction";
+
const char kHistogramAbortForwardBackDuringParse[] =
"PageLoad.AbortTiming.ForwardBackNavigation.DuringParse";
const char kHistogramAbortReloadDuringParse[] =
@@ -129,6 +140,45 @@ void RecordAbortAfterCommitBeforePaint(UserAbortType abort_type,
NOTREACHED();
}
+void RecordAbortAfterPaintBeforeInteraction(UserAbortType abort_type,
+ base::TimeDelta time_to_abort) {
+ switch (abort_type) {
+ case UserAbortType::ABORT_RELOAD:
+ PAGE_LOAD_HISTOGRAM(internal::kHistogramAbortReloadBeforeInteraction,
+ time_to_abort);
+ return;
+ case UserAbortType::ABORT_FORWARD_BACK:
+ PAGE_LOAD_HISTOGRAM(internal::kHistogramAbortForwardBackBeforeInteraction,
+ time_to_abort);
+ return;
+ case UserAbortType::ABORT_NEW_NAVIGATION:
+ PAGE_LOAD_HISTOGRAM(
+ internal::kHistogramAbortNewNavigationBeforeInteraction,
+ time_to_abort);
+ return;
+ case UserAbortType::ABORT_STOP:
+ PAGE_LOAD_HISTOGRAM(internal::kHistogramAbortStopBeforeInteraction,
+ time_to_abort);
+ return;
+ case UserAbortType::ABORT_CLOSE:
+ PAGE_LOAD_HISTOGRAM(internal::kHistogramAbortCloseBeforeInteraction,
+ time_to_abort);
+ return;
+ case UserAbortType::ABORT_UNKNOWN_NAVIGATION:
+ NOTREACHED() << "Received UserAbortType::ABORT_UNKNOWN_NAVIGATION for "
+ "committed load.";
+ return;
+ case UserAbortType::ABORT_OTHER:
+ NOTREACHED() << "Received UserAbortType::ABORT_OTHER for committed load.";
+ return;
+ case UserAbortType::ABORT_NONE:
+ case UserAbortType::ABORT_LAST_ENTRY:
+ NOTREACHED();
+ return;
+ }
+ NOTREACHED();
+}
+
void RecordAbortDuringParse(UserAbortType abort_type,
base::TimeDelta time_to_abort) {
switch (abort_type) {
@@ -205,4 +255,9 @@ void AbortsPageLoadMetricsObserver::OnComplete(
if (timing.first_paint.is_zero() || timing.first_paint >= time_to_abort) {
RecordAbortAfterCommitBeforePaint(abort_type, time_to_abort);
}
+ if ((timing.first_paint.is_zero() || timing.first_paint < time_to_abort) &&
+ (extra_info.first_user_interaction_time.is_zero() ||
+ extra_info.first_user_interaction_time >= time_to_abort)) {
+ RecordAbortAfterPaintBeforeInteraction(abort_type, time_to_abort);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698