Skip to content

Instantly share code, notes, and snippets.

View LevinFaber's full-sized avatar
🥝

Levin LevinFaber

🥝
  • Cologne, Germany.
  • 00:06 (UTC +02:00)
View GitHub Profile
@suprememoocow
suprememoocow / intercept.js
Created May 29, 2012 09:53
AJAX timing interceptor: this class intercepts all AJAX calls and records the time taken for the HTTP request to complete. These timings are posted back to the server in batches, if there are any to send, about every two seconds. Tested in Firefox, Chrome
(function(XHR) {
"use strict";
var stats = [];
var timeoutId = null;
var open = XHR.prototype.open;
var send = XHR.prototype.send;