Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom metrics for HTML analysis #141

Closed
rviscomi opened this issue Apr 27, 2019 · 0 comments
Closed

Add custom metrics for HTML analysis #141

rviscomi opened this issue Apr 27, 2019 · 0 comments

Comments

@rviscomi
Copy link
Member

Two new metrics needed for Almanac analysis:

  1. element_count: map of tag names (normalized to lowercase) to frequency count

  2. has_shadow_root: boolean whether the document contains an element with the shadowRoot property

@bkardell can you create a PR to add each of these custom metrics to https://github.com/HTTPArchive/legacy.httparchive.org/tree/master/custom_metrics? If we get this in before the end of the month it will be included in the May crawl. If there's a noticeable impact on the test throughput we may have to remove them from future crawls.

related: #138

bkardell added a commit to bkardell/legacy.httparchive.org that referenced this issue Apr 27, 2019
rviscomi pushed a commit to HTTPArchive/legacy.httparchive.org that referenced this issue Apr 27, 2019
bkardell added a commit to bkardell/legacy.httparchive.org that referenced this issue Apr 27, 2019
per HTTPArchive/httparchive.org#141 - this is slightly complicated by the fact that I think we don't want to include native elements that have a shadow root like inputs and video in this, so... someone should probably review this to see if it makes sense.
rviscomi pushed a commit to HTTPArchive/legacy.httparchive.org that referenced this issue May 28, 2019
* Create has_shadow_root.js

per HTTPArchive/httparchive.org#141 - this is slightly complicated by the fact that I think we don't want to include native elements that have a shadow root like inputs and video in this, so... someone should probably review this to see if it makes sense.

* Update has_shadow_root.js

Fix double || in regexp and stringify response for consistency

* Update has_shadow_root.js

Update the way we check for valid custom element name after some discussion in order to avoid potential false positives.

* Update has_shadow_root.js

Fixed broken paren.  Tested on Web Page Test via custom metrics - returns explicit true or false. Assuming links hold up, these should illustrate successful runs..

https://www.webpagetest.org/custom_metrics.php?test=190514_AV_0cdf6cffade2c8b54dc205d6b3ac596a&run=1&cached=0
https://www.webpagetest.org/custom_metrics.php?test=190514_X3_773a477c083e5705cd680858be91f31e&run=1&cached=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant