Last active
April 5, 2016 16:44
-
-
Save amk221/62dbcf21b2d28a8fe3f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Router from 'ember-router'; | |
import on from 'ember-evented/on'; | |
import { scheduleOnce } from 'ember-runloop'; | |
const { newrelic } = window; | |
const { timing } = window.performance; | |
export default Router.extend({ | |
location: config.locationType, | |
_start: on('didTransition', function() { | |
scheduleOnce('afterRender', this, '_finish'); | |
}), | |
_finish() { | |
let seconds = (Date.now() - timing.domComplete) / 1000; | |
newrelic.addPageAction(this.get('url'), seconds); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm curious how you've found this in practice? After initial render,
timing.domComplete
never changes even if you navigate to another page so this seems like a skewed metric?