New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 675970 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jan 2017
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

investigate shift in ratio of foreground vs background pages in page_load_metrics

Project Member Reported by bmcquade@chromium.org, Dec 20 2016

Issue description

In the 2868..2875 range, we saw a shift in the ratio of foreground vs background pages tracked by page_load_metrics.

Changelist is here:
https://chromium.googlesource.com/chromium/src/+log/55.0.2868.0..55.0.2875.0?pretty=fuller&n=10000

The only page_load_metrics changes in this range are:
https://codereview.chromium.org/2372573005
https://codereview.chromium.org/2371883002
https://codereview.chromium.org/2359523003
https://codereview.chromium.org/2354703002

Of these, the only one that seems like it could cause this is https://codereview.chromium.org/2371883002, which updated the hidden state as part of the code that indicates the application has been backgrounded on Android.

This should have been a no-op, but we should debug to make sure.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 21 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/56e62f80d4980cc9970cc5a719f287c3ba4dcafb

commit 56e62f80d4980cc9970cc5a719f287c3ba4dcafb
Author: bmcquade <bmcquade@chromium.org>
Date: Wed Dec 21 16:09:03 2016

Remove call to WasHidden as part of the app being backgrounded.

2371883002 added support for informing page load metrics observers
that the application had gone into the background. As part of this
change, we called WasHidden() to guarantee that background state
had been updated by the time FlushMetricsOnAppEnterBackground was
invoked on the observers.

After this change landed, we also saw a shift in the ratio of page
loads that were in the foreground vs background (see
 crbug.com/675970  for details). Though it's unclear whether this change
caused the shift, it seems sensible to remove the call to WasHidden for
now just to be safe.

More details:
The FlushMetricsOnAppEnterBackground flow is triggered via
Activity.onPause on Android. The docs for this method say
"Called as part of the activity lifecycle when an activity is going
into the background, but has not (yet) been killed." but later
"After receiving this call you will usually receive a following call
to onStop() (after the next activity has been resumed and displayed),
however in some cases there will be a direct call back to onResume()
without going through the stopped state.". This latter comment
suggests that a call to onPause may not guarantee that the app is
being backgrounded. Additional discussion on stack overflow also
suggests that a call to onPause does not  guarantee that an app is
going to be backgrounded.

Thus, it may be invalid for us to invoke WasHidden as part of this
flow.

DRP observer depended on WasHidden being invoked as part of the
FlushMetricsOnAppEnterBackground flow, so we now add an implementation
of FlushMetricsOnAppEnterBackground in that observer to address this
change.

BUG= 675970 

Review-Url: https://codereview.chromium.org/2593793002
Cr-Commit-Position: refs/heads/master@{#440114}

[modify] https://crrev.com/56e62f80d4980cc9970cc5a719f287c3ba4dcafb/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
[modify] https://crrev.com/56e62f80d4980cc9970cc5a719f287c3ba4dcafb/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.cc
[modify] https://crrev.com/56e62f80d4980cc9970cc5a719f287c3ba4dcafb/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.h

I'll leave this open and watch metrics to see if they return to normal levels. Should take a few weeks to get enough data to know for sure.
Data from Android canary suggests that the change to Remove call to WasHidden as part of the app being backgrounded has addressed this issue.
Status: Fixed (was: Started)

Sign in to add a comment