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

Issue 608040 link

Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

UseCounters data is biased against single-page apps

Project Member Reported by rbyers@chromium.org, Apr 29 2016

Issue description

We use % of page views as our primary metric for measuring the potential compat impact of a change.  We've long known that this is flawed in the way that it emphasizes traditional web pages (where you're often navigating to new "page views") and under-represents single-page web apps.

I'm not sure offhand what we can reasonable do about this, but we should certainly brainstorm ideas.

 

Comment 1 by wyc...@gmail.com, Apr 30 2016

Here are some metrics that might serve as a proxy for serious single page apps:

- use of `pushState` or `replaceState` (this would help identify serious "single page apps" that support navigation).
- use of app cache or service worker (this would identify apps that are willing to commit to assets not being totally transient).
- use of IndexedDB, the File API and perhaps localStorage (this would identify apps that have non-transient data)

I'd be happy to think more about useful proxy signals if this generally makes sense and segmenting based on some signals like these might be something you'd want to do.

Comment 2 by tkent@chromium.org, Jun 23 2016

Components: -Blink>Architecture Blink>Internals
Renaming Blink>Architecture to Blink>Internals

Comment 3 by rbyers@chromium.org, Jun 23 2016

Labels: -Hotlist-CompatTooling Hotlist-Predictability

Comment 4 by rbyers@chromium.org, Jun 23 2016

Labels: -Hotlist-Predictability Hotlist-PredictabilityInfra

Comment 5 by rbyers@chromium.org, Dec 23 2016

Blocking: 676837

Comment 6 by rbyers@chromium.org, Dec 23 2016

Blocking: -676837
Cc: dk...@chromium.org foolip@chromium.org
#1: Thanks for the suggestions.  Ideally we wouldn't need to specifically identify "serious single page apps" but instead come up with a metrics design which is more agnostic to the type of page/app.

One option would be to treat each pushState/replaceState call on the main frame like a top-level navigation - with the idea that conceptually it's a new page view (but loading has been optimized away).  But then if a feature is used only during page load on a site with a lot of pushSates (eg. GMail) this change would result in that feature's usage to go down dramatically.  But I guess that's not really much different than a site mandatory whose login page depends on a feature, but then redirects you to other pages (the whole site is broken if the feature breaks, but metrics report it only as necessary for one of those PageVisits).

Another option would be to treat same-origin navigations as a no-op from a UseCounter perspective - so that rather than talk about "per page-view" we'd be talking about "per site view".

Big picture, if we're going to change something fundamental in our metrics strategy like this, I think we'll want to study the difference between it and our existing scheme (holding everything else constant).  So I don't think we'd want this to block the metrics rework/rename in  issue 676837  (which is more urgent anyway).

Comment 7 by rbyers@chromium.org, Dec 23 2016

Cc: igrigo...@chromium.org pmeenan@chromium.org rnyman@chromium.org
Concretely, I think we should try adding a "per host visit" variant of our histograms and compare the results to the "per page visit" one.  If the protocol/port changes it's probably reasonable to consider that part of the same "host visit".  But if the hostname changes at all, that's a new scope for metrics purposes.

foolip, igrigorik, rnyman, pmeenan: do you have any intuition here on what metrics strategy is likely to correlate best with "how risky is it to change/remove this feature"?


Hooking things up with pushState/replaceState will probably skew things towards certain long-lived sites that use those APIs more, where it's not really significant for the user.

The "per host visit" variant would be interesting, but would end up weighing the sites you visit and immediately leave (back to search) the same as the sites where you stay forever. It would be interesting to compare the numbers with the per-page one, but not obviously a better or worse proxy for risk, and probably more biased against single-page apps than our current metrics.

To assess risks in long-lived tabs is tricky. One idea is to ignore page/site loads and simply measure hits per hour. But what happens in the first few seconds is probably disproportionately important. And for single-entry-point style APIs like canvas.getContext(), 100 calls may be no worse than a single call. Background tabs that will be closed also barely matter at all, except for server-sync-related code in the page.

I can't see a single metric that would be perfect, but an hits-per-visible-second metric should be less biased against single-page apps. One could perhaps implement it as sending the metrics (as they are today) of the active tab every N minutes. Short visits could be missed entirely, but overall it should represent all the code paths that influence what the user is actually seeing/hearing.
Cc: rbyers@chromium.org
Owner: ----
Status: Available (was: Assigned)
hits-per-visible-second sounds promising, thanks.  I'd support experimenting with that.

It's not obvious that the benefit we'd get would justify the investment.  Marking this Available for now - I'll update this bug if/when we have compat issues where something like this may have helped (i.e. we get complaints after removing an API that was used by a popular SPAs).
Components: Blink>Infra>Predictability
Labels: -Hotlist-PredictabilityInfra
(advice from my talk on data analysis)
If you're planning to do something like hits-per-visible-second, I suggest you record the component values separately and compute the ratio in the analysis side.  Don't compute the ratio within Chrome and log only that.

Can you clarify? I imagined we would simply record the metrics once every hour (on average), and divide by a metric that's always recorded, similar to PageDestruction in the method currently used for chromestatus.com.
"I imagined we would simply record the metrics"
What do you mean by "the metrics"?  If you mean, record hits and emit that count, then on the analysis side look up the hits histogram and another histogram for the denominator such as page loads, that's fine.  I mean don't do the division in Chrome.

(If you do the division in Chrome, and you see an upload of "2" for hits-per-visible-second, you don't know whether this was 2 hits in a one-second visit or 120 hits in a one-minute visit.  These mean very different things, and you've lost the necessary information.)
I mean something like the current WebCore.FeatureObserver or the new WebCore.UseCounter_TEST.Features, where the denominator is one of the enum values, in histograms.xml terminology. When recording the metrics, that value would always be set. (Maybe that makes it unnecessary, I don't know UMA very well.)
That sounds fine.  Just don't do any sort of division (computing a fraction) within Chrome.

Comment 16 Deleted

Components: -Blink>Infra>Predictability Internals>FeatureControl
Reviewed, as part of triage of old bugs. Still something we might want to address, if we run into compat issues.

Comment 19 by dk...@chromium.org, Jun 21 2018

Cc: -dk...@chromium.org
Cc: -pmeenan@chromium.org

Sign in to add a comment