HubSpot / BuckyClient

Collect performance data from the client

Home Page:http://github.hubspot.com/bucky

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sendPagePerformance is called too soon

william-p opened this issue · comments

Hi,
i think that sendPagePerformance method is called too soon in process.

Bucky parse window.performance.timing on DOMContentLoaded event (from document) (code), but at this time some fields (domComplete, loadEventStart, loadEventEnd) are not filled.

  • I tried to bind load event (from window) but event fired too quickly and loadEventEnd is empty
  • i tried to add setTimeout, it works but so crappy

I think that is more smart to call sendPagePerformance just before first post to server.

What do you think ?