holidayextras / barometer

Framework agnostic browser performance metrics
MIT License
5 stars 4 forks source link

Use resource timings to track all requests #3

Closed msaspence closed 8 years ago

msaspence commented 8 years ago

Use the resource timings api (where available) to track the performance of all resources not just ajax calls.

theninj4 commented 8 years ago

This is awesome, I considered it for the original release but ran into too many questions:

  1. Should the types of resources be config driven? Some pages load hundreds of resources...
  2. How should we time the resources? Time since page load? Time for resource to load? Total [insert-resource-type]'s per page?
  3. Logging unique metrics per resource URL could lead to 100,000's of metrics... That's a lot of metrics. That pretty much rules out the usage of hosted graphite who charge $600/month for 30,000 metrics.
msaspence commented 8 years ago
  1. Yes
  2. b and c - a might have value on page that doesn't have much/any dynamic content so you expect all resources to load as close to page load as possible
  3. There are potentially three or four levels to measure at:
    • all resources - I'm not sure what value this offers given the variation is resource size, any value you might get (total number of resources as an indicator of bloat) would be less valuable that others
    • host - if you are using resources from third parties that were really slow this would give you an actionable metric on that e.g. "we're going to switch our font provider because in 10% of cases google fonts takes too long"
    • type - this might not custom base on a url pattern so I could for example measure the performance of all "product tile images"
    • url - almost certainly wants to be configurable, maybe you only want to track a couple of key resources