holidayextras / barometer

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

Enable resource aliasing #39

Closed theninj4 closed 7 years ago

theninj4 commented 7 years ago

It's common in production to name assets according to the git hash they were built from, eg 7354c2743eea199ff83b9236e3c3460bb86cae3b-assets.gz.js. When collecting resource metrics for resources with dynamic filenames, we need to ability to rename the metrics to enable us to gather a single stat.

This PR enables us to add a new property to the resource timing config to override the resource name:

{ 
  path: /.*-payload(\.gz)?\.js$/,
  metrics: [ 'startTime', 'duration' ],
  rename: 'payload.js' 
}
connormeredith commented 7 years ago

👍