perfops-rom
Advanced tools
Comparing version 1.1.17 to 1.1.18
123
dist/rom.js
@@ -20,10 +20,11 @@ "use strict"; | ||
var STORE_DATA_INTERVAL = 1000; // How often we should try to send data to the rum-parser | ||
var QUEUE_LIMIT = 2; // Defaults for repeats. Those could be overridden by settings from rum-cdn | ||
var REPEAT_DELAY = 60 * 1000; // How often the script will measure CDN performance while user staying on the same page | ||
var REPEAT_COUNT = 3; // How many times repeat | ||
// prettier-ignore | ||
var STORE_DATA_INTERVAL = 1000; // How often we should try to send data to the rum-parser | ||
var QUEUE_LIMIT = 2; // prettier-ignore | ||
var _ref = function () { | ||
@@ -147,2 +148,3 @@ /* minified */ | ||
if (resources && resources.expiry > Date.now()) { | ||
if (resources.config) setConfig(resources.config); | ||
return Promise.resolve(resources.data); | ||
@@ -160,4 +162,6 @@ } | ||
data: response.data, | ||
config: response.config, | ||
expiry: Date.now() + RESOURCES_TTL | ||
})); | ||
if (response.config) setConfig(response.config); | ||
return response.data; | ||
@@ -168,6 +172,18 @@ }).catch(function () { | ||
"data": [{ | ||
"id": 39, | ||
"cdnUrl": "https://cdnperf-rum.cdnetworks.net/500b-bench.jpg", | ||
"id": 30, | ||
"cdnUrl": "https://perfops.doracdn.com/500b-db-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 38, | ||
"cdnUrl": "https://perf.psychz.net/500b-bench.jpg", | ||
"p": 0 | ||
}, { | ||
"id": 2, | ||
"cdnUrl": "https://ovh-cdn.perfops.io/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 24, | ||
"cdnUrl": "https://img-cdnperf.mncdn.com/500b-bench.jpg", | ||
"p": 0 | ||
}, { | ||
"id": 17, | ||
@@ -177,6 +193,2 @@ "cdnUrl": "https://edgecast-cdn.perfops.io/500b-bench.jpg", | ||
}, { | ||
"id": 18, | ||
"cdnUrl": "https://azure-perfops.azureedge.net/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 22, | ||
@@ -186,32 +198,36 @@ "cdnUrl": "https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg", | ||
}, { | ||
"id": 36, | ||
"cdnUrl": "https://perfops-cc.cdn-tech.io/500b-cc-bench.jpg", | ||
"id": 13, | ||
"cdnUrl": "https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 39, | ||
"cdnUrl": "https://cdnperf-rum.cdnetworks.net/500b-bench.jpg", | ||
"p": 0 | ||
}, { | ||
"id": 30, | ||
"cdnUrl": "https://perfops.doracdn.com/500b-db-bench.jpg", | ||
"id": 7, | ||
"cdnUrl": "https://google-cdn.perfops.io/500b-google-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 10, | ||
"cdnUrl": "https://akamai-perfops2.azureedge.net/500b-bench.jpg", | ||
"id": 8, | ||
"cdnUrl": "https://perfops.gcdn.co/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 20, | ||
"cdnUrl": "https://cdnperf.cachefly.net/500b-bench.jpg", | ||
"id": 35, | ||
"cdnUrl": "https://cdn81795137.blazingcdn.net/500b-blz-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 5, | ||
"cdnUrl": "https://d2axgrpnciinw7.cloudfront.net/500b-bench.jpg", | ||
"id": 11, | ||
"cdnUrl": "https://perfops.b-cdn.net/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 12, | ||
"cdnUrl": "https://cdn.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg", | ||
"id": 20, | ||
"cdnUrl": "https://cdnperf.cachefly.net/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 3, | ||
"cdnUrl": "https://perfops.perfstack.cf-china.info/500b-bench.jpg", | ||
"id": 15, | ||
"cdnUrl": "https://cdnperf-rum.cdnetworks.net/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 8, | ||
"cdnUrl": "https://perfops.gcdn.co/500b-bench.jpg", | ||
"id": 18, | ||
"cdnUrl": "https://azure-perfops.azureedge.net/500b-bench.jpg", | ||
"p": 1 | ||
@@ -227,45 +243,33 @@ }, { | ||
}, { | ||
"id": 4, | ||
"cdnUrl": "https://fastly.jsdelivr.net/gh/ProspectOne/js-test@1.1/500b-bench.jpg", | ||
"p": 1 | ||
"id": 36, | ||
"cdnUrl": "https://perfops-cc.cdn-tech.io/500b-cc-bench.jpg", | ||
"p": 0 | ||
}, { | ||
"id": 13, | ||
"cdnUrl": "https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg", | ||
"id": 10, | ||
"cdnUrl": "https://akamai-perfops2.azureedge.net/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 7, | ||
"cdnUrl": "https://google-cdn.perfops.io/500b-google-bench.jpg", | ||
"id": 3, | ||
"cdnUrl": "https://perfops.perfstack.cf-china.info/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 1, | ||
"cdnUrl": "https://kgmni17536myjst.belugacdn.link/500b-bench.jpg", | ||
"id": 5, | ||
"cdnUrl": "https://d2axgrpnciinw7.cloudfront.net/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 35, | ||
"cdnUrl": "https://cdn81795137.blazingcdn.net/500b-blz-bench.jpg", | ||
"id": 4, | ||
"cdnUrl": "https://fastly.jsdelivr.net/gh/ProspectOne/js-test@1.1/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 2, | ||
"cdnUrl": "https://ovh-cdn.perfops.io/500b-bench.jpg", | ||
"id": 6, | ||
"cdnUrl": "https://perfops-ade2.kxcdn.com/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 24, | ||
"cdnUrl": "https://img-cdnperf.mncdn.com/500b-bench.jpg", | ||
"p": 0 | ||
}, { | ||
"id": 11, | ||
"cdnUrl": "https://perfops.b-cdn.net/500b-bench.jpg", | ||
"id": 1, | ||
"cdnUrl": "https://kgmni17536myjst.belugacdn.link/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 15, | ||
"cdnUrl": "https://cdnperf-rum.cdnetworks.net/500b-bench.jpg", | ||
"id": 12, | ||
"cdnUrl": "https://cdn.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 38, | ||
"cdnUrl": "https://perf.psychz.net/500b-bench.jpg", | ||
"p": 0 | ||
}, { | ||
"id": 6, | ||
"cdnUrl": "https://perfops-ade2.kxcdn.com/500b-bench.jpg", | ||
"p": 1 | ||
}] | ||
@@ -284,2 +288,11 @@ }; | ||
}); | ||
} | ||
function setConfig(config) { | ||
REPEAT_DELAY = config.interval ? parseInt(config.interval) * 1000 : REPEAT_DELAY; | ||
if (config.repeats) { | ||
REPEAT_COUNT = config.repeats === 'Infinite' ? Math.pow(2, 32) // 4294967296 | ||
: parseInt(config.repeats); | ||
} | ||
} // eslint-disable-next-line no-unused-vars | ||
@@ -286,0 +299,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,n){if(e){if("string"==typeof e)return _arrayLikeToArray(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,n):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,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}!function(d){var e,a="https://devnull.perfops.net",s="https://rum-cdn.perfops.net/providers",p=3e5,n=-1!==function(){}.toString().indexOf("minified")?{logInfo:console.log,logError:console.error}:{logInfo:function(){},logError:function(){}},u=n.logInfo,l=n.logError,h=window.rum?window.rum.key:void 0;function f(e){return Math.max(0,Number(e.toFixed(2)))}function g(r,e){var n=1<arguments.length&&void 0!==e?e:{},t=n.cb,o=void 0===t?function(){}:t,c=n.data,i=n.method,a=void 0===i?"GET":i,s=n.timeout,p=void 0===s?3e3:s;return new d(function(e,n){var t=new XMLHttpRequest;t.onload=function(){return e(t)},t.onerror=t.ontimeout=function(){l(t),n(new Error("Status ".concat(t.status,". Response: ").concat(t.statusText)))},t.open(a,r),t.timeout=p,o(t),t.send(c)})}function t(){function n(e){var n=0<arguments.length&&void 0!==e&&e;if(u("Try to store ".concat(o.length," items")),i&&0===o.length&&(u("Store data interval cleared"),clearInterval(r)),o.length<1)u("Batch is empty");else if(o.length<3&&!n)u("Batch is to small. Wait for more results");else{var t=o.reduce(function(e,n){return e+(2e3<n.time?1:0)},0);if(t===o.length)return u("Skip batch of a ".concat(t," slow probes")),void o.splice(0,t);(function(e,n){return g("".concat(a,"/rum/v1"),{data:JSON.stringify({metadata:e,data:n}),method:"POST"}).catch(function(e){throw l(e),n})})(c,o.splice(0,o.length)).then(function(){return u("Results stored")}).catch(function(e){var n;return(n=o).push.apply(n,_toConsumableArray(e))})}}var r,o=[],c={ua:navigator.userAgent,hostname:window.location.hostname,client:h},i=!1,t=0;setTimeout(function e(){i=!1,clearInterval(r),o=[],r=setInterval(n,1e3),function(){var n="perfops-rum-resources",e=JSON.parse(window.localStorage.getItem(n));return e&&e.expiry>Date.now()?d.resolve(e.data):g(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(n,JSON.stringify({data:e.data,expiry:Date.now()+p})),e.data}).catch(function(){return{data:[{id:39,cdnUrl:"https://cdnperf-rum.cdnetworks.net/500b-bench.jpg",p:0},{id:17,cdnUrl:"https://edgecast-cdn.perfops.io/500b-bench.jpg",p:1},{id:18,cdnUrl:"https://azure-perfops.azureedge.net/500b-bench.jpg",p:1},{id:22,cdnUrl:"https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg",p:0},{id:36,cdnUrl:"https://perfops-cc.cdn-tech.io/500b-cc-bench.jpg",p:0},{id:30,cdnUrl:"https://perfops.doracdn.com/500b-db-bench.jpg",p:1},{id:10,cdnUrl:"https://akamai-perfops2.azureedge.net/500b-bench.jpg",p:1},{id:20,cdnUrl:"https://cdnperf.cachefly.net/500b-bench.jpg",p:1},{id:5,cdnUrl:"https://d2axgrpnciinw7.cloudfront.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:8,cdnUrl:"https://perfops.gcdn.co/500b-bench.jpg",p:1},{id:9,cdnUrl:"https://1933886249.rsc.cdn77.org/500b-bench.jpg",p:1},{id:14,cdnUrl:"https://perfops.r.worldssl.net/500b-bench.jpg",p:1},{id:4,cdnUrl:"https://fastly.jsdelivr.net/gh/ProspectOne/js-test@1.1/500b-bench.jpg",p:1},{id:13,cdnUrl:"https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg",p:1},{id:7,cdnUrl:"https://google-cdn.perfops.io/500b-google-bench.jpg",p:1},{id:1,cdnUrl:"https://kgmni17536myjst.belugacdn.link/500b-bench.jpg",p:1},{id:35,cdnUrl:"https://cdn81795137.blazingcdn.net/500b-blz-bench.jpg",p:1},{id:2,cdnUrl:"https://ovh-cdn.perfops.io/500b-bench.jpg",p:1},{id:24,cdnUrl:"https://img-cdnperf.mncdn.com/500b-bench.jpg",p:0},{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:38,cdnUrl:"https://perf.psychz.net/500b-bench.jpg",p:0},{id:6,cdnUrl:"https://perfops-ade2.kxcdn.com/500b-bench.jpg",p:1}]}})}().then(function(e){var t;return function(e,r){return e.reduce(function(e,t){return e.then(function(n){return r(t).then(function(e){return n.push(e),n})})},d.resolve([]))}((t=e,Array.from(Array(Math.ceil(t.length/2)),function(e,n){return t.slice(2*n,2*n+2)})),function(e){var n=0;return d.all(e.map(function(e){return function(i){var a="".concat(i.cdnUrl,"?t=").concat(Date.now()),s=new URL(a).hostname;return g(a).then(function(e){var n=performance.getEntriesByName(a)[0],t={id:i.id,domain:s},r=f(n.domainLookupEnd-n.domainLookupStart),o=f(n.connectEnd-n.connectStart),c=0<o?f(n.connectEnd-n.secureConnectionStart):0;return 200<=e.status&&e.status<300&&(t=Object.assign({},t,{up:1,time:Number((n.responseEnd-n.requestStart).toFixed(2)),dnsLookupTime:r,tcpTime:o,sslTime:c,headers:e.getAllResponseHeaders()})),300<=e.status&&e.status<=500&&(t=Object.assign({},t,{up:0,dnsLookupTime:r,tcpTime:o,sslTime:c,headers:e.getAllResponseHeaders()})),t}).catch(function(){return{id:i.id,up:0}})}(e).then(function(e){e.up||n++,1<n||e.up&&(e.time<3||3e3<e.time)||o.push(e)})}))})}).then(u,l).then(function(){t+=1,n(i=!0)}).then(function(){t<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 t();!function(e,n){var t,r=document.createElement("script");r.onreadystatechange=r.onload=function(){t||n(),t=!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,t()})}},"complete"===document.readyState?e():window.addEventListener("load",e)}(window.Promise); | ||
"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,n){if(e){if("string"==typeof e)return _arrayLikeToArray(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,n):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,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}!function(d){var e,a="https://devnull.perfops.net",s="https://rum-cdn.perfops.net/providers",p=3e5,u=6e4,l=3,n=-1!==function(){}.toString().indexOf("minified")?{logInfo:console.log,logError:console.error}:{logInfo:function(){},logError:function(){}},f=n.logInfo,h=n.logError,g=window.rum?window.rum.key:void 0;function m(e){return Math.max(0,Number(e.toFixed(2)))}function b(r,e){var n=1<arguments.length&&void 0!==e?e:{},t=n.cb,o=void 0===t?function(){}:t,c=n.data,i=n.method,a=void 0===i?"GET":i,s=n.timeout,p=void 0===s?3e3:s;return new d(function(e,n){var t=new XMLHttpRequest;t.onload=function(){return e(t)},t.onerror=t.ontimeout=function(){h(t),n(new Error("Status ".concat(t.status,". Response: ").concat(t.statusText)))},t.open(a,r),t.timeout=p,o(t),t.send(c)})}function y(e){u=e.interval?1e3*parseInt(e.interval):u,e.repeats&&(l="Infinite"===e.repeats?Math.pow(2,32):parseInt(e.repeats))}function t(){function n(e){var n=0<arguments.length&&void 0!==e&&e;if(f("Try to store ".concat(o.length," items")),i&&0===o.length&&(f("Store data interval cleared"),clearInterval(r)),o.length<1)f("Batch is empty");else if(o.length<3&&!n)f("Batch is to small. Wait for more results");else{var t=o.reduce(function(e,n){return e+(2e3<n.time?1:0)},0);if(t===o.length)return f("Skip batch of a ".concat(t," slow probes")),void o.splice(0,t);(function(e,n){return b("".concat(a,"/rum/v1"),{data:JSON.stringify({metadata:e,data:n}),method:"POST"}).catch(function(e){throw h(e),n})})(c,o.splice(0,o.length)).then(function(){return f("Results stored")}).catch(function(e){var n;return(n=o).push.apply(n,_toConsumableArray(e))})}}var r,o=[],c={ua:navigator.userAgent,hostname:window.location.hostname,client:g},i=!1,t=0;setTimeout(function e(){i=!1,clearInterval(r),o=[],r=setInterval(n,1e3),function(){var n="perfops-rum-resources",e=JSON.parse(window.localStorage.getItem(n));return e&&e.expiry>Date.now()?(e.config&&y(e.config),d.resolve(e.data)):b(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(n,JSON.stringify({data:e.data,config:e.config,expiry:Date.now()+p})),e.config&&y(e.config),e.data}).catch(function(){return{data:[{id:30,cdnUrl:"https://perfops.doracdn.com/500b-db-bench.jpg",p:1},{id:38,cdnUrl:"https://perf.psychz.net/500b-bench.jpg",p:0},{id:2,cdnUrl:"https://ovh-cdn.perfops.io/500b-bench.jpg",p:1},{id:24,cdnUrl:"https://img-cdnperf.mncdn.com/500b-bench.jpg",p:0},{id:17,cdnUrl:"https://edgecast-cdn.perfops.io/500b-bench.jpg",p:1},{id:22,cdnUrl:"https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg",p:0},{id:13,cdnUrl:"https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg",p:1},{id:39,cdnUrl:"https://cdnperf-rum.cdnetworks.net/500b-bench.jpg",p:0},{id:7,cdnUrl:"https://google-cdn.perfops.io/500b-google-bench.jpg",p:1},{id:8,cdnUrl:"https://perfops.gcdn.co/500b-bench.jpg",p:1},{id:35,cdnUrl:"https://cdn81795137.blazingcdn.net/500b-blz-bench.jpg",p:1},{id:11,cdnUrl:"https://perfops.b-cdn.net/500b-bench.jpg",p:1},{id:20,cdnUrl:"https://cdnperf.cachefly.net/500b-bench.jpg",p:1},{id:15,cdnUrl:"https://cdnperf-rum.cdnetworks.net/500b-bench.jpg",p:1},{id:18,cdnUrl:"https://azure-perfops.azureedge.net/500b-bench.jpg",p:1},{id:9,cdnUrl:"https://1933886249.rsc.cdn77.org/500b-bench.jpg",p:1},{id:14,cdnUrl:"https://perfops.r.worldssl.net/500b-bench.jpg",p:1},{id:36,cdnUrl:"https://perfops-cc.cdn-tech.io/500b-cc-bench.jpg",p:0},{id:10,cdnUrl:"https://akamai-perfops2.azureedge.net/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:4,cdnUrl:"https://fastly.jsdelivr.net/gh/ProspectOne/js-test@1.1/500b-bench.jpg",p:1},{id:6,cdnUrl:"https://perfops-ade2.kxcdn.com/500b-bench.jpg",p:1},{id:1,cdnUrl:"https://kgmni17536myjst.belugacdn.link/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 t;return function(e,r){return e.reduce(function(e,t){return e.then(function(n){return r(t).then(function(e){return n.push(e),n})})},d.resolve([]))}((t=e,Array.from(Array(Math.ceil(t.length/2)),function(e,n){return t.slice(2*n,2*n+2)})),function(e){var n=0;return d.all(e.map(function(e){return function(i){var a="".concat(i.cdnUrl,"?t=").concat(Date.now()),s=new URL(a).hostname;return b(a).then(function(e){var n=performance.getEntriesByName(a)[0],t={id:i.id,domain:s},r=m(n.domainLookupEnd-n.domainLookupStart),o=m(n.connectEnd-n.connectStart),c=0<o?m(n.connectEnd-n.secureConnectionStart):0;return 200<=e.status&&e.status<300&&(t=Object.assign({},t,{up:1,time:Number((n.responseEnd-n.requestStart).toFixed(2)),dnsLookupTime:r,tcpTime:o,sslTime:c,headers:e.getAllResponseHeaders()})),300<=e.status&&e.status<=500&&(t=Object.assign({},t,{up:0,dnsLookupTime:r,tcpTime:o,sslTime:c,headers:e.getAllResponseHeaders()})),t}).catch(function(){return{id:i.id,up:0}})}(e).then(function(e){e.up||n++,1<n||e.up&&(e.time<3||3e3<e.time)||o.push(e)})}))})}).then(f,h).then(function(){t+=1,n(i=!0)}).then(function(){t<l&&setTimeout(e,u)})},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(){f("clear performance resource buffer"),performance.clearResourceTimings()},"function"==typeof d)return t();!function(e,n){var t,r=document.createElement("script");r.onreadystatechange=r.onload=function(){t||n(),t=!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,t()})}},"complete"===document.readyState?e():window.addEventListener("load",e)}(window.Promise); |
123
dist/rom3.js
@@ -20,10 +20,11 @@ "use strict"; | ||
var STORE_DATA_INTERVAL = 1000; // How often we should try to send data to the rum-parser | ||
var QUEUE_LIMIT = 2; // Defaults for repeats. Those could be overridden by settings from rum-cdn | ||
var REPEAT_DELAY = 60 * 1000; // How often the script will measure CDN performance while user staying on the same page | ||
var REPEAT_COUNT = 3; // How many times repeat | ||
// prettier-ignore | ||
var STORE_DATA_INTERVAL = 1000; // How often we should try to send data to the rum-parser | ||
var QUEUE_LIMIT = 2; // prettier-ignore | ||
var _ref = function () { | ||
@@ -147,2 +148,3 @@ /* minified */ | ||
if (resources && resources.expiry > Date.now()) { | ||
if (resources.config) setConfig(resources.config); | ||
return Promise.resolve(resources.data); | ||
@@ -160,4 +162,6 @@ } | ||
data: response.data, | ||
config: response.config, | ||
expiry: Date.now() + RESOURCES_TTL | ||
})); | ||
if (response.config) setConfig(response.config); | ||
return response.data; | ||
@@ -168,6 +172,18 @@ }).catch(function () { | ||
"data": [{ | ||
"id": 39, | ||
"cdnUrl": "https://cdnperf-rum.cdnetworks.net/500b-bench.jpg", | ||
"id": 30, | ||
"cdnUrl": "https://perfops.doracdn.com/500b-db-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 38, | ||
"cdnUrl": "https://perf.psychz.net/500b-bench.jpg", | ||
"p": 0 | ||
}, { | ||
"id": 2, | ||
"cdnUrl": "https://ovh-cdn.perfops.io/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 24, | ||
"cdnUrl": "https://img-cdnperf.mncdn.com/500b-bench.jpg", | ||
"p": 0 | ||
}, { | ||
"id": 17, | ||
@@ -177,6 +193,2 @@ "cdnUrl": "https://edgecast-cdn.perfops.io/500b-bench.jpg", | ||
}, { | ||
"id": 18, | ||
"cdnUrl": "https://azure-perfops.azureedge.net/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 22, | ||
@@ -186,32 +198,36 @@ "cdnUrl": "https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg", | ||
}, { | ||
"id": 36, | ||
"cdnUrl": "https://perfops-cc.cdn-tech.io/500b-cc-bench.jpg", | ||
"id": 13, | ||
"cdnUrl": "https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 39, | ||
"cdnUrl": "https://cdnperf-rum.cdnetworks.net/500b-bench.jpg", | ||
"p": 0 | ||
}, { | ||
"id": 30, | ||
"cdnUrl": "https://perfops.doracdn.com/500b-db-bench.jpg", | ||
"id": 7, | ||
"cdnUrl": "https://google-cdn.perfops.io/500b-google-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 10, | ||
"cdnUrl": "https://akamai-perfops2.azureedge.net/500b-bench.jpg", | ||
"id": 8, | ||
"cdnUrl": "https://perfops.gcdn.co/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 20, | ||
"cdnUrl": "https://cdnperf.cachefly.net/500b-bench.jpg", | ||
"id": 35, | ||
"cdnUrl": "https://cdn81795137.blazingcdn.net/500b-blz-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 5, | ||
"cdnUrl": "https://d2axgrpnciinw7.cloudfront.net/500b-bench.jpg", | ||
"id": 11, | ||
"cdnUrl": "https://perfops.b-cdn.net/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 12, | ||
"cdnUrl": "https://cdn.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg", | ||
"id": 20, | ||
"cdnUrl": "https://cdnperf.cachefly.net/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 3, | ||
"cdnUrl": "https://perfops.perfstack.cf-china.info/500b-bench.jpg", | ||
"id": 15, | ||
"cdnUrl": "https://cdnperf-rum.cdnetworks.net/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 8, | ||
"cdnUrl": "https://perfops.gcdn.co/500b-bench.jpg", | ||
"id": 18, | ||
"cdnUrl": "https://azure-perfops.azureedge.net/500b-bench.jpg", | ||
"p": 1 | ||
@@ -227,45 +243,33 @@ }, { | ||
}, { | ||
"id": 4, | ||
"cdnUrl": "https://fastly.jsdelivr.net/gh/ProspectOne/js-test@1.1/500b-bench.jpg", | ||
"p": 1 | ||
"id": 36, | ||
"cdnUrl": "https://perfops-cc.cdn-tech.io/500b-cc-bench.jpg", | ||
"p": 0 | ||
}, { | ||
"id": 13, | ||
"cdnUrl": "https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg", | ||
"id": 10, | ||
"cdnUrl": "https://akamai-perfops2.azureedge.net/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 7, | ||
"cdnUrl": "https://google-cdn.perfops.io/500b-google-bench.jpg", | ||
"id": 3, | ||
"cdnUrl": "https://perfops.perfstack.cf-china.info/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 1, | ||
"cdnUrl": "https://kgmni17536myjst.belugacdn.link/500b-bench.jpg", | ||
"id": 5, | ||
"cdnUrl": "https://d2axgrpnciinw7.cloudfront.net/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 35, | ||
"cdnUrl": "https://cdn81795137.blazingcdn.net/500b-blz-bench.jpg", | ||
"id": 4, | ||
"cdnUrl": "https://fastly.jsdelivr.net/gh/ProspectOne/js-test@1.1/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 2, | ||
"cdnUrl": "https://ovh-cdn.perfops.io/500b-bench.jpg", | ||
"id": 6, | ||
"cdnUrl": "https://perfops-ade2.kxcdn.com/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 24, | ||
"cdnUrl": "https://img-cdnperf.mncdn.com/500b-bench.jpg", | ||
"p": 0 | ||
}, { | ||
"id": 11, | ||
"cdnUrl": "https://perfops.b-cdn.net/500b-bench.jpg", | ||
"id": 1, | ||
"cdnUrl": "https://kgmni17536myjst.belugacdn.link/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 15, | ||
"cdnUrl": "https://cdnperf-rum.cdnetworks.net/500b-bench.jpg", | ||
"id": 12, | ||
"cdnUrl": "https://cdn.jsdelivr.net/gh/jimaek/js-test@1.1/500b-bench.jpg", | ||
"p": 1 | ||
}, { | ||
"id": 38, | ||
"cdnUrl": "https://perf.psychz.net/500b-bench.jpg", | ||
"p": 0 | ||
}, { | ||
"id": 6, | ||
"cdnUrl": "https://perfops-ade2.kxcdn.com/500b-bench.jpg", | ||
"p": 1 | ||
}] | ||
@@ -284,2 +288,11 @@ }; | ||
}); | ||
} | ||
function setConfig(config) { | ||
REPEAT_DELAY = config.interval ? parseInt(config.interval) * 1000 : REPEAT_DELAY; | ||
if (config.repeats) { | ||
REPEAT_COUNT = config.repeats === 'Infinite' ? Math.pow(2, 32) // 4294967296 | ||
: parseInt(config.repeats); | ||
} | ||
} // eslint-disable-next-line no-unused-vars | ||
@@ -286,0 +299,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,n){if(e){if("string"==typeof e)return _arrayLikeToArray(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,n):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,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}!function(d){var e,a="https://devnull.perfops.net",s="https://rum-cdn.perfops.net/providers",p=3e5,n=-1!==function(){}.toString().indexOf("minified")?{logInfo:console.log,logError:console.error}:{logInfo:function(){},logError:function(){}},u=n.logInfo,l=n.logError,h=window.rum?window.rum.key:void 0;function f(e){return Math.max(0,Number(e.toFixed(2)))}function g(r,e){var n=1<arguments.length&&void 0!==e?e:{},t=n.cb,o=void 0===t?function(){}:t,c=n.data,i=n.method,a=void 0===i?"GET":i,s=n.timeout,p=void 0===s?3e3:s;return new d(function(e,n){var t=new XMLHttpRequest;t.onload=function(){return e(t)},t.onerror=t.ontimeout=function(){l(t),n(new Error("Status ".concat(t.status,". Response: ").concat(t.statusText)))},t.open(a,r),t.timeout=p,o(t),t.send(c)})}function t(){function n(e){var n=0<arguments.length&&void 0!==e&&e;if(u("Try to store ".concat(o.length," items")),i&&0===o.length&&(u("Store data interval cleared"),clearInterval(r)),o.length<1)u("Batch is empty");else if(o.length<3&&!n)u("Batch is to small. Wait for more results");else{var t=o.reduce(function(e,n){return e+(2e3<n.time?1:0)},0);if(t===o.length)return u("Skip batch of a ".concat(t," slow probes")),void o.splice(0,t);(function(e,n){return g("".concat(a,"/rum/v1"),{data:JSON.stringify({metadata:e,data:n}),method:"POST"}).catch(function(e){throw l(e),n})})(c,o.splice(0,o.length)).then(function(){return u("Results stored")}).catch(function(e){var n;return(n=o).push.apply(n,_toConsumableArray(e))})}}var r,o=[],c={ua:navigator.userAgent,hostname:window.location.hostname,client:h},i=!1,t=0;setTimeout(function e(){i=!1,clearInterval(r),o=[],r=setInterval(n,1e3),function(){var n="perfops-rum-resources",e=JSON.parse(window.localStorage.getItem(n));return e&&e.expiry>Date.now()?d.resolve(e.data):g(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(n,JSON.stringify({data:e.data,expiry:Date.now()+p})),e.data}).catch(function(){return{data:[{id:39,cdnUrl:"https://cdnperf-rum.cdnetworks.net/500b-bench.jpg",p:0},{id:17,cdnUrl:"https://edgecast-cdn.perfops.io/500b-bench.jpg",p:1},{id:18,cdnUrl:"https://azure-perfops.azureedge.net/500b-bench.jpg",p:1},{id:22,cdnUrl:"https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg",p:0},{id:36,cdnUrl:"https://perfops-cc.cdn-tech.io/500b-cc-bench.jpg",p:0},{id:30,cdnUrl:"https://perfops.doracdn.com/500b-db-bench.jpg",p:1},{id:10,cdnUrl:"https://akamai-perfops2.azureedge.net/500b-bench.jpg",p:1},{id:20,cdnUrl:"https://cdnperf.cachefly.net/500b-bench.jpg",p:1},{id:5,cdnUrl:"https://d2axgrpnciinw7.cloudfront.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:8,cdnUrl:"https://perfops.gcdn.co/500b-bench.jpg",p:1},{id:9,cdnUrl:"https://1933886249.rsc.cdn77.org/500b-bench.jpg",p:1},{id:14,cdnUrl:"https://perfops.r.worldssl.net/500b-bench.jpg",p:1},{id:4,cdnUrl:"https://fastly.jsdelivr.net/gh/ProspectOne/js-test@1.1/500b-bench.jpg",p:1},{id:13,cdnUrl:"https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg",p:1},{id:7,cdnUrl:"https://google-cdn.perfops.io/500b-google-bench.jpg",p:1},{id:1,cdnUrl:"https://kgmni17536myjst.belugacdn.link/500b-bench.jpg",p:1},{id:35,cdnUrl:"https://cdn81795137.blazingcdn.net/500b-blz-bench.jpg",p:1},{id:2,cdnUrl:"https://ovh-cdn.perfops.io/500b-bench.jpg",p:1},{id:24,cdnUrl:"https://img-cdnperf.mncdn.com/500b-bench.jpg",p:0},{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:38,cdnUrl:"https://perf.psychz.net/500b-bench.jpg",p:0},{id:6,cdnUrl:"https://perfops-ade2.kxcdn.com/500b-bench.jpg",p:1}]}})}().then(function(e){var t;return function(e,r){return e.reduce(function(e,t){return e.then(function(n){return r(t).then(function(e){return n.push(e),n})})},d.resolve([]))}((t=e,Array.from(Array(Math.ceil(t.length/2)),function(e,n){return t.slice(2*n,2*n+2)})),function(e){var n=0;return d.all(e.map(function(e){return function(i){var a="".concat(i.cdnUrl,"?t=").concat(Date.now()),s=new URL(a).hostname;return g(a).then(function(e){var n=performance.getEntriesByName(a)[0],t={id:i.id,domain:s},r=f(n.domainLookupEnd-n.domainLookupStart),o=f(n.connectEnd-n.connectStart),c=0<o?f(n.connectEnd-n.secureConnectionStart):0;return 200<=e.status&&e.status<300&&(t=Object.assign({},t,{up:1,time:Number((n.responseEnd-n.requestStart).toFixed(2)),dnsLookupTime:r,tcpTime:o,sslTime:c,headers:e.getAllResponseHeaders()})),300<=e.status&&e.status<=500&&(t=Object.assign({},t,{up:0,dnsLookupTime:r,tcpTime:o,sslTime:c,headers:e.getAllResponseHeaders()})),t}).catch(function(){return{id:i.id,up:0}})}(e).then(function(e){e.up||n++,1<n||e.up&&(e.time<3||3e3<e.time)||o.push(e)})}))})}).then(u,l).then(function(){t+=1,n(i=!0)}).then(function(){t<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 t();!function(e,n){var t,r=document.createElement("script");r.onreadystatechange=r.onload=function(){t||n(),t=!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,t()})}},"complete"===document.readyState?e():window.addEventListener("load",e)}(window.Promise); | ||
"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,n){if(e){if("string"==typeof e)return _arrayLikeToArray(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,n):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,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}!function(d){var e,a="https://devnull.perfops.net",s="https://rum-cdn.perfops.net/providers",p=3e5,u=6e4,l=3,n=-1!==function(){}.toString().indexOf("minified")?{logInfo:console.log,logError:console.error}:{logInfo:function(){},logError:function(){}},f=n.logInfo,h=n.logError,g=window.rum?window.rum.key:void 0;function m(e){return Math.max(0,Number(e.toFixed(2)))}function b(r,e){var n=1<arguments.length&&void 0!==e?e:{},t=n.cb,o=void 0===t?function(){}:t,c=n.data,i=n.method,a=void 0===i?"GET":i,s=n.timeout,p=void 0===s?3e3:s;return new d(function(e,n){var t=new XMLHttpRequest;t.onload=function(){return e(t)},t.onerror=t.ontimeout=function(){h(t),n(new Error("Status ".concat(t.status,". Response: ").concat(t.statusText)))},t.open(a,r),t.timeout=p,o(t),t.send(c)})}function y(e){u=e.interval?1e3*parseInt(e.interval):u,e.repeats&&(l="Infinite"===e.repeats?Math.pow(2,32):parseInt(e.repeats))}function t(){function n(e){var n=0<arguments.length&&void 0!==e&&e;if(f("Try to store ".concat(o.length," items")),i&&0===o.length&&(f("Store data interval cleared"),clearInterval(r)),o.length<1)f("Batch is empty");else if(o.length<3&&!n)f("Batch is to small. Wait for more results");else{var t=o.reduce(function(e,n){return e+(2e3<n.time?1:0)},0);if(t===o.length)return f("Skip batch of a ".concat(t," slow probes")),void o.splice(0,t);(function(e,n){return b("".concat(a,"/rum/v1"),{data:JSON.stringify({metadata:e,data:n}),method:"POST"}).catch(function(e){throw h(e),n})})(c,o.splice(0,o.length)).then(function(){return f("Results stored")}).catch(function(e){var n;return(n=o).push.apply(n,_toConsumableArray(e))})}}var r,o=[],c={ua:navigator.userAgent,hostname:window.location.hostname,client:g},i=!1,t=0;setTimeout(function e(){i=!1,clearInterval(r),o=[],r=setInterval(n,1e3),function(){var n="perfops-rum-resources",e=JSON.parse(window.localStorage.getItem(n));return e&&e.expiry>Date.now()?(e.config&&y(e.config),d.resolve(e.data)):b(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(n,JSON.stringify({data:e.data,config:e.config,expiry:Date.now()+p})),e.config&&y(e.config),e.data}).catch(function(){return{data:[{id:30,cdnUrl:"https://perfops.doracdn.com/500b-db-bench.jpg",p:1},{id:38,cdnUrl:"https://perf.psychz.net/500b-bench.jpg",p:0},{id:2,cdnUrl:"https://ovh-cdn.perfops.io/500b-bench.jpg",p:1},{id:24,cdnUrl:"https://img-cdnperf.mncdn.com/500b-bench.jpg",p:0},{id:17,cdnUrl:"https://edgecast-cdn.perfops.io/500b-bench.jpg",p:1},{id:22,cdnUrl:"https://09d3da8545e855ce.cdn.gocache.net/500b-bench.jpg",p:0},{id:13,cdnUrl:"https://m9d7v5r2.map2.ssl.hwcdn.net/500b-bench.jpg",p:1},{id:39,cdnUrl:"https://cdnperf-rum.cdnetworks.net/500b-bench.jpg",p:0},{id:7,cdnUrl:"https://google-cdn.perfops.io/500b-google-bench.jpg",p:1},{id:8,cdnUrl:"https://perfops.gcdn.co/500b-bench.jpg",p:1},{id:35,cdnUrl:"https://cdn81795137.blazingcdn.net/500b-blz-bench.jpg",p:1},{id:11,cdnUrl:"https://perfops.b-cdn.net/500b-bench.jpg",p:1},{id:20,cdnUrl:"https://cdnperf.cachefly.net/500b-bench.jpg",p:1},{id:15,cdnUrl:"https://cdnperf-rum.cdnetworks.net/500b-bench.jpg",p:1},{id:18,cdnUrl:"https://azure-perfops.azureedge.net/500b-bench.jpg",p:1},{id:9,cdnUrl:"https://1933886249.rsc.cdn77.org/500b-bench.jpg",p:1},{id:14,cdnUrl:"https://perfops.r.worldssl.net/500b-bench.jpg",p:1},{id:36,cdnUrl:"https://perfops-cc.cdn-tech.io/500b-cc-bench.jpg",p:0},{id:10,cdnUrl:"https://akamai-perfops2.azureedge.net/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:4,cdnUrl:"https://fastly.jsdelivr.net/gh/ProspectOne/js-test@1.1/500b-bench.jpg",p:1},{id:6,cdnUrl:"https://perfops-ade2.kxcdn.com/500b-bench.jpg",p:1},{id:1,cdnUrl:"https://kgmni17536myjst.belugacdn.link/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 t;return function(e,r){return e.reduce(function(e,t){return e.then(function(n){return r(t).then(function(e){return n.push(e),n})})},d.resolve([]))}((t=e,Array.from(Array(Math.ceil(t.length/2)),function(e,n){return t.slice(2*n,2*n+2)})),function(e){var n=0;return d.all(e.map(function(e){return function(i){var a="".concat(i.cdnUrl,"?t=").concat(Date.now()),s=new URL(a).hostname;return b(a).then(function(e){var n=performance.getEntriesByName(a)[0],t={id:i.id,domain:s},r=m(n.domainLookupEnd-n.domainLookupStart),o=m(n.connectEnd-n.connectStart),c=0<o?m(n.connectEnd-n.secureConnectionStart):0;return 200<=e.status&&e.status<300&&(t=Object.assign({},t,{up:1,time:Number((n.responseEnd-n.requestStart).toFixed(2)),dnsLookupTime:r,tcpTime:o,sslTime:c,headers:e.getAllResponseHeaders()})),300<=e.status&&e.status<=500&&(t=Object.assign({},t,{up:0,dnsLookupTime:r,tcpTime:o,sslTime:c,headers:e.getAllResponseHeaders()})),t}).catch(function(){return{id:i.id,up:0}})}(e).then(function(e){e.up||n++,1<n||e.up&&(e.time<3||3e3<e.time)||o.push(e)})}))})}).then(f,h).then(function(){t+=1,n(i=!0)}).then(function(){t<l&&setTimeout(e,u)})},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(){f("clear performance resource buffer"),performance.clearResourceTimings()},"function"==typeof d)return t();!function(e,n){var t,r=document.createElement("script");r.onreadystatechange=r.onload=function(){t||n(),t=!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,t()})}},"complete"===document.readyState?e():window.addEventListener("load",e)}(window.Promise); |
{ | ||
"name": "perfops-rom", | ||
"version": "1.1.17", | ||
"version": "1.1.18", | ||
"jsdelivr": "./dist/rom3.min.js", | ||
@@ -5,0 +5,0 @@ "description": "RUM code for https://perfops.net/", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
46302
798
8