HTTPArchive / legacy.httparchive.org

<<THIS REPOSITORY IS DEPRECATED>> The HTTP Archive provides information about website performance such as # of HTTP requests, use of gzip, and amount of JavaScript. This information is recorded over time revealing trends in how the Internet is performing. Built using Open Source software, the code and data are available to everyone allowing researchers large and small to work from a common base.
https://legacy.httparchive.org
Other
328 stars 84 forks source link

Performance 2021 custom metrics #221

Closed Nithanaroy closed 3 years ago

Nithanaroy commented 3 years ago

Progress on https://github.com/HTTPArchive/almanac.httparchive.org/issues/2148

https://www.webpagetest.org/jsonResult.php?test=210630_AiDcW5_45f47b83f50f2cfd80d460827d845164&pretty=1 is the test result JSON with lcp_stats as the custom metric.

Nithanaroy commented 3 years ago

Credits: https://gist.github.com/siakaramalegos/7cc8c0a790f8dfe0592c77cbca8440fa

Nithanaroy commented 3 years ago

Thanks a lot Rick and sorry for the last minute submission.

rviscomi commented 3 years ago

How does WPT know to run this new file? I got some hints from the Makefile but just curios to know how this repo works.

WPT runs all files under the custom_metrics directory that end in *.js

And where does this new performance key appear? httparchive.pages?

That's right. In the pages JSON blob there will be a top-level property for each custom metric.

Nithanaroy commented 3 years ago

Rick, assuming this is the only metric in performance, we could have directly returned the value getLcpElement() right? That is Promise.all([]) was mainly created for future proofing the schema right?

// [performance]

function getLcpElement() {
  return new Promise((resolve) => {
    ...
}

return getLcpElement()
rviscomi commented 3 years ago

Exactly