TracerBench / tracerbench

Automated Chrome tracing for benchmarking.
BSD 2-Clause "Simplified" License
245 stars 31 forks source link

Tsubomi/trace end at lcp #430

Closed tsubomii closed 2 years ago

tsubomii commented 2 years ago

Summary

  1. Allow users to add largestContentfulPaint as the last marker in markers configuration. In this case, we end trace on the largest-contentful-paint event. See detail in this RFC.
  2. If the record-har command 's --marker=largestContentfulPaint, we end recording at the first largestContentfulPaint candidate.
  3. Removed artificial generating paint event (enforcePaintEventFn) when injecting mark observer.
  4. Remove performance.mark('traceEnd') within performanceObserver callback. Because the trace event doesn't get flushed.
  5. Expose a few utility cli APIs.

Test Done

  1. yarn test at the root level
  2. Validated the trace end conditions are going through the correct flow using the debugger.
  3. Validated the report has correct phase data when end trace at LCP