perfops-rom
Advanced tools
Comparing version 1.1.5 to 1.1.6-rc.1
128
dist/rom.js
@@ -26,3 +26,3 @@ "use strict"; | ||
var QUEUE_LIMIT = 3; | ||
var QUEUE_LIMIT = 2; | ||
@@ -41,3 +41,3 @@ var _ref = function () { | ||
var clientKey = window.rum ? window.rum.key : undefined; | ||
var clientKey = window.rum ? window.rum.key : undefined; // eslint-disable-next-line no-unused-vars | ||
@@ -100,10 +100,9 @@ function formatTiming(value) { | ||
id: resource.id | ||
}; | ||
var dnsLookupTime = formatTiming(timing.domainLookupEnd - timing.domainLookupStart); | ||
var tcpTime = formatTiming(timing.connectEnd - timing.connectStart); // In Firefox if connection was cached - secure connection time is calculated | ||
}; // const dnsLookupTime = formatTiming(timing.domainLookupEnd - timing.domainLookupStart); | ||
// const tcpTime = formatTiming(timing.connectEnd - timing.connectStart); | ||
// In Firefox if connection was cached - secure connection time is calculated | ||
// as a difference between the page is loaded and current request execution started | ||
// which is equal to the time spent on the page. That's why we check if actual tcp connection time is calculated. | ||
// const sslTime = tcpTime > 0 ? formatTiming(timing.connectEnd - timing.secureConnectionStart) : 0; | ||
var sslTime = tcpTime > 0 ? formatTiming(timing.connectEnd - timing.secureConnectionStart) : 0; | ||
if (xhr.status >= 200 && xhr.status < 300) { | ||
@@ -114,5 +113,5 @@ // Add success response measurements | ||
time: Number((timing.responseEnd - timing.requestStart).toFixed(2)), | ||
dnsLookupTime: dnsLookupTime, | ||
tcpTime: tcpTime, | ||
sslTime: sslTime, | ||
// dnsLookupTime, | ||
// tcpTime, | ||
// sslTime, | ||
headers: xhr.getAllResponseHeaders() | ||
@@ -122,13 +121,2 @@ }); | ||
if (xhr.status >= 300 && xhr.status <= 500) { | ||
// HTTP Redirect/Error | ||
result = Object.assign({}, result, { | ||
up: 0, | ||
dnsLookupTime: dnsLookupTime, | ||
tcpTime: tcpTime, | ||
sslTime: sslTime, | ||
headers: xhr.getAllResponseHeaders() | ||
}); | ||
} | ||
return result; | ||
@@ -167,14 +155,14 @@ }).catch(function () { | ||
"data": [{ | ||
"id": 2, | ||
"cdnUrl": "https://ovhcdn.perfstack.net/500b-bench.jpg", | ||
"id": 36, | ||
"cdnUrl": "https://perfops-cc.cdn-tech.io/500b-bench.jpg", | ||
"p": "0" | ||
}, { | ||
"id": 10, | ||
"cdnUrl": "https://akamai.perfstack.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 9, | ||
"cdnUrl": "https://1933886249.rsc.cdn77.org/500b-bench.jpg", | ||
"id": 12, | ||
"cdnUrl": "https://cdn.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 30, | ||
"cdnUrl": "https://perfops.doracdn.com/500b-bench.jpg", | ||
"p": "0" | ||
}, { | ||
"id": 17, | ||
@@ -184,12 +172,16 @@ "cdnUrl": "https://edgecast.perfstack.net/8086B5F/bench/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": 5, | ||
"cdnUrl": "https://d2axgrpnciinw7.cloudfront.net/500b-bench.jpg", | ||
"id": 15, | ||
"cdnUrl": "https://cdnperf-rum.cdnetworks.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 24, | ||
"cdnUrl": "https://img-cdnperf.mncdn.com/500b-bench.jpg", | ||
"id": 22, | ||
"cdnUrl": "https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg", | ||
"p": "0" | ||
}, { | ||
"id": 20, | ||
"cdnUrl": "https://cdnperf.cachefly.net/500b-bench.jpg", | ||
"p": "1" | ||
@@ -201,18 +193,14 @@ }, { | ||
}, { | ||
"id": 8, | ||
"cdnUrl": "https://perfops.gcdn.co/500b-bench.jpg", | ||
"id": 18, | ||
"cdnUrl": "https://azure-perfops.azureedge.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 4, | ||
"cdnUrl": "https://fastly.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg", | ||
"id": 14, | ||
"cdnUrl": "https://perfops.r.worldssl.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 15, | ||
"cdnUrl": "https://cdnperf-rum.cdnetworks.net/500b-bench.jpg", | ||
"id": 13, | ||
"cdnUrl": "https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 6, | ||
"cdnUrl": "https://perfops-ade2.kxcdn.com/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 7, | ||
@@ -222,18 +210,14 @@ "cdnUrl": "https://googlecdn.perfstack.net/5002b-bench.jpg", | ||
}, { | ||
"id": 14, | ||
"cdnUrl": "https://perfops.r.worldssl.net/500b-bench.jpg", | ||
"id": 2, | ||
"cdnUrl": "https://ovhcdn.perfstack.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 20, | ||
"cdnUrl": "https://cdnperf.cachefly.net/500b-bench.jpg", | ||
"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": 35, | ||
"cdnUrl": "https://cdn81795137.blazingcdn.net/500b-bench.jpg", | ||
"p": "0" | ||
}, { | ||
"id": 10, | ||
"cdnUrl": "https://akamai.perfstack.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 29, | ||
@@ -243,16 +227,32 @@ "cdnUrl": "https://25748s.ha.azioncdn.net/500b-bench.jpg", | ||
}, { | ||
"id": 22, | ||
"cdnUrl": "https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg", | ||
"id": 8, | ||
"cdnUrl": "https://perfops.gcdn.co/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 30, | ||
"cdnUrl": "https://perfops.doracdn.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": 34, | ||
"cdnUrl": "https://www.superveda.net/500b-bench.jpg", | ||
"p": "0" | ||
}, { | ||
"id": 18, | ||
"cdnUrl": "https://azure-perfops.azureedge.net/500b-bench.jpg", | ||
"id": 6, | ||
"cdnUrl": "https://perfops-ade2.kxcdn.com/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 13, | ||
"cdnUrl": "https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg", | ||
"id": 3, | ||
"cdnUrl": "https://perfops.perfstack.cf-china.info/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 12, | ||
"cdnUrl": "https://cdn.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg", | ||
"id": 9, | ||
"cdnUrl": "https://1933886249.rsc.cdn77.org/500b-bench.jpg", | ||
"p": "1" | ||
@@ -259,0 +259,0 @@ }] |
@@ -1,1 +0,1 @@ | ||
"use strict";function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(d){var e,i="https://devnull.perfops.net",s="https://api.perfops.net/rum-cdn.php",p=3e5,t=-1!==function(){}.toString().indexOf("minified")?{logInfo:console.log,logError:console.error}:{logInfo:function(){},logError:function(){}},u=t.logInfo,l=t.logError,f=window.rum?window.rum.key:void 0;function h(e){return Math.max(0,Number(e.toFixed(2)))}function m(r,e){var t=1<arguments.length&&void 0!==e?e:{},n=t.cb,o=void 0===n?function(){}:n,c=t.data,a=t.method,i=void 0===a?"GET":a,s=t.timeout,p=void 0===s?3e3:s;return new d(function(e,t){var n=new XMLHttpRequest;n.onload=function(){return e(n)},n.onerror=n.ontimeout=function(){l(n),t(new Error("Status ".concat(n.status,". Response: ").concat(n.statusText)))},n.open(i,r),n.timeout=p,o(n),n.send(c)})}function n(){function t(e){var t=0<arguments.length&&void 0!==e&&e;if(u("Try to store ".concat(o.length," items")),a&&0===o.length&&(u("Store data interval cleared"),clearInterval(r)),o.length<1)u("Batch is empty");else if(o.length<3&&!t)u("Batch is to small. Wait for more results");else{var n=o.reduce(function(e,t){return e+(2e3<t.time?1:0)},0);if(n===o.length)return u("Skip batch of a ".concat(n," slow probes")),void o.splice(0,n);(function(e,t){return m("".concat(i,"/rum/v1"),{data:JSON.stringify({metadata:e,data:t}),method:"POST"}).catch(function(e){throw l(e),t})})(c,o.splice(0,o.length)).then(function(){return u("Results stored")}).catch(function(e){var t;return(t=o).push.apply(t,_toConsumableArray(e))})}}var r,o=[],c={ua:navigator.userAgent,hostname:window.location.hostname,client:f},a=!1,n=0;setTimeout(function e(){a=!1,clearInterval(r),o=[],r=setInterval(t,1e3),function(){var t="perfops-rum-resources",e=JSON.parse(window.localStorage.getItem(t));return e&&e.expiry>Date.now()?d.resolve(e.data):m(s).then(function(e){return JSON.parse(e.response)}).then(function(e){if(!e||!e.data||!e.data.length)throw new Error("Empty response.data");return window.localStorage.setItem(t,JSON.stringify({data:e.data,expiry:Date.now()+p})),e.data}).catch(function(){return{data:[{id:2,cdnUrl:"https://ovhcdn.perfstack.net/500b-bench.jpg",p:"1"},{id:9,cdnUrl:"https://1933886249.rsc.cdn77.org/500b-bench.jpg",p:"1"},{id:30,cdnUrl:"https://perfops.doracdn.com/500b-bench.jpg",p:"0"},{id:17,cdnUrl:"https://edgecast.perfstack.net/8086B5F/bench/500b-bench.jpg",p:"1"},{id:3,cdnUrl:"https://perfops.perfstack.cf-china.info/500b-bench.jpg",p:"1"},{id:5,cdnUrl:"https://d2axgrpnciinw7.cloudfront.net/500b-bench.jpg",p:"1"},{id:24,cdnUrl:"https://img-cdnperf.mncdn.com/500b-bench.jpg",p:"1"},{id:1,cdnUrl:"https://kgmni17536myjst.belugacdn.link/500b-bench.jpg",p:"1"},{id:8,cdnUrl:"https://perfops.gcdn.co/500b-bench.jpg",p:"1"},{id:4,cdnUrl:"https://fastly.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg",p:"1"},{id:15,cdnUrl:"https://cdnperf-rum.cdnetworks.net/500b-bench.jpg",p:"1"},{id:6,cdnUrl:"https://perfops-ade2.kxcdn.com/500b-bench.jpg",p:"1"},{id:7,cdnUrl:"https://googlecdn.perfstack.net/5002b-bench.jpg",p:"1"},{id:14,cdnUrl:"https://perfops.r.worldssl.net/500b-bench.jpg",p:"1"},{id:20,cdnUrl:"https://cdnperf.cachefly.net/500b-bench.jpg",p:"1"},{id:11,cdnUrl:"https://perfops.b-cdn.net/500b-bench.jpg",p:"1"},{id:10,cdnUrl:"https://akamai.perfstack.net/500b-bench.jpg",p:"1"},{id:29,cdnUrl:"https://25748s.ha.azioncdn.net/500b-bench.jpg",p:"0"},{id:22,cdnUrl:"https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg",p:"0"},{id:18,cdnUrl:"https://azure-perfops.azureedge.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"}]}})}().then(function(e){var n;return function(e,r){return e.reduce(function(e,n){return e.then(function(t){return r(n).then(function(e){return t.push(e),t})})},d.resolve([]))}((n=e,Array.from(Array(Math.ceil(n.length/3)),function(e,t){return n.slice(3*t,3*t+3)})),function(e){var t=0;return d.all(e.map(function(e){return function(a){var i="".concat(a.cdnUrl,"?t=").concat(Date.now());return m(i).then(function(e){var t=performance.getEntriesByName(i)[0],n={id:a.id},r=h(t.domainLookupEnd-t.domainLookupStart),o=h(t.connectEnd-t.connectStart),c=0<o?h(t.connectEnd-t.secureConnectionStart):0;return 200<=e.status&&e.status<300&&(n=Object.assign({},n,{up:1,time:Number((t.responseEnd-t.requestStart).toFixed(2)),dnsLookupTime:r,tcpTime:o,sslTime:c,headers:e.getAllResponseHeaders()})),300<=e.status&&e.status<=500&&(n=Object.assign({},n,{up:0,dnsLookupTime:r,tcpTime:o,sslTime:c,headers:e.getAllResponseHeaders()})),n}).catch(function(){return{id:a.id,up:0}})}(e).then(function(e){e.up||t++,1<t||e.up&&(e.time<3||3e3<e.time)||o.push(e)})}))})}).then(u,l).then(function(){n+=1,t(a=!0)}).then(function(){n<3&&setTimeout(e,6e4)})},1e3)}e=function(){var e=["bot","headless","google","baidu","bing","msn","duckduckbot","teoma","slurp","yandex","phantomjs","pingdom","ahrefsbot"].join("|");if(new RegExp(e,"i").test(window.navigator.userAgent))console.warn("PerfOps RUM not launching due to suspicious userAgent:",window.navigator.userAgent);else if(void 0!==window.performance){if(performance.onresourcetimingbufferfull=function(){u("clear performance resource buffer"),performance.clearResourceTimings()},"function"==typeof d)return n();!function(e,t){var n,r=document.createElement("script");r.onreadystatechange=r.onload=function(){n||t(),n=!0},r.setAttribute("src",e),document.body.appendChild(r)}("https://cdn.jsdelivr.net/npm/es6-promise@4.2.4/dist/es6-promise.min.js",function(){d=window.ES6Promise,n()})}},"complete"===document.readyState?e():window.addEventListener("load",e)}(window.Promise); | ||
"use strict";function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(t,e):void 0}}function _iterableToArray(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}!function(d){var t,i="https://devnull.perfops.net",s="https://api.perfops.net/rum-cdn.php",p=3e5,e=-1!==function(){}.toString().indexOf("minified")?{logInfo:console.log,logError:console.error}:{logInfo:function(){},logError:function(){}},u=e.logInfo,l=e.logError,h=window.rum?window.rum.key:void 0;function f(r,t){var e=1<arguments.length&&void 0!==t?t:{},n=e.cb,o=void 0===n?function(){}:n,c=e.data,a=e.method,i=void 0===a?"GET":a,s=e.timeout,p=void 0===s?3e3:s;return new d(function(t,e){var n=new XMLHttpRequest;n.onload=function(){return t(n)},n.onerror=n.ontimeout=function(){l(n),e(new Error("Status ".concat(n.status,". Response: ").concat(n.statusText)))},n.open(i,r),n.timeout=p,o(n),n.send(c)})}function n(){function e(t){var e=0<arguments.length&&void 0!==t&&t;if(u("Try to store ".concat(o.length," items")),a&&0===o.length&&(u("Store data interval cleared"),clearInterval(r)),o.length<1)u("Batch is empty");else if(o.length<3&&!e)u("Batch is to small. Wait for more results");else{var n=o.reduce(function(t,e){return t+(2e3<e.time?1:0)},0);if(n===o.length)return u("Skip batch of a ".concat(n," slow probes")),void o.splice(0,n);(function(t,e){return f("".concat(i,"/rum/v1"),{data:JSON.stringify({metadata:t,data:e}),method:"POST"}).catch(function(t){throw l(t),e})})(c,o.splice(0,o.length)).then(function(){return u("Results stored")}).catch(function(t){var e;return(e=o).push.apply(e,_toConsumableArray(t))})}}var r,o=[],c={ua:navigator.userAgent,hostname:window.location.hostname,client:h},a=!1,n=0;setTimeout(function t(){a=!1,clearInterval(r),o=[],r=setInterval(e,1e3),function(){var e="perfops-rum-resources",t=JSON.parse(window.localStorage.getItem(e));return t&&t.expiry>Date.now()?d.resolve(t.data):f(s).then(function(t){return JSON.parse(t.response)}).then(function(t){if(!t||!t.data||!t.data.length)throw new Error("Empty response.data");return window.localStorage.setItem(e,JSON.stringify({data:t.data,expiry:Date.now()+p})),t.data}).catch(function(){return{data:[{id:36,cdnUrl:"https://perfops-cc.cdn-tech.io/500b-bench.jpg",p:"0"},{id:10,cdnUrl:"https://akamai.perfstack.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:17,cdnUrl:"https://edgecast.perfstack.net/8086B5F/bench/500b-bench.jpg",p:"1"},{id:11,cdnUrl:"https://perfops.b-cdn.net/500b-bench.jpg",p:"1"},{id:15,cdnUrl:"https://cdnperf-rum.cdnetworks.net/500b-bench.jpg",p:"1"},{id:22,cdnUrl:"https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg",p:"0"},{id:20,cdnUrl:"https://cdnperf.cachefly.net/500b-bench.jpg",p:"1"},{id:1,cdnUrl:"https://kgmni17536myjst.belugacdn.link/500b-bench.jpg",p:"1"},{id:18,cdnUrl:"https://azure-perfops.azureedge.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:7,cdnUrl:"https://googlecdn.perfstack.net/5002b-bench.jpg",p:"1"},{id:2,cdnUrl:"https://ovhcdn.perfstack.net/500b-bench.jpg",p:"1"},{id:24,cdnUrl:"https://img-cdnperf.mncdn.com/500b-bench.jpg",p:"1"},{id:35,cdnUrl:"https://cdn81795137.blazingcdn.net/500b-bench.jpg",p:"0"},{id:29,cdnUrl:"https://25748s.ha.azioncdn.net/500b-bench.jpg",p:"0"},{id:8,cdnUrl:"https://perfops.gcdn.co/500b-bench.jpg",p:"1"},{id:30,cdnUrl:"https://perfops.doracdn.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:34,cdnUrl:"https://www.superveda.net/500b-bench.jpg",p:"0"},{id:6,cdnUrl:"https://perfops-ade2.kxcdn.com/500b-bench.jpg",p:"1"},{id:3,cdnUrl:"https://perfops.perfstack.cf-china.info/500b-bench.jpg",p:"1"},{id:9,cdnUrl:"https://1933886249.rsc.cdn77.org/500b-bench.jpg",p:"1"}]}})}().then(function(t){var n;return function(t,r){return t.reduce(function(t,n){return t.then(function(e){return r(n).then(function(t){return e.push(t),e})})},d.resolve([]))}((n=t,Array.from(Array(Math.ceil(n.length/2)),function(t,e){return n.slice(2*e,2*e+2)})),function(t){var e=0;return d.all(t.map(function(t){return function(r){var o="".concat(r.cdnUrl,"?t=").concat(Date.now());return f(o).then(function(t){var e=performance.getEntriesByName(o)[0],n={id:r.id};return 200<=t.status&&t.status<300&&(n=Object.assign({},n,{up:1,time:Number((e.responseEnd-e.requestStart).toFixed(2)),headers:t.getAllResponseHeaders()})),n}).catch(function(){return{id:r.id,up:0}})}(t).then(function(t){t.up||e++,1<e||t.up&&(t.time<3||3e3<t.time)||o.push(t)})}))})}).then(u,l).then(function(){n+=1,e(a=!0)}).then(function(){n<3&&setTimeout(t,6e4)})},1e3)}t=function(){var t=["bot","headless","google","baidu","bing","msn","duckduckbot","teoma","slurp","yandex","phantomjs","pingdom","ahrefsbot"].join("|");if(new RegExp(t,"i").test(window.navigator.userAgent))console.warn("PerfOps RUM not launching due to suspicious userAgent:",window.navigator.userAgent);else if(void 0!==window.performance){if(performance.onresourcetimingbufferfull=function(){u("clear performance resource buffer"),performance.clearResourceTimings()},"function"==typeof d)return n();!function(t,e){var n,r=document.createElement("script");r.onreadystatechange=r.onload=function(){n||e(),n=!0},r.setAttribute("src",t),document.body.appendChild(r)}("https://cdn.jsdelivr.net/npm/es6-promise@4.2.4/dist/es6-promise.min.js",function(){d=window.ES6Promise,n()})}},"complete"===document.readyState?t():window.addEventListener("load",t)}(window.Promise); |
128
dist/rom3.js
@@ -26,3 +26,3 @@ "use strict"; | ||
var QUEUE_LIMIT = 3; | ||
var QUEUE_LIMIT = 2; | ||
@@ -41,3 +41,3 @@ var _ref = function () { | ||
var clientKey = window.rum ? window.rum.key : undefined; | ||
var clientKey = window.rum ? window.rum.key : undefined; // eslint-disable-next-line no-unused-vars | ||
@@ -100,10 +100,9 @@ function formatTiming(value) { | ||
id: resource.id | ||
}; | ||
var dnsLookupTime = formatTiming(timing.domainLookupEnd - timing.domainLookupStart); | ||
var tcpTime = formatTiming(timing.connectEnd - timing.connectStart); // In Firefox if connection was cached - secure connection time is calculated | ||
}; // const dnsLookupTime = formatTiming(timing.domainLookupEnd - timing.domainLookupStart); | ||
// const tcpTime = formatTiming(timing.connectEnd - timing.connectStart); | ||
// In Firefox if connection was cached - secure connection time is calculated | ||
// as a difference between the page is loaded and current request execution started | ||
// which is equal to the time spent on the page. That's why we check if actual tcp connection time is calculated. | ||
// const sslTime = tcpTime > 0 ? formatTiming(timing.connectEnd - timing.secureConnectionStart) : 0; | ||
var sslTime = tcpTime > 0 ? formatTiming(timing.connectEnd - timing.secureConnectionStart) : 0; | ||
if (xhr.status >= 200 && xhr.status < 300) { | ||
@@ -114,5 +113,5 @@ // Add success response measurements | ||
time: Number((timing.responseEnd - timing.requestStart).toFixed(2)), | ||
dnsLookupTime: dnsLookupTime, | ||
tcpTime: tcpTime, | ||
sslTime: sslTime, | ||
// dnsLookupTime, | ||
// tcpTime, | ||
// sslTime, | ||
headers: xhr.getAllResponseHeaders() | ||
@@ -122,13 +121,2 @@ }); | ||
if (xhr.status >= 300 && xhr.status <= 500) { | ||
// HTTP Redirect/Error | ||
result = Object.assign({}, result, { | ||
up: 0, | ||
dnsLookupTime: dnsLookupTime, | ||
tcpTime: tcpTime, | ||
sslTime: sslTime, | ||
headers: xhr.getAllResponseHeaders() | ||
}); | ||
} | ||
return result; | ||
@@ -167,14 +155,14 @@ }).catch(function () { | ||
"data": [{ | ||
"id": 2, | ||
"cdnUrl": "https://ovhcdn.perfstack.net/500b-bench.jpg", | ||
"id": 36, | ||
"cdnUrl": "https://perfops-cc.cdn-tech.io/500b-bench.jpg", | ||
"p": "0" | ||
}, { | ||
"id": 10, | ||
"cdnUrl": "https://akamai.perfstack.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 9, | ||
"cdnUrl": "https://1933886249.rsc.cdn77.org/500b-bench.jpg", | ||
"id": 12, | ||
"cdnUrl": "https://cdn.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 30, | ||
"cdnUrl": "https://perfops.doracdn.com/500b-bench.jpg", | ||
"p": "0" | ||
}, { | ||
"id": 17, | ||
@@ -184,12 +172,16 @@ "cdnUrl": "https://edgecast.perfstack.net/8086B5F/bench/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": 5, | ||
"cdnUrl": "https://d2axgrpnciinw7.cloudfront.net/500b-bench.jpg", | ||
"id": 15, | ||
"cdnUrl": "https://cdnperf-rum.cdnetworks.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 24, | ||
"cdnUrl": "https://img-cdnperf.mncdn.com/500b-bench.jpg", | ||
"id": 22, | ||
"cdnUrl": "https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg", | ||
"p": "0" | ||
}, { | ||
"id": 20, | ||
"cdnUrl": "https://cdnperf.cachefly.net/500b-bench.jpg", | ||
"p": "1" | ||
@@ -201,18 +193,14 @@ }, { | ||
}, { | ||
"id": 8, | ||
"cdnUrl": "https://perfops.gcdn.co/500b-bench.jpg", | ||
"id": 18, | ||
"cdnUrl": "https://azure-perfops.azureedge.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 4, | ||
"cdnUrl": "https://fastly.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg", | ||
"id": 14, | ||
"cdnUrl": "https://perfops.r.worldssl.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 15, | ||
"cdnUrl": "https://cdnperf-rum.cdnetworks.net/500b-bench.jpg", | ||
"id": 13, | ||
"cdnUrl": "https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 6, | ||
"cdnUrl": "https://perfops-ade2.kxcdn.com/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 7, | ||
@@ -222,18 +210,14 @@ "cdnUrl": "https://googlecdn.perfstack.net/5002b-bench.jpg", | ||
}, { | ||
"id": 14, | ||
"cdnUrl": "https://perfops.r.worldssl.net/500b-bench.jpg", | ||
"id": 2, | ||
"cdnUrl": "https://ovhcdn.perfstack.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 20, | ||
"cdnUrl": "https://cdnperf.cachefly.net/500b-bench.jpg", | ||
"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": 35, | ||
"cdnUrl": "https://cdn81795137.blazingcdn.net/500b-bench.jpg", | ||
"p": "0" | ||
}, { | ||
"id": 10, | ||
"cdnUrl": "https://akamai.perfstack.net/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 29, | ||
@@ -243,16 +227,32 @@ "cdnUrl": "https://25748s.ha.azioncdn.net/500b-bench.jpg", | ||
}, { | ||
"id": 22, | ||
"cdnUrl": "https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg", | ||
"id": 8, | ||
"cdnUrl": "https://perfops.gcdn.co/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 30, | ||
"cdnUrl": "https://perfops.doracdn.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": 34, | ||
"cdnUrl": "https://www.superveda.net/500b-bench.jpg", | ||
"p": "0" | ||
}, { | ||
"id": 18, | ||
"cdnUrl": "https://azure-perfops.azureedge.net/500b-bench.jpg", | ||
"id": 6, | ||
"cdnUrl": "https://perfops-ade2.kxcdn.com/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 13, | ||
"cdnUrl": "https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg", | ||
"id": 3, | ||
"cdnUrl": "https://perfops.perfstack.cf-china.info/500b-bench.jpg", | ||
"p": "1" | ||
}, { | ||
"id": 12, | ||
"cdnUrl": "https://cdn.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg", | ||
"id": 9, | ||
"cdnUrl": "https://1933886249.rsc.cdn77.org/500b-bench.jpg", | ||
"p": "1" | ||
@@ -259,0 +259,0 @@ }] |
@@ -1,1 +0,1 @@ | ||
"use strict";function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(d){var e,i="https://devnull.perfops.net",s="https://api.perfops.net/rum-cdn.php",p=3e5,t=-1!==function(){}.toString().indexOf("minified")?{logInfo:console.log,logError:console.error}:{logInfo:function(){},logError:function(){}},u=t.logInfo,l=t.logError,f=window.rum?window.rum.key:void 0;function h(e){return Math.max(0,Number(e.toFixed(2)))}function m(r,e){var t=1<arguments.length&&void 0!==e?e:{},n=t.cb,o=void 0===n?function(){}:n,c=t.data,a=t.method,i=void 0===a?"GET":a,s=t.timeout,p=void 0===s?3e3:s;return new d(function(e,t){var n=new XMLHttpRequest;n.onload=function(){return e(n)},n.onerror=n.ontimeout=function(){l(n),t(new Error("Status ".concat(n.status,". Response: ").concat(n.statusText)))},n.open(i,r),n.timeout=p,o(n),n.send(c)})}function n(){function t(e){var t=0<arguments.length&&void 0!==e&&e;if(u("Try to store ".concat(o.length," items")),a&&0===o.length&&(u("Store data interval cleared"),clearInterval(r)),o.length<1)u("Batch is empty");else if(o.length<3&&!t)u("Batch is to small. Wait for more results");else{var n=o.reduce(function(e,t){return e+(2e3<t.time?1:0)},0);if(n===o.length)return u("Skip batch of a ".concat(n," slow probes")),void o.splice(0,n);(function(e,t){return m("".concat(i,"/rum/v1"),{data:JSON.stringify({metadata:e,data:t}),method:"POST"}).catch(function(e){throw l(e),t})})(c,o.splice(0,o.length)).then(function(){return u("Results stored")}).catch(function(e){var t;return(t=o).push.apply(t,_toConsumableArray(e))})}}var r,o=[],c={ua:navigator.userAgent,hostname:window.location.hostname,client:f},a=!1,n=0;setTimeout(function e(){a=!1,clearInterval(r),o=[],r=setInterval(t,1e3),function(){var t="perfops-rum-resources",e=JSON.parse(window.localStorage.getItem(t));return e&&e.expiry>Date.now()?d.resolve(e.data):m(s).then(function(e){return JSON.parse(e.response)}).then(function(e){if(!e||!e.data||!e.data.length)throw new Error("Empty response.data");return window.localStorage.setItem(t,JSON.stringify({data:e.data,expiry:Date.now()+p})),e.data}).catch(function(){return{data:[{id:2,cdnUrl:"https://ovhcdn.perfstack.net/500b-bench.jpg",p:"1"},{id:9,cdnUrl:"https://1933886249.rsc.cdn77.org/500b-bench.jpg",p:"1"},{id:30,cdnUrl:"https://perfops.doracdn.com/500b-bench.jpg",p:"0"},{id:17,cdnUrl:"https://edgecast.perfstack.net/8086B5F/bench/500b-bench.jpg",p:"1"},{id:3,cdnUrl:"https://perfops.perfstack.cf-china.info/500b-bench.jpg",p:"1"},{id:5,cdnUrl:"https://d2axgrpnciinw7.cloudfront.net/500b-bench.jpg",p:"1"},{id:24,cdnUrl:"https://img-cdnperf.mncdn.com/500b-bench.jpg",p:"1"},{id:1,cdnUrl:"https://kgmni17536myjst.belugacdn.link/500b-bench.jpg",p:"1"},{id:8,cdnUrl:"https://perfops.gcdn.co/500b-bench.jpg",p:"1"},{id:4,cdnUrl:"https://fastly.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg",p:"1"},{id:15,cdnUrl:"https://cdnperf-rum.cdnetworks.net/500b-bench.jpg",p:"1"},{id:6,cdnUrl:"https://perfops-ade2.kxcdn.com/500b-bench.jpg",p:"1"},{id:7,cdnUrl:"https://googlecdn.perfstack.net/5002b-bench.jpg",p:"1"},{id:14,cdnUrl:"https://perfops.r.worldssl.net/500b-bench.jpg",p:"1"},{id:20,cdnUrl:"https://cdnperf.cachefly.net/500b-bench.jpg",p:"1"},{id:11,cdnUrl:"https://perfops.b-cdn.net/500b-bench.jpg",p:"1"},{id:10,cdnUrl:"https://akamai.perfstack.net/500b-bench.jpg",p:"1"},{id:29,cdnUrl:"https://25748s.ha.azioncdn.net/500b-bench.jpg",p:"0"},{id:22,cdnUrl:"https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg",p:"0"},{id:18,cdnUrl:"https://azure-perfops.azureedge.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"}]}})}().then(function(e){var n;return function(e,r){return e.reduce(function(e,n){return e.then(function(t){return r(n).then(function(e){return t.push(e),t})})},d.resolve([]))}((n=e,Array.from(Array(Math.ceil(n.length/3)),function(e,t){return n.slice(3*t,3*t+3)})),function(e){var t=0;return d.all(e.map(function(e){return function(a){var i="".concat(a.cdnUrl,"?t=").concat(Date.now());return m(i).then(function(e){var t=performance.getEntriesByName(i)[0],n={id:a.id},r=h(t.domainLookupEnd-t.domainLookupStart),o=h(t.connectEnd-t.connectStart),c=0<o?h(t.connectEnd-t.secureConnectionStart):0;return 200<=e.status&&e.status<300&&(n=Object.assign({},n,{up:1,time:Number((t.responseEnd-t.requestStart).toFixed(2)),dnsLookupTime:r,tcpTime:o,sslTime:c,headers:e.getAllResponseHeaders()})),300<=e.status&&e.status<=500&&(n=Object.assign({},n,{up:0,dnsLookupTime:r,tcpTime:o,sslTime:c,headers:e.getAllResponseHeaders()})),n}).catch(function(){return{id:a.id,up:0}})}(e).then(function(e){e.up||t++,1<t||e.up&&(e.time<3||3e3<e.time)||o.push(e)})}))})}).then(u,l).then(function(){n+=1,t(a=!0)}).then(function(){n<3&&setTimeout(e,6e4)})},3e3)}e=function(){var e=["bot","headless","google","baidu","bing","msn","duckduckbot","teoma","slurp","yandex","phantomjs","pingdom","ahrefsbot"].join("|");if(new RegExp(e,"i").test(window.navigator.userAgent))console.warn("PerfOps RUM not launching due to suspicious userAgent:",window.navigator.userAgent);else if(void 0!==window.performance){if(performance.onresourcetimingbufferfull=function(){u("clear performance resource buffer"),performance.clearResourceTimings()},"function"==typeof d)return n();!function(e,t){var n,r=document.createElement("script");r.onreadystatechange=r.onload=function(){n||t(),n=!0},r.setAttribute("src",e),document.body.appendChild(r)}("https://cdn.jsdelivr.net/npm/es6-promise@4.2.4/dist/es6-promise.min.js",function(){d=window.ES6Promise,n()})}},"complete"===document.readyState?e():window.addEventListener("load",e)}(window.Promise); | ||
"use strict";function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(t,e):void 0}}function _iterableToArray(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}!function(d){var t,i="https://devnull.perfops.net",s="https://api.perfops.net/rum-cdn.php",p=3e5,e=-1!==function(){}.toString().indexOf("minified")?{logInfo:console.log,logError:console.error}:{logInfo:function(){},logError:function(){}},u=e.logInfo,l=e.logError,h=window.rum?window.rum.key:void 0;function f(r,t){var e=1<arguments.length&&void 0!==t?t:{},n=e.cb,o=void 0===n?function(){}:n,c=e.data,a=e.method,i=void 0===a?"GET":a,s=e.timeout,p=void 0===s?3e3:s;return new d(function(t,e){var n=new XMLHttpRequest;n.onload=function(){return t(n)},n.onerror=n.ontimeout=function(){l(n),e(new Error("Status ".concat(n.status,". Response: ").concat(n.statusText)))},n.open(i,r),n.timeout=p,o(n),n.send(c)})}function n(){function e(t){var e=0<arguments.length&&void 0!==t&&t;if(u("Try to store ".concat(o.length," items")),a&&0===o.length&&(u("Store data interval cleared"),clearInterval(r)),o.length<1)u("Batch is empty");else if(o.length<3&&!e)u("Batch is to small. Wait for more results");else{var n=o.reduce(function(t,e){return t+(2e3<e.time?1:0)},0);if(n===o.length)return u("Skip batch of a ".concat(n," slow probes")),void o.splice(0,n);(function(t,e){return f("".concat(i,"/rum/v1"),{data:JSON.stringify({metadata:t,data:e}),method:"POST"}).catch(function(t){throw l(t),e})})(c,o.splice(0,o.length)).then(function(){return u("Results stored")}).catch(function(t){var e;return(e=o).push.apply(e,_toConsumableArray(t))})}}var r,o=[],c={ua:navigator.userAgent,hostname:window.location.hostname,client:h},a=!1,n=0;setTimeout(function t(){a=!1,clearInterval(r),o=[],r=setInterval(e,1e3),function(){var e="perfops-rum-resources",t=JSON.parse(window.localStorage.getItem(e));return t&&t.expiry>Date.now()?d.resolve(t.data):f(s).then(function(t){return JSON.parse(t.response)}).then(function(t){if(!t||!t.data||!t.data.length)throw new Error("Empty response.data");return window.localStorage.setItem(e,JSON.stringify({data:t.data,expiry:Date.now()+p})),t.data}).catch(function(){return{data:[{id:36,cdnUrl:"https://perfops-cc.cdn-tech.io/500b-bench.jpg",p:"0"},{id:10,cdnUrl:"https://akamai.perfstack.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:17,cdnUrl:"https://edgecast.perfstack.net/8086B5F/bench/500b-bench.jpg",p:"1"},{id:11,cdnUrl:"https://perfops.b-cdn.net/500b-bench.jpg",p:"1"},{id:15,cdnUrl:"https://cdnperf-rum.cdnetworks.net/500b-bench.jpg",p:"1"},{id:22,cdnUrl:"https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg",p:"0"},{id:20,cdnUrl:"https://cdnperf.cachefly.net/500b-bench.jpg",p:"1"},{id:1,cdnUrl:"https://kgmni17536myjst.belugacdn.link/500b-bench.jpg",p:"1"},{id:18,cdnUrl:"https://azure-perfops.azureedge.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:7,cdnUrl:"https://googlecdn.perfstack.net/5002b-bench.jpg",p:"1"},{id:2,cdnUrl:"https://ovhcdn.perfstack.net/500b-bench.jpg",p:"1"},{id:24,cdnUrl:"https://img-cdnperf.mncdn.com/500b-bench.jpg",p:"1"},{id:35,cdnUrl:"https://cdn81795137.blazingcdn.net/500b-bench.jpg",p:"0"},{id:29,cdnUrl:"https://25748s.ha.azioncdn.net/500b-bench.jpg",p:"0"},{id:8,cdnUrl:"https://perfops.gcdn.co/500b-bench.jpg",p:"1"},{id:30,cdnUrl:"https://perfops.doracdn.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:34,cdnUrl:"https://www.superveda.net/500b-bench.jpg",p:"0"},{id:6,cdnUrl:"https://perfops-ade2.kxcdn.com/500b-bench.jpg",p:"1"},{id:3,cdnUrl:"https://perfops.perfstack.cf-china.info/500b-bench.jpg",p:"1"},{id:9,cdnUrl:"https://1933886249.rsc.cdn77.org/500b-bench.jpg",p:"1"}]}})}().then(function(t){var n;return function(t,r){return t.reduce(function(t,n){return t.then(function(e){return r(n).then(function(t){return e.push(t),e})})},d.resolve([]))}((n=t,Array.from(Array(Math.ceil(n.length/2)),function(t,e){return n.slice(2*e,2*e+2)})),function(t){var e=0;return d.all(t.map(function(t){return function(r){var o="".concat(r.cdnUrl,"?t=").concat(Date.now());return f(o).then(function(t){var e=performance.getEntriesByName(o)[0],n={id:r.id};return 200<=t.status&&t.status<300&&(n=Object.assign({},n,{up:1,time:Number((e.responseEnd-e.requestStart).toFixed(2)),headers:t.getAllResponseHeaders()})),n}).catch(function(){return{id:r.id,up:0}})}(t).then(function(t){t.up||e++,1<e||t.up&&(t.time<3||3e3<t.time)||o.push(t)})}))})}).then(u,l).then(function(){n+=1,e(a=!0)}).then(function(){n<3&&setTimeout(t,6e4)})},3e3)}t=function(){var t=["bot","headless","google","baidu","bing","msn","duckduckbot","teoma","slurp","yandex","phantomjs","pingdom","ahrefsbot"].join("|");if(new RegExp(t,"i").test(window.navigator.userAgent))console.warn("PerfOps RUM not launching due to suspicious userAgent:",window.navigator.userAgent);else if(void 0!==window.performance){if(performance.onresourcetimingbufferfull=function(){u("clear performance resource buffer"),performance.clearResourceTimings()},"function"==typeof d)return n();!function(t,e){var n,r=document.createElement("script");r.onreadystatechange=r.onload=function(){n||e(),n=!0},r.setAttribute("src",t),document.body.appendChild(r)}("https://cdn.jsdelivr.net/npm/es6-promise@4.2.4/dist/es6-promise.min.js",function(){d=window.ES6Promise,n()})}},"complete"===document.readyState?t():window.addEventListener("load",t)}(window.Promise); |
{ | ||
"name": "perfops-rom", | ||
"version": "1.1.5", | ||
"version": "1.1.6-rc.1", | ||
"jsdelivr": "./dist/rom3.min.js", | ||
@@ -5,0 +5,0 @@ "description": "RUM code for https://perfops.net/", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
750
43028
2