[wp-trac] [WordPress Trac] #59120: Measure interactivity metrics in performance tests

WordPress Trac noreply at wordpress.org
Fri Oct 27 10:15:36 UTC 2023


#59120: Measure interactivity metrics in performance tests
------------------------------+-----------------------------
 Reporter:  swissspidy        |       Owner:  (none)
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  Future Release
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:                    |     Focuses:  performance
------------------------------+-----------------------------

Comment (by swissspidy):

 Note that TBT is a lab metric that is not covered by web-vitals.js

 In JS it could be done with something like

 {{{
 var totalBlockingTime = 0;
 var observer = new PerformanceObserver(function (list) {
   let perfEntries = list.getEntries();
   for (const perfEntry of perfEntries) {
     totalBlockingTime += perfEntry.duration - 50;
   }
   console.log({ totalBlockingTime });
 });
 observer.observe({ type: "longtask", buffered: true });
 }}}

 ([https://www.debugbear.com/docs/metrics/total-blocking-time source])

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59120#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list