Commit 4f1dec3a authored by clamy's avatar clamy Committed by Commit Bot

PlzNavigate: improve bf navigations metrics

This CL improves the metrics landed in
https://codereview.chromium.org/2930353005/. It ensures timing metrics
are not recorded for same-document navigations. It also ensures that the
cache flag metric is not captured twice when PlzNavigate is enabled.

BUG=705559
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2944033002
Cr-Commit-Position: refs/heads/master@{#480853}
parent f037a45b
......@@ -715,7 +715,7 @@ void NavigationHandleImpl::ReadyToCommitNavigation(
ready_to_commit_time_ = base::TimeTicks::Now();
// For back-forward navigations, record metrics.
if (transition_ & ui::PAGE_TRANSITION_FORWARD_BACK) {
if ((transition_ & ui::PAGE_TRANSITION_FORWARD_BACK) && !IsSameDocument()) {
bool is_same_process =
render_frame_host_->GetProcess()->GetID() ==
frame_tree_node_->current_frame_host()->GetProcess()->GetID();
......@@ -756,7 +756,7 @@ void NavigationHandleImpl::DidCommitNavigation(
// For back-forward navigations, record metrics.
if ((transition_ & ui::PAGE_TRANSITION_FORWARD_BACK) &&
!ready_to_commit_time_.is_null()) {
!ready_to_commit_time_.is_null() && !IsSameDocument()) {
UMA_HISTOGRAM_TIMES("Navigation.BackForward.ReadyToCommitUntilCommit",
base::TimeTicks::Now() - ready_to_commit_time_);
}
......
......@@ -2240,7 +2240,8 @@ void ResourceDispatcherHostImpl::BeginRequestInternal(
// TODO(clamy): Remove this once we understand the reason behind the
// back-forward PLT regression with PlzNavigate
if ((info->GetPageTransition() & ui::PAGE_TRANSITION_FORWARD_BACK) &&
IsResourceTypeFrame(info->GetResourceType())) {
IsResourceTypeFrame(info->GetResourceType()) &&
request->url().SchemeIsHTTPOrHTTPS()) {
LogBackForwardNavigationFlagsHistogram(request->load_flags());
}
......
......@@ -645,7 +645,7 @@ void ResourceLoader::CompleteResponseStarted() {
// of PLT for b/f navigations in PlzNavigate.
if ((info->GetPageTransition() & ui::PAGE_TRANSITION_FORWARD_BACK) &&
IsResourceTypeFrame(info->GetResourceType()) &&
!request_->url().SchemeIsBlob()) {
request_->url().SchemeIsHTTPOrHTTPS()) {
UMA_HISTOGRAM_BOOLEAN("Navigation.BackForward.WasCached",
request_->was_cached());
}
......
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