holidayextras / barometer

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

Metrics for page resources #26

Closed theninj4 closed 7 years ago

theninj4 commented 7 years ago

This PR enables a config driven approach to gathering page resource metrics. Resolves #3

The functionality is best read on the README.md, the TL;DR is that the feature is controlled via:

window.barometer.resources = [
  { domain: 'example.com', path: /\.js$/, metrics: [ 'startTime', 'duration' ] }
]

The production build size currently increases from 2.31KB to 2.79KB. Not too bad considering what we get.

msaspence commented 7 years ago

I agree that the 4.6KB is worth it but might be nice to have a build time config that can exclude them for custom builds. I've created #27 to consider that

theninj4 commented 7 years ago

This work only adds 0.46KB ;) I'll come back to this on Sunday and write the full documentation (the listing in the README was there so I didn't lose it) and tests. Should be good to ship come Monday morning.

msaspence commented 7 years ago

Sorry that's what I meant, still reeling from yesterdays rabbit hunt

theninj4 commented 7 years ago

I've gone to town on the documentation @msaspence

theninj4 commented 7 years ago

I've added a new test and it's passing in all environments :+1:

connormeredith commented 7 years ago

Minor comment, overall looks great 👍

jackdclark commented 7 years ago

👍