How to get new/recent features added to the blink_features.usage table?

(Note that ‘new’ here means new to being tracked, not new features to the browser :slight_smile: )

I added 2 new features to be tracked via UseCounters in Chromium a while ago, and they are heavily used based on their Chrome Status pages: NonPassiveTouchEventListener and PassiveTouchEventListener

However, the table that should be populated with websites that are using the feature and is populated with data from the HTTP Archive is empty. I confirmed myself that both features are being hit and recorded correctly on top websites (Youtube, Amazon, Google, Facebook, etc), so I know there should be information here.

I believe that these features are missing from the blink_features.usage table - how do I go about getting them added to this table so that data can start being collected about sites using these features?

1 Like

Hi @mabian :wave: Good question!

Does this feature counter depend on the event actually being triggered by a touch? If so because of the synthetic nature of HTTP Archive’s testing using WebPageTest, that event would never occur. Alternatively, my only other explanation would be that we use mobile emulation from desktop Chrome and maybe that’s screwing with the feature counter.

Thanks for the reply @rviscomi!

Nope, this feature doesn’t need touch to be counted - it is counted when an event listener is registered that is listening for any touch event, which occurs whether or not there is a touch screen available. I’ve confirmed this by just browsing a few of the sites I mentioned then checking chrome://histograms/Blink.UseCounter.Features on my machine without a touch screen.

As for the mobile emulation, I’m not sure exactly how its done for the HTTP Archive, but I tried going into the F12 tools and setting the device toggle to Pixel 2, then navigating to youtube.com and facebook.com. chrome://histograms/Blink.UseCounter.Features correctly counted 1 of NonPassiveTouchEventListener and 2 of PassiveTouchEventListener, same as normal desktop Chrome.

I didn’t miss anything that needs to be done on the HTTP Archive side of things when I added these events, right? I only made changes to the Chromium code base.

AFAIK WebPageTest should be picking up all of the default feature counters so there’s nothing special you’d need to do. @patmeenan to confirm.

I update the features mapping table every month or so (which is fast enough to usually have features mapped before it makes it to stable). If it is not mapped it will still get reported but with the number as the feature name.

If you run a test on WebPageTest it should dump all of the detected features used in the json result. i.e. navigating to the www.facebook.com login page with mobile emulation produces these:

ARIAHiddenAttribute: 889.144,
ARIALabelAttribute: 967.964,
AddEventListenerPassiveFalse: 2160.061,
AddEventListenerPassiveTrue: 1687.085,
AddEventListenerThirdArgumentIsObject: 1682.313,
AutocapitalizeAttribute: 888.162,
CSPWithStrictDynamic: 3106.395,
CSPWithUnsafeEval: 418.93,
CSSAtRuleKeyframes: 661.097,
CSSAtRuleMedia: 689.854,
CSSAtRuleSupports: 689.96,
CSSEnvironmentVariable: 919.829,
CSSEnvironmentVariable_SafeAreaInsetBottom: 1984.631,
CSSEnvironmentVariable_SafeAreaInsetLeft: 919.838,
CSSEnvironmentVariable_SafeAreaInsetRight: 919.885,
CSSFlexibleBox: 928.004,
CSSGradient: 924.124,
CSSSelectorIndirectAdjacent: 662.33,
CSSSelectorPseudoFocus: 660.868,
CSSSelectorWebkitSearchCancelButton: 661.68,
CSSSelectorWebkitUnknownPseudo: 661.661,
CSSValueAppearanceNone: 923.15,
ContentSecurityPolicy: 418.898,
CookieSet: 863.792,
CrossOriginApplicationScript: 807.258,
CrossOriginMainFrameNulledNameAccessed: 418.922,
CryptoGetRandomValues: 1678.329,
DocumentBeforeUnloadRegistered: 1705.041,
DocumentDomainSetWithDefaultPort: 693.327,
DocumentPageHideRegistered: 1687.902,
DocumentPageShowFired: 3395.582,
DocumentPageShowRegistered: 1702.944,
DocumentSetDomain: 693.291,
DocumentUnloadRegistered: 1703.67,
EventSrcElement: 2050.465,
FormElement: 887.968,
FormsSubmitted: 2851.229,
HasBeforeOrAfterPseudoElement: 660.612,
HasIDClassTagAttribute: 660.5,
InputTypeEmail: 928.859,
InputTypeHidden: 928.713,
InputTypePassword: 928.922,
NavigatorUserAgent: 862.73,
NonPassiveTouchEventListener: 1687.539,
PassiveTouchEventListener: 1687.113,
PlaceholderAttribute: 888.647,
SecureContextCheckPassed: 418.914,
SetReferrerPolicy: 443.85,
StarInTimingAllowOrigin: 660.218
UnprefixedRequestAnimationFrame: 2299.545,
UserTiming: 1776.504,
V8Element_GetBoundingClientRect_Method: 2455.404,
V8ErrorStackTraceLimit: 1666.149,
V8MessageChannel_Constructor: 2282.843,
V8Performance_Timing_AttributeGetter: 836.505,
V8Screen_Height_AttributeGetter: 866.605,
V8Screen_Width_AttributeGetter: 866.583,
V8SloppyMode: 692.595,
V8StrictMode: 823.906,
WindowDevicePixelRatio: 863.617,
WindowInnerHeight: 1983.462,
WindowOrientation: 1970.407,
WindowPageXOffset: 3388.438,
WindowPageYOffset: 1994.67,
XMLHttpRequestAsynchronous: 2712.025,
XSSAuditorDisabled: 430.149,

There are a few different event listener named events in there (and nothing unmapped).

Here is the same test on an actual mobile device:

ARIAHiddenAttribute: 1380.915,
ARIALabelAttribute: 1421.044,
AddEventListenerPassiveFalse: 2424.571,
AddEventListenerPassiveTrue: 1909.827,
AddEventListenerThirdArgumentIsObject: 1903.683,
AutocapitalizeAttribute: 1380.096,
CSPWithStrictDynamic: 3116.942,
CSPWithUnsafeEval: 762.168,
CSSAtRuleKeyframes: 1154.855,
CSSAtRuleMedia: 1178.204,
CSSAtRuleSupports: 1178.658,
CSSEnvironmentVariable: 1396.646,
CSSEnvironmentVariable_SafeAreaInsetBottom: 2369.475,
CSSEnvironmentVariable_SafeAreaInsetLeft: 1396.663,
CSSEnvironmentVariable_SafeAreaInsetRight: 1396.684,
CSSFlexibleBox: 1404.838,
CSSGradient: 1402.327,
CSSSelectorIndirectAdjacent: 1162.862,
CSSSelectorPseudoFocus: 1151.174,
CSSSelectorWebkitSearchCancelButton: 1156.669,
CSSSelectorWebkitUnknownPseudo: 1156.155,
CSSValueAppearanceNone: 1401.515,
ContentSecurityPolicy: 761.946,
CookieSet: 1372.84,
CrossOriginApplicationScript: 1263.49,
CrossOriginMainFrameNulledNameAccessed: 762.146,
CryptoGetRandomValues: 1896.091,
DocumentBeforeUnloadRegistered: 1939.873,
DocumentDomainSetWithDefaultPort: 1201.992,
DocumentPageHideRegistered: 1911.413,
DocumentPageShowFired: 3685.641,
DocumentPageShowRegistered: 1937.918,
DocumentSetDomain: 1201.772,
DocumentUnloadRegistered: 1939.577,
EventSrcElement: 2240.173,
FormElement: 1379.74,
FormsSubmitted: 2895.258,
HasBeforeOrAfterPseudoElement: 1149.698,
HasIDClassTagAttribute: 1149.091,
InputTypeEmail: 1405.438,
InputTypeHidden: 1405.069,
InputTypePassword: 1405.66,
NavigatorUserAgent: 1372.645,
NonPassiveTouchEventListener: 1910.45,
PassiveTouchEventListener: 1909.961,
PlaceholderAttribute: 1380.129,
SecureContextCheckPassed: 762.119,
SetReferrerPolicy: 801.401,
StarInTimingAllowOrigin: 1148.479
UnprefixedRequestAnimationFrame: 2489.741,
UserTiming: 2024.012,
V8Element_GetBoundingClientRect_Method: 2986.992,
V8ErrorStackTraceLimit: 1878.143,
V8MessageChannel_Constructor: 2478.941,
V8Performance_Timing_AttributeGetter: 1348.608,
V8Screen_Height_AttributeGetter: 1374.719,
V8Screen_Width_AttributeGetter: 1374.69,
V8SloppyMode: 1198.887,
V8StrictMode: 1268.176,
WindowDevicePixelRatio: 1372.709,
WindowInnerHeight: 2368.196,
WindowOrientation: 2366.697,
WindowPageXOffset: 2534.736,
WindowPageYOffset: 2374.719,
XMLHttpRequestAsynchronous: 2813.346,
XSSAuditorDisabled: 771.33,

I’m not sure what the downstream processing looks like from the actual results in the HAR files that come out of the HTTP Archive itself into populating the tables and feature usage trackers though. If you’;re not looking in the raw HTTL Archive BigQuery data then it’s possible there are issues further downstream in the processing.

Thanks for the explanation @patmeenan. The features I’m looking for are in the lists you posted, and when I ran WebTestPage on youtube.com and facebook.com and I see them in the json output. I also downloaded the HAR file for facebook and I see a PassiveTouchEventListener, but no NonPassiveTouchEventListener (which is expected - this matches what about:histograms shows). So it does sound like a potential issue further downstream somewhere.

Do you know where I can look to find out how the HAR files are processed or who to talk to about this? We are venturing further and further from anything that I have any knowledge about, so any guidance would be great. :slight_smile:

Also, just running the query from the Chrome Status page:
SELECT yyyymmdd, client, pct_urls, sample_urls
FROM `httparchive.blink_features.usage`
WHERE feature = ‘NonPassiveTouchEventListener’
ORDER BY yyyymmdd DESC, client

On the HTTP Archive BigQuery finds no results. That seems unexpected based on what I’m seeing on the Chrome Status page, but since you mentioned looking at the raw Big Query data I’m not sure if that’s expected or not.

I think Rick owns the downstream pipelines so you’re in the right place :slight_smile:

The “pages” data has the raw feature data and I guess extra processing goes on to generate the blink_features table:

SELECT 
    url, 
    JSON_EXTRACT(payload, "$._blinkFeatureFirstUsed.Features.NonPassiveTouchEventListener")
FROM 
    [httparchive:pages.2019_08_01_mobile]  
WHERE 
    JSON_EXTRACT(payload, "$._blinkFeatureFirstUsed.Features.NonPassiveTouchEventListener") IS NOT NULL 
LIMIT 1000

That will give you 1000 pages where the feature triggered.

SELECT 
    count(*) 
FROM 
    [httparchive:pages.2019_08_01_mobile] 
WHERE 
    JSON_EXTRACT(payload, "$._blinkFeatureFirstUsed.Features.NonPassiveTouchEventListener") IS NOT NULL

That produced ~2.9M pages

Ah ok. The August 2019 dataset is the only one to include either of these features. @mabian were they just recently made available in Chrome stable?

On September 1st there’s a scheduled query that will add these features to the blink_features dataset on which the Chrome Status dashboard is built.

I think the first stable build that it was available in was 76, which released at the end of July, so I think that must be the issue then. I’ll check the Chrome Status pages again next week then, to confirm the data is making it there.

Thanks for the help guys! :slight_smile:

1 Like