Commit a8273564 authored by Robert Ogden's avatar Robert Ogden Committed by Commit Bot

Add metrics and histogram for IsolatedPrerender prefetching redirects

This also seems like a good metric to have, only recorded when
prefetching attempts have been made.

Bug: 1023485
Change-Id: I34c647d20c165386221c117e18f8212882fc9db2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2129891Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Commit-Queue: Robert Ogden <robertogden@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755159}
parent 08883369
...@@ -114,6 +114,12 @@ void IsolatedPrerenderTabHelper::DidStartNavigation( ...@@ -114,6 +114,12 @@ void IsolatedPrerenderTabHelper::DidStartNavigation(
// User is navigating, don't bother prefetching further. // User is navigating, don't bother prefetching further.
page_->url_loader_.reset(); page_->url_loader_.reset();
if (page_->metrics_.prefetch_attempted_count > 0) {
UMA_HISTOGRAM_COUNTS_100(
"IsolatedPrerender.Prefetch.Mainframe.TotalRedirects",
page_->metrics_.prefetch_total_redirect_count);
}
} }
void IsolatedPrerenderTabHelper::DidFinishNavigation( void IsolatedPrerenderTabHelper::DidFinishNavigation(
...@@ -253,6 +259,8 @@ void IsolatedPrerenderTabHelper::OnPrefetchRedirect( ...@@ -253,6 +259,8 @@ void IsolatedPrerenderTabHelper::OnPrefetchRedirect(
std::vector<std::string>* removed_headers) { std::vector<std::string>* removed_headers) {
DCHECK(PrefetchingActive()); DCHECK(PrefetchingActive());
page_->metrics_.prefetch_total_redirect_count++;
// Run the new URL through all the eligibility checks. In the mean time, // Run the new URL through all the eligibility checks. In the mean time,
// continue on with other Prefetches. // continue on with other Prefetches.
CheckAndMaybePrefetchURL(redirect_info.new_url); CheckAndMaybePrefetchURL(redirect_info.new_url);
......
...@@ -67,6 +67,9 @@ class IsolatedPrerenderTabHelper ...@@ -67,6 +67,9 @@ class IsolatedPrerenderTabHelper
// The number of attempted prefetches that were successful (net error was OK // The number of attempted prefetches that were successful (net error was OK
// and HTTP response code was 2XX). // and HTTP response code was 2XX).
size_t prefetch_successful_count = 0; size_t prefetch_successful_count = 0;
// The total number of redirects encountered during all prefetches.
size_t prefetch_total_redirect_count = 0;
}; };
const PrefetchMetrics& metrics() const { return page_->metrics_; } const PrefetchMetrics& metrics() const { return page_->metrics_; }
......
...@@ -67886,6 +67886,18 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -67886,6 +67886,18 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary> </summary>
</histogram> </histogram>
<histogram name="IsolatedPrerender.Prefetch.Mainframe.TotalRedirects"
units="count" expires_after="M90">
<owner>robertogden@chromium.org</owner>
<owner>ryansturm@chromium.org</owner>
<owner>tbansal@chromium.org</owner>
<summary>
Records the total number of redirects encountered while doing all the
prefetches on an eligible Google Search Result page. Only recorded when at
least one prefetch was attempted.
</summary>
</histogram>
<histogram name="IsolatedPrerender.Prefetch.Mainframe.TotalTime" units="ms" <histogram name="IsolatedPrerender.Prefetch.Mainframe.TotalTime" units="ms"
expires_after="M90"> expires_after="M90">
<owner>robertogden@chromium.org</owner> <owner>robertogden@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