perfops-rom
Advanced tools
Comparing version 1.0.5 to 1.0.6
129
dist/rom.js
@@ -18,2 +18,3 @@ "use strict"; | ||
var clientKey = window.rum ? window.rum.key : undefined; | ||
var globalStoreMeta = null; | ||
@@ -38,7 +39,3 @@ var globalResults = []; | ||
xhr.onload = function () { | ||
if (xhr.status >= 200 && xhr.status < 300) { | ||
return resolve(xhr); | ||
} | ||
xhr.onerror(); | ||
return resolve(xhr); | ||
}; | ||
@@ -79,8 +76,26 @@ | ||
var timing = performance.getEntriesByName(url)[0]; | ||
return { | ||
id: resource.id, | ||
up: 1, | ||
time: Number((timing.responseEnd - timing.requestStart).toFixed(2)), | ||
headers: xhr.getAllResponseHeaders() | ||
var result = { | ||
id: resource.id | ||
}; | ||
if (xhr.status >= 200 && xhr.status < 300) { | ||
// Add success response measurements | ||
result = Object.assign({}, result, { | ||
up: 1, | ||
time: Number((timing.responseEnd - timing.requestStart).toFixed(2)), | ||
dnsLookupTime: Number((timing.domainLookupEnd - timing.domainLookupStart).toFixed(2)), | ||
headers: xhr.getAllResponseHeaders() | ||
}); | ||
} | ||
if (xhr.status >= 300 && xhr.status <= 500) { | ||
// HTTP Redirect/Error | ||
result = Object.assign({}, result, { | ||
up: 0, | ||
dnsLookupTime: Number((timing.domainLookupEnd - timing.domainLookupStart).toFixed(2)), | ||
headers: xhr.getAllResponseHeaders() | ||
}); | ||
} | ||
return result; | ||
}).catch(function () { | ||
@@ -145,24 +160,20 @@ return { | ||
"data": [{ | ||
"id": 16, | ||
"cdnUrl": "https://19405s.ha.azioncdn.net/500b-bench.jpg", | ||
"id": 1, | ||
"cdnUrl": "https://kgmni17536myjst.belugacdn.link/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 6, | ||
"cdnUrl": "https://perfops-ade2.kxcdn.com/500b-bench.jpg", | ||
"id": 22, | ||
"cdnUrl": "https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg", | ||
"p": "0" | ||
}, { | ||
"id": 8, | ||
"cdnUrl": "https://perfops.gcdn.co/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 10, | ||
"cdnUrl": "https://akamai.perfstack.net/500b-bench.jpg", | ||
"id": 7, | ||
"cdnUrl": "https://googlecdn.perfstack.net/5002b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 25, | ||
"cdnUrl": "https://perf.gamepiper.com/500b-bench.jpg", | ||
"p": "0" | ||
}, { | ||
"id": 26, | ||
"cdnUrl": "https://ngcdnperf.qtlglb.com/500b-bench.jpg", | ||
"p": "0" | ||
}, { | ||
"id": 22, | ||
"cdnUrl": "https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg", | ||
"id": 6, | ||
"cdnUrl": "https://perfops-ade2.kxcdn.com/500b-bench.jpg", | ||
"p": "1" | ||
@@ -174,13 +185,13 @@ }, { | ||
}, { | ||
"id": 20, | ||
"cdnUrl": "https://cdnperf.cachefly.net/500b-bench.jpg", | ||
"id": 4, | ||
"cdnUrl": "https://fastly.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 14, | ||
"cdnUrl": "https://perfops.r.worldssl.net/500b-bench.jpg", | ||
"id": 3, | ||
"cdnUrl": "https://perfops.perfstack.cf-china.info/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 13, | ||
"cdnUrl": "https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg", | ||
"p": "1" | ||
"id": 29, | ||
"cdnUrl": "https://25748s.ha.azioncdn.net/500b-bench.jpg", | ||
"p": "0" | ||
}, { | ||
@@ -191,6 +202,14 @@ "id": 24, | ||
}, { | ||
"id": 11, | ||
"cdnUrl": "https://perfops.b-cdn.net/500b-bench.jpg", | ||
"id": 20, | ||
"cdnUrl": "https://cdnperf.cachefly.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 10, | ||
"cdnUrl": "https://akamai.perfstack.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 2, | ||
"cdnUrl": "https://ovhcdn.perfstack.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 18, | ||
@@ -200,4 +219,4 @@ "cdnUrl": "https://azure-perfops.azureedge.net/500b-bench.jpg", | ||
}, { | ||
"id": 8, | ||
"cdnUrl": "https://perfops.gcdn.co/500b-bench.jpg", | ||
"id": 17, | ||
"cdnUrl": "https://edgecast.perfstack.net/8086B5F/bench/500b-bench.jpg", | ||
"p": "1" | ||
@@ -209,2 +228,10 @@ }, { | ||
}, { | ||
"id": 14, | ||
"cdnUrl": "https://perfops.r.worldssl.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 13, | ||
"cdnUrl": "https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 12, | ||
@@ -214,29 +241,9 @@ "cdnUrl": "https://cdn.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg", | ||
}, { | ||
"id": 3, | ||
"cdnUrl": "https://perfops.perfstack.cf-china.info/500b-bench.jpg", | ||
"id": 11, | ||
"cdnUrl": "https://perfops.b-cdn.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 4, | ||
"cdnUrl": "https://fastly.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 9, | ||
"cdnUrl": "https://1933886249.rsc.cdn77.org/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 7, | ||
"cdnUrl": "https://googlecdn.perfstack.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 17, | ||
"cdnUrl": "https://edgecast.perfstack.net/8086B5F/bench/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 2, | ||
"cdnUrl": "https://ovhcdn.perfstack.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 1, | ||
"cdnUrl": "https://kgmni17536myjst.belugacdn.link/500b-bench.jpg", | ||
"p": "1" | ||
}] | ||
@@ -247,3 +254,5 @@ }; | ||
var metadata = { | ||
ua: navigator.userAgent | ||
ua: navigator.userAgent, | ||
hostname: window.location.hostname, | ||
client: clientKey | ||
}; | ||
@@ -250,0 +259,0 @@ var tooSlow = 0; |
@@ -1,1 +0,1 @@ | ||
"use strict";!function(u){var n,t=-1!==function(){}.toString().indexOf("minified")?{logInfo:console.log,logError:console.error}:{logInfo:function(){},logError:function(){}},e=t.logInfo,h=t.logError,r=null,o=[],c=[],p=!1;function i(r,n){var t=1<arguments.length&&void 0!==n?n:{},e=t.cb,c=void 0===e?function(){}:e,o=t.data,p=t.method,i=void 0===p?"GET":p,d=t.timeout,s=void 0===d?3e3:d;return new u(function(n,t){var e=new XMLHttpRequest;e.onload=function(){if(200<=e.status&&e.status<300)return n(e);e.onerror()},e.onerror=e.ontimeout=function(){h(e),t(new Error("Status ".concat(e.status,". Response: ").concat(e.statusText)))},e.open(i,r),e.timeout=s,c(e),e.send(o)})}function d(){setTimeout(function(){i("https://api.perfops.net/rum-cdn.php").then(function(n){return JSON.parse(n.response)}).then(function(n){if(!n||!n.data||!n.data.length)throw new Error("Empty response.data");return n}).catch(function(){return{data:[{id:16,cdnUrl:"https://19405s.ha.azioncdn.net/500b-bench.jpg",p:"1"},{id:6,cdnUrl:"https://perfops-ade2.kxcdn.com/500b-bench.jpg",p:"1"},{id:10,cdnUrl:"https://akamai.perfstack.net/500b-bench.jpg",p:"1"},{id:25,cdnUrl:"https://perf.gamepiper.com/500b-bench.jpg",p:"0"},{id:26,cdnUrl:"https://ngcdnperf.qtlglb.com/500b-bench.jpg",p:"0"},{id:22,cdnUrl:"https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg",p:"1"},{id:5,cdnUrl:"https://d2axgrpnciinw7.cloudfront.net/500b-bench.jpg",p:"1"},{id:20,cdnUrl:"https://cdnperf.cachefly.net/500b-bench.jpg",p:"1"},{id:14,cdnUrl:"https://perfops.r.worldssl.net/500b-bench.jpg",p:"1"},{id:13,cdnUrl:"https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg",p:"1"},{id:24,cdnUrl:"https://img-cdnperf.mncdn.com/500b-bench.jpg",p:"1"},{id:11,cdnUrl:"https://perfops.b-cdn.net/500b-bench.jpg",p:"1"},{id:18,cdnUrl:"https://azure-perfops.azureedge.net/500b-bench.jpg",p:"1"},{id:8,cdnUrl:"https://perfops.gcdn.co/500b-bench.jpg",p:"1"},{id:15,cdnUrl:"https://cdnperf-rum.cdnetworks.net/500b-bench.jpg",p:"1"},{id:12,cdnUrl:"https://cdn.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg",p:"1"},{id:3,cdnUrl:"https://perfops.perfstack.cf-china.info/500b-bench.jpg",p:"1"},{id:4,cdnUrl:"https://fastly.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg",p:"1"},{id:9,cdnUrl:"https://1933886249.rsc.cdn77.org/500b-bench.jpg",p:"1"},{id:7,cdnUrl:"https://googlecdn.perfstack.net/500b-bench.jpg",p:"1"},{id:17,cdnUrl:"https://edgecast.perfstack.net/8086B5F/bench/500b-bench.jpg",p:"1"},{id:2,cdnUrl:"https://ovhcdn.perfstack.net/500b-bench.jpg",p:"1"},{id:1,cdnUrl:"https://kgmni17536myjst.belugacdn.link/500b-bench.jpg",p:"1"}]}}).then(function(n){var t=[],e={ua:navigator.userAgent},r=0,c=0;return function(n,r){return n.reduce(function(n,e){return n.then(function(t){return r(e).then(function(n){return t.push(n),t})})},u.resolve([]))}(n.data,function(n){return function(e){var r="".concat(e.cdnUrl,"?t=").concat(Date.now());return i(r).then(function(n){var t=performance.getEntriesByName(r)[0];return{id:e.id,up:1,time:Number((t.responseEnd-t.requestStart).toFixed(2)),headers:n.getAllResponseHeaders()}}).catch(function(){return{id:e.id,up:0}})}(n).then(function(n){if(o.push(n),n.up?2e3<n.time&&r++:c++,!(1<c||n.up&&(n.time<3||3e3<n.time)))return 2<=t.push(n)?(c=0,r<2?(r=0,s(e,t.splice(0,t.length))):(r=0,t.splice(0,t.length))):void 0})}).then(function(){if(c<=1&&t.length)return s(e,t)})}).then(e,h).then(function(){p=!0,c.forEach(function(n){return n()})})},1e3)}function s(n,t){return i("https://devnull.perfops.net/rum/v1",{data:JSON.stringify({metadata:n,data:t}),method:"POST"}).then(function(n){r=JSON.parse(n.response)}).catch(h)}n=function(){if(void 0!==window.performance)return"function"==typeof u?d():void function(n,t){var e,r=document.createElement("script");r.onreadystatechange=r.onload=function(){e||t(),e=!0},r.setAttribute("src",n),document.body.appendChild(r)}("https://cdn.jsdelivr.net/npm/es6-promise@4.2.4/dist/es6-promise.min.js",function(){u=window.ES6Promise,d()})},"complete"===document.readyState?n():window.addEventListener("load",n),window.perfopsRumJs={getResults:function(){return new u(function(n){if(p)return n(o);c.push(function(){return n(o)})})},getStoreMeta:function(){return new u(function(n){if(p)return n(r);c.push(function(){return n(r)})})}}}(window.Promise); | ||
"use strict";!function(u){var n,t=-1!==function(){}.toString().indexOf("minified")?{logInfo:console.log,logError:console.error}:{logInfo:function(){},logError:function(){}},e=t.logInfo,a=t.logError,c=window.rum?window.rum.key:void 0,r=null,i=[],o=[],d=!1;function p(r,n){var t=1<arguments.length&&void 0!==n?n:{},e=t.cb,o=void 0===e?function(){}:e,c=t.data,i=t.method,d=void 0===i?"GET":i,p=t.timeout,s=void 0===p?3e3:p;return new u(function(n,t){var e=new XMLHttpRequest;e.onload=function(){return n(e)},e.onerror=e.ontimeout=function(){a(e),t(new Error("Status ".concat(e.status,". Response: ").concat(e.statusText)))},e.open(d,r),e.timeout=s,o(e),e.send(c)})}function s(){setTimeout(function(){p("https://api.perfops.net/rum-cdn.php").then(function(n){return JSON.parse(n.response)}).then(function(n){if(!n||!n.data||!n.data.length)throw new Error("Empty response.data");return n}).catch(function(){return{data:[{id:1,cdnUrl:"https://kgmni17536myjst.belugacdn.link/500b-bench.jpg",p:"1"},{id:22,cdnUrl:"https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg",p:"0"},{id:8,cdnUrl:"https://perfops.gcdn.co/500b-bench.jpg",p:"1"},{id:7,cdnUrl:"https://googlecdn.perfstack.net/5002b-bench.jpg",p:"1"},{id:6,cdnUrl:"https://perfops-ade2.kxcdn.com/500b-bench.jpg",p:"1"},{id:5,cdnUrl:"https://d2axgrpnciinw7.cloudfront.net/500b-bench.jpg",p:"1"},{id:4,cdnUrl:"https://fastly.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg",p:"1"},{id:3,cdnUrl:"https://perfops.perfstack.cf-china.info/500b-bench.jpg",p:"1"},{id:29,cdnUrl:"https://25748s.ha.azioncdn.net/500b-bench.jpg",p:"0"},{id:24,cdnUrl:"https://img-cdnperf.mncdn.com/500b-bench.jpg",p:"1"},{id:20,cdnUrl:"https://cdnperf.cachefly.net/500b-bench.jpg",p:"1"},{id:10,cdnUrl:"https://akamai.perfstack.net/500b-bench.jpg",p:"1"},{id:2,cdnUrl:"https://ovhcdn.perfstack.net/500b-bench.jpg",p:"1"},{id:18,cdnUrl:"https://azure-perfops.azureedge.net/500b-bench.jpg",p:"1"},{id:17,cdnUrl:"https://edgecast.perfstack.net/8086B5F/bench/500b-bench.jpg",p:"1"},{id:15,cdnUrl:"https://cdnperf-rum.cdnetworks.net/500b-bench.jpg",p:"1"},{id:14,cdnUrl:"https://perfops.r.worldssl.net/500b-bench.jpg",p:"1"},{id:13,cdnUrl:"https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg",p:"1"},{id:12,cdnUrl:"https://cdn.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg",p:"1"},{id:11,cdnUrl:"https://perfops.b-cdn.net/500b-bench.jpg",p:"1"},{id:9,cdnUrl:"https://1933886249.rsc.cdn77.org/500b-bench.jpg",p:"1"}]}}).then(function(n){var t=[],e={ua:navigator.userAgent,hostname:window.location.hostname,client:c},r=0,o=0;return function(n,r){return n.reduce(function(n,e){return n.then(function(t){return r(e).then(function(n){return t.push(n),t})})},u.resolve([]))}(n.data,function(n){return function(r){var o="".concat(r.cdnUrl,"?t=").concat(Date.now());return p(o).then(function(n){var t=performance.getEntriesByName(o)[0],e={id:r.id};return 200<=n.status&&n.status<300&&(e=Object.assign({},e,{up:1,time:Number((t.responseEnd-t.requestStart).toFixed(2)),dnsLookupTime:Number((t.domainLookupEnd-t.domainLookupStart).toFixed(2)),headers:n.getAllResponseHeaders()})),300<=n.status&&n.status<=500&&(e=Object.assign({},e,{up:0,dnsLookupTime:Number((t.domainLookupEnd-t.domainLookupStart).toFixed(2)),headers:n.getAllResponseHeaders()})),e}).catch(function(){return{id:r.id,up:0}})}(n).then(function(n){if(i.push(n),n.up?2e3<n.time&&r++:o++,!(1<o||n.up&&(n.time<3||3e3<n.time)))return 2<=t.push(n)?(o=0,r<2?(r=0,h(e,t.splice(0,t.length))):(r=0,t.splice(0,t.length))):void 0})}).then(function(){if(o<=1&&t.length)return h(e,t)})}).then(e,a).then(function(){d=!0,o.forEach(function(n){return n()})})},1e3)}function h(n,t){return p("https://devnull.perfops.net/rum/v1",{data:JSON.stringify({metadata:n,data:t}),method:"POST"}).then(function(n){r=JSON.parse(n.response)}).catch(a)}n=function(){if(void 0!==window.performance)return"function"==typeof u?s():void function(n,t){var e,r=document.createElement("script");r.onreadystatechange=r.onload=function(){e||t(),e=!0},r.setAttribute("src",n),document.body.appendChild(r)}("https://cdn.jsdelivr.net/npm/es6-promise@4.2.4/dist/es6-promise.min.js",function(){u=window.ES6Promise,s()})},"complete"===document.readyState?n():window.addEventListener("load",n),window.perfopsRumJs={getResults:function(){return new u(function(n){if(d)return n(i);o.push(function(){return n(i)})})},getStoreMeta:function(){return new u(function(n){if(d)return n(r);o.push(function(){return n(r)})})}}}(window.Promise); |
129
dist/rom3.js
@@ -18,2 +18,3 @@ "use strict"; | ||
var clientKey = window.rum ? window.rum.key : undefined; | ||
var globalStoreMeta = null; | ||
@@ -38,7 +39,3 @@ var globalResults = []; | ||
xhr.onload = function () { | ||
if (xhr.status >= 200 && xhr.status < 300) { | ||
return resolve(xhr); | ||
} | ||
xhr.onerror(); | ||
return resolve(xhr); | ||
}; | ||
@@ -79,8 +76,26 @@ | ||
var timing = performance.getEntriesByName(url)[0]; | ||
return { | ||
id: resource.id, | ||
up: 1, | ||
time: Number((timing.responseEnd - timing.requestStart).toFixed(2)), | ||
headers: xhr.getAllResponseHeaders() | ||
var result = { | ||
id: resource.id | ||
}; | ||
if (xhr.status >= 200 && xhr.status < 300) { | ||
// Add success response measurements | ||
result = Object.assign({}, result, { | ||
up: 1, | ||
time: Number((timing.responseEnd - timing.requestStart).toFixed(2)), | ||
dnsLookupTime: Number((timing.domainLookupEnd - timing.domainLookupStart).toFixed(2)), | ||
headers: xhr.getAllResponseHeaders() | ||
}); | ||
} | ||
if (xhr.status >= 300 && xhr.status <= 500) { | ||
// HTTP Redirect/Error | ||
result = Object.assign({}, result, { | ||
up: 0, | ||
dnsLookupTime: Number((timing.domainLookupEnd - timing.domainLookupStart).toFixed(2)), | ||
headers: xhr.getAllResponseHeaders() | ||
}); | ||
} | ||
return result; | ||
}).catch(function () { | ||
@@ -145,24 +160,20 @@ return { | ||
"data": [{ | ||
"id": 16, | ||
"cdnUrl": "https://19405s.ha.azioncdn.net/500b-bench.jpg", | ||
"id": 1, | ||
"cdnUrl": "https://kgmni17536myjst.belugacdn.link/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 6, | ||
"cdnUrl": "https://perfops-ade2.kxcdn.com/500b-bench.jpg", | ||
"id": 22, | ||
"cdnUrl": "https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg", | ||
"p": "0" | ||
}, { | ||
"id": 8, | ||
"cdnUrl": "https://perfops.gcdn.co/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 10, | ||
"cdnUrl": "https://akamai.perfstack.net/500b-bench.jpg", | ||
"id": 7, | ||
"cdnUrl": "https://googlecdn.perfstack.net/5002b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 25, | ||
"cdnUrl": "https://perf.gamepiper.com/500b-bench.jpg", | ||
"p": "0" | ||
}, { | ||
"id": 26, | ||
"cdnUrl": "https://ngcdnperf.qtlglb.com/500b-bench.jpg", | ||
"p": "0" | ||
}, { | ||
"id": 22, | ||
"cdnUrl": "https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg", | ||
"id": 6, | ||
"cdnUrl": "https://perfops-ade2.kxcdn.com/500b-bench.jpg", | ||
"p": "1" | ||
@@ -174,13 +185,13 @@ }, { | ||
}, { | ||
"id": 20, | ||
"cdnUrl": "https://cdnperf.cachefly.net/500b-bench.jpg", | ||
"id": 4, | ||
"cdnUrl": "https://fastly.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 14, | ||
"cdnUrl": "https://perfops.r.worldssl.net/500b-bench.jpg", | ||
"id": 3, | ||
"cdnUrl": "https://perfops.perfstack.cf-china.info/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 13, | ||
"cdnUrl": "https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg", | ||
"p": "1" | ||
"id": 29, | ||
"cdnUrl": "https://25748s.ha.azioncdn.net/500b-bench.jpg", | ||
"p": "0" | ||
}, { | ||
@@ -191,6 +202,14 @@ "id": 24, | ||
}, { | ||
"id": 11, | ||
"cdnUrl": "https://perfops.b-cdn.net/500b-bench.jpg", | ||
"id": 20, | ||
"cdnUrl": "https://cdnperf.cachefly.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 10, | ||
"cdnUrl": "https://akamai.perfstack.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 2, | ||
"cdnUrl": "https://ovhcdn.perfstack.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 18, | ||
@@ -200,4 +219,4 @@ "cdnUrl": "https://azure-perfops.azureedge.net/500b-bench.jpg", | ||
}, { | ||
"id": 8, | ||
"cdnUrl": "https://perfops.gcdn.co/500b-bench.jpg", | ||
"id": 17, | ||
"cdnUrl": "https://edgecast.perfstack.net/8086B5F/bench/500b-bench.jpg", | ||
"p": "1" | ||
@@ -209,2 +228,10 @@ }, { | ||
}, { | ||
"id": 14, | ||
"cdnUrl": "https://perfops.r.worldssl.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 13, | ||
"cdnUrl": "https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 12, | ||
@@ -214,29 +241,9 @@ "cdnUrl": "https://cdn.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg", | ||
}, { | ||
"id": 3, | ||
"cdnUrl": "https://perfops.perfstack.cf-china.info/500b-bench.jpg", | ||
"id": 11, | ||
"cdnUrl": "https://perfops.b-cdn.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 4, | ||
"cdnUrl": "https://fastly.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 9, | ||
"cdnUrl": "https://1933886249.rsc.cdn77.org/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 7, | ||
"cdnUrl": "https://googlecdn.perfstack.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 17, | ||
"cdnUrl": "https://edgecast.perfstack.net/8086B5F/bench/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 2, | ||
"cdnUrl": "https://ovhcdn.perfstack.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 1, | ||
"cdnUrl": "https://kgmni17536myjst.belugacdn.link/500b-bench.jpg", | ||
"p": "1" | ||
}] | ||
@@ -247,3 +254,5 @@ }; | ||
var metadata = { | ||
ua: navigator.userAgent | ||
ua: navigator.userAgent, | ||
hostname: window.location.hostname, | ||
client: clientKey | ||
}; | ||
@@ -250,0 +259,0 @@ var tooSlow = 0; |
@@ -1,1 +0,1 @@ | ||
"use strict";!function(u){var n,t=-1!==function(){}.toString().indexOf("minified")?{logInfo:console.log,logError:console.error}:{logInfo:function(){},logError:function(){}},e=t.logInfo,h=t.logError,r=null,o=[],c=[],p=!1;function i(r,n){var t=1<arguments.length&&void 0!==n?n:{},e=t.cb,c=void 0===e?function(){}:e,o=t.data,p=t.method,i=void 0===p?"GET":p,d=t.timeout,s=void 0===d?3e3:d;return new u(function(n,t){var e=new XMLHttpRequest;e.onload=function(){if(200<=e.status&&e.status<300)return n(e);e.onerror()},e.onerror=e.ontimeout=function(){h(e),t(new Error("Status ".concat(e.status,". Response: ").concat(e.statusText)))},e.open(i,r),e.timeout=s,c(e),e.send(o)})}function d(){setTimeout(function(){i("https://api.perfops.net/rum-cdn.php").then(function(n){return JSON.parse(n.response)}).then(function(n){if(!n||!n.data||!n.data.length)throw new Error("Empty response.data");return n}).catch(function(){return{data:[{id:16,cdnUrl:"https://19405s.ha.azioncdn.net/500b-bench.jpg",p:"1"},{id:6,cdnUrl:"https://perfops-ade2.kxcdn.com/500b-bench.jpg",p:"1"},{id:10,cdnUrl:"https://akamai.perfstack.net/500b-bench.jpg",p:"1"},{id:25,cdnUrl:"https://perf.gamepiper.com/500b-bench.jpg",p:"0"},{id:26,cdnUrl:"https://ngcdnperf.qtlglb.com/500b-bench.jpg",p:"0"},{id:22,cdnUrl:"https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg",p:"1"},{id:5,cdnUrl:"https://d2axgrpnciinw7.cloudfront.net/500b-bench.jpg",p:"1"},{id:20,cdnUrl:"https://cdnperf.cachefly.net/500b-bench.jpg",p:"1"},{id:14,cdnUrl:"https://perfops.r.worldssl.net/500b-bench.jpg",p:"1"},{id:13,cdnUrl:"https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg",p:"1"},{id:24,cdnUrl:"https://img-cdnperf.mncdn.com/500b-bench.jpg",p:"1"},{id:11,cdnUrl:"https://perfops.b-cdn.net/500b-bench.jpg",p:"1"},{id:18,cdnUrl:"https://azure-perfops.azureedge.net/500b-bench.jpg",p:"1"},{id:8,cdnUrl:"https://perfops.gcdn.co/500b-bench.jpg",p:"1"},{id:15,cdnUrl:"https://cdnperf-rum.cdnetworks.net/500b-bench.jpg",p:"1"},{id:12,cdnUrl:"https://cdn.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg",p:"1"},{id:3,cdnUrl:"https://perfops.perfstack.cf-china.info/500b-bench.jpg",p:"1"},{id:4,cdnUrl:"https://fastly.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg",p:"1"},{id:9,cdnUrl:"https://1933886249.rsc.cdn77.org/500b-bench.jpg",p:"1"},{id:7,cdnUrl:"https://googlecdn.perfstack.net/500b-bench.jpg",p:"1"},{id:17,cdnUrl:"https://edgecast.perfstack.net/8086B5F/bench/500b-bench.jpg",p:"1"},{id:2,cdnUrl:"https://ovhcdn.perfstack.net/500b-bench.jpg",p:"1"},{id:1,cdnUrl:"https://kgmni17536myjst.belugacdn.link/500b-bench.jpg",p:"1"}]}}).then(function(n){var t=[],e={ua:navigator.userAgent},r=0,c=0;return function(n,r){return n.reduce(function(n,e){return n.then(function(t){return r(e).then(function(n){return t.push(n),t})})},u.resolve([]))}(n.data,function(n){return function(e){var r="".concat(e.cdnUrl,"?t=").concat(Date.now());return i(r).then(function(n){var t=performance.getEntriesByName(r)[0];return{id:e.id,up:1,time:Number((t.responseEnd-t.requestStart).toFixed(2)),headers:n.getAllResponseHeaders()}}).catch(function(){return{id:e.id,up:0}})}(n).then(function(n){if(o.push(n),n.up?2e3<n.time&&r++:c++,!(1<c||n.up&&(n.time<3||3e3<n.time)))return 2<=t.push(n)?(c=0,r<2?(r=0,s(e,t.splice(0,t.length))):(r=0,t.splice(0,t.length))):void 0})}).then(function(){if(c<=1&&t.length)return s(e,t)})}).then(e,h).then(function(){p=!0,c.forEach(function(n){return n()})})},3e3)}function s(n,t){return i("https://devnull.perfops.net/rum/v1",{data:JSON.stringify({metadata:n,data:t}),method:"POST"}).then(function(n){r=JSON.parse(n.response)}).catch(h)}n=function(){if(void 0!==window.performance)return"function"==typeof u?d():void function(n,t){var e,r=document.createElement("script");r.onreadystatechange=r.onload=function(){e||t(),e=!0},r.setAttribute("src",n),document.body.appendChild(r)}("https://cdn.jsdelivr.net/npm/es6-promise@4.2.4/dist/es6-promise.min.js",function(){u=window.ES6Promise,d()})},"complete"===document.readyState?n():window.addEventListener("load",n),window.perfopsRumJs={getResults:function(){return new u(function(n){if(p)return n(o);c.push(function(){return n(o)})})},getStoreMeta:function(){return new u(function(n){if(p)return n(r);c.push(function(){return n(r)})})}}}(window.Promise); | ||
"use strict";!function(u){var n,t=-1!==function(){}.toString().indexOf("minified")?{logInfo:console.log,logError:console.error}:{logInfo:function(){},logError:function(){}},e=t.logInfo,a=t.logError,c=window.rum?window.rum.key:void 0,r=null,i=[],o=[],d=!1;function p(r,n){var t=1<arguments.length&&void 0!==n?n:{},e=t.cb,o=void 0===e?function(){}:e,c=t.data,i=t.method,d=void 0===i?"GET":i,p=t.timeout,s=void 0===p?3e3:p;return new u(function(n,t){var e=new XMLHttpRequest;e.onload=function(){return n(e)},e.onerror=e.ontimeout=function(){a(e),t(new Error("Status ".concat(e.status,". Response: ").concat(e.statusText)))},e.open(d,r),e.timeout=s,o(e),e.send(c)})}function s(){setTimeout(function(){p("https://api.perfops.net/rum-cdn.php").then(function(n){return JSON.parse(n.response)}).then(function(n){if(!n||!n.data||!n.data.length)throw new Error("Empty response.data");return n}).catch(function(){return{data:[{id:1,cdnUrl:"https://kgmni17536myjst.belugacdn.link/500b-bench.jpg",p:"1"},{id:22,cdnUrl:"https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg",p:"0"},{id:8,cdnUrl:"https://perfops.gcdn.co/500b-bench.jpg",p:"1"},{id:7,cdnUrl:"https://googlecdn.perfstack.net/5002b-bench.jpg",p:"1"},{id:6,cdnUrl:"https://perfops-ade2.kxcdn.com/500b-bench.jpg",p:"1"},{id:5,cdnUrl:"https://d2axgrpnciinw7.cloudfront.net/500b-bench.jpg",p:"1"},{id:4,cdnUrl:"https://fastly.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg",p:"1"},{id:3,cdnUrl:"https://perfops.perfstack.cf-china.info/500b-bench.jpg",p:"1"},{id:29,cdnUrl:"https://25748s.ha.azioncdn.net/500b-bench.jpg",p:"0"},{id:24,cdnUrl:"https://img-cdnperf.mncdn.com/500b-bench.jpg",p:"1"},{id:20,cdnUrl:"https://cdnperf.cachefly.net/500b-bench.jpg",p:"1"},{id:10,cdnUrl:"https://akamai.perfstack.net/500b-bench.jpg",p:"1"},{id:2,cdnUrl:"https://ovhcdn.perfstack.net/500b-bench.jpg",p:"1"},{id:18,cdnUrl:"https://azure-perfops.azureedge.net/500b-bench.jpg",p:"1"},{id:17,cdnUrl:"https://edgecast.perfstack.net/8086B5F/bench/500b-bench.jpg",p:"1"},{id:15,cdnUrl:"https://cdnperf-rum.cdnetworks.net/500b-bench.jpg",p:"1"},{id:14,cdnUrl:"https://perfops.r.worldssl.net/500b-bench.jpg",p:"1"},{id:13,cdnUrl:"https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg",p:"1"},{id:12,cdnUrl:"https://cdn.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg",p:"1"},{id:11,cdnUrl:"https://perfops.b-cdn.net/500b-bench.jpg",p:"1"},{id:9,cdnUrl:"https://1933886249.rsc.cdn77.org/500b-bench.jpg",p:"1"}]}}).then(function(n){var t=[],e={ua:navigator.userAgent,hostname:window.location.hostname,client:c},r=0,o=0;return function(n,r){return n.reduce(function(n,e){return n.then(function(t){return r(e).then(function(n){return t.push(n),t})})},u.resolve([]))}(n.data,function(n){return function(r){var o="".concat(r.cdnUrl,"?t=").concat(Date.now());return p(o).then(function(n){var t=performance.getEntriesByName(o)[0],e={id:r.id};return 200<=n.status&&n.status<300&&(e=Object.assign({},e,{up:1,time:Number((t.responseEnd-t.requestStart).toFixed(2)),dnsLookupTime:Number((t.domainLookupEnd-t.domainLookupStart).toFixed(2)),headers:n.getAllResponseHeaders()})),300<=n.status&&n.status<=500&&(e=Object.assign({},e,{up:0,dnsLookupTime:Number((t.domainLookupEnd-t.domainLookupStart).toFixed(2)),headers:n.getAllResponseHeaders()})),e}).catch(function(){return{id:r.id,up:0}})}(n).then(function(n){if(i.push(n),n.up?2e3<n.time&&r++:o++,!(1<o||n.up&&(n.time<3||3e3<n.time)))return 2<=t.push(n)?(o=0,r<2?(r=0,h(e,t.splice(0,t.length))):(r=0,t.splice(0,t.length))):void 0})}).then(function(){if(o<=1&&t.length)return h(e,t)})}).then(e,a).then(function(){d=!0,o.forEach(function(n){return n()})})},3e3)}function h(n,t){return p("https://devnull.perfops.net/rum/v1",{data:JSON.stringify({metadata:n,data:t}),method:"POST"}).then(function(n){r=JSON.parse(n.response)}).catch(a)}n=function(){if(void 0!==window.performance)return"function"==typeof u?s():void function(n,t){var e,r=document.createElement("script");r.onreadystatechange=r.onload=function(){e||t(),e=!0},r.setAttribute("src",n),document.body.appendChild(r)}("https://cdn.jsdelivr.net/npm/es6-promise@4.2.4/dist/es6-promise.min.js",function(){u=window.ES6Promise,s()})},"complete"===document.readyState?n():window.addEventListener("load",n),window.perfopsRumJs={getResults:function(){return new u(function(n){if(d)return n(i);o.push(function(){return n(i)})})},getStoreMeta:function(){return new u(function(n){if(d)return n(r);o.push(function(){return n(r)})})}}}(window.Promise); |
{ | ||
"name": "perfops-rom", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"jsdelivr": "./dist/rom3.min.js", | ||
@@ -10,19 +10,19 @@ "description": "RUM code for https://perfops.net/", | ||
"devDependencies": { | ||
"@babel/core": "^7.5.5", | ||
"@babel/preset-env": "^7.5.5", | ||
"@martin-kolarik/eslint-config": "^2.0.0", | ||
"bluebird": "^3.5.5", | ||
"eslint": "^6.2.1", | ||
"eslint-plugin-chai-expect": "^2.0.1", | ||
"eslint-plugin-html": "^6.0.0", | ||
"eslint-plugin-node": "^9.1.0", | ||
"@babel/core": "^7.10.2", | ||
"@babel/preset-env": "^7.10.2", | ||
"@martin-kolarik/eslint-config": "^2.0.1", | ||
"bluebird": "^3.7.2", | ||
"del": "^5.1.0", | ||
"eslint": "^7.1.0", | ||
"eslint-plugin-chai-expect": "^2.1.0", | ||
"eslint-plugin-html": "^6.0.2", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"got": "^9.6.0", | ||
"gulp": "^3.9.1", | ||
"got": "^11.2.0", | ||
"gulp": "^4.0.2", | ||
"gulp-babel": "^8.0.0", | ||
"gulp-clean": "^0.4.0", | ||
"gulp-clone": "^2.0.1", | ||
"gulp-error-handle": "^1.0.1", | ||
"gulp-livereload": "^4.0.1", | ||
"gulp-rename": "^1.4.0", | ||
"gulp-livereload": "^4.0.2", | ||
"gulp-rename": "^2.0.0", | ||
"gulp-replace": "^1.0.0", | ||
@@ -29,0 +29,0 @@ "gulp-sourcemaps": "^2.6.5", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
29967
624
9