Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track barometer request times #22

Closed
wants to merge 3 commits into from

Conversation

slavcho-slavchev-hx
Copy link

This resolves #9. We already measure the times for all GET requests but the POST request that barometer makes is using the real XmlHttpRequest and doesn't log the times. I just made the change to use the monkey-patched version we have so that it would log the metrics.

@@ -57,7 +56,7 @@ transport._flushBuffer = function (pageEnd) {
if (navigator.sendBeacon) {
navigator.sendBeacon(url, JSON.stringify(bufferToSend))
} else {
var xhr = new xhrStats._XMLHttpRequest()
var xhr = new window.XMLHttpRequest()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The challenge with doing this the HTTP request to store metrics will generate more and more metrics. We'll end up in an infinite cycle of HTTP requests. If you try this by dumping the built code into this TripApp PR (https://github.com/holidayextras/tripapplite/pull/4190) you'll see the constant flow of metrics, even when no page interactions are happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Track barometer's request times
2 participants