New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@grafana/faro-instrumentation-performance-timeline

Package Overview
Dependencies
Maintainers
22
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@grafana/faro-instrumentation-performance-timeline - npm Package Compare versions

Comparing version 1.5.0 to 1.5.1

2

dist/bundle/faro-instrumentation-performance-timeline.iife.js

@@ -1,1 +0,1 @@

var GrafanaFaroInstrumentationPerformanceTimeline=function(e){"use strict";function r(e,r){return typeof e===r}const n=e=>!(e=>r(e,"null"))(e)&&r(e,"object"),t=e=>function(e,r){return Object.prototype.toString.call(e)===`[object ${r}]`}(e,"Array");function i(){}var o;!function(e){e[e.OFF=0]="OFF",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.VERBOSE=4]="VERBOSE"}(o||(o={}));const s={debug:i,error:i,info:i,prefix:"Faro",warn:i};o.ERROR;const a=Object.assign({},console);class f{constructor(){this.unpatchedConsole=a,this.internalLogger=s,this.config={},this.metas={}}logDebug(...e){this.internalLogger.debug(`${this.name}\n`,...e)}logInfo(...e){this.internalLogger.info(`${this.name}\n`,...e)}logWarn(...e){this.internalLogger.warn(`${this.name}\n`,...e)}logError(...e){this.internalLogger.error(`${this.name}\n`,...e)}}class u extends f{constructor(){super(...arguments),this.api={},this.transports={}}}const l=[{type:"navigation",buffered:!0},{type:"resource",buffered:!0}];return e.DEFAULT_PERFORMANCE_TIMELINE_ENTRY_TYPES=l,e.PerformanceTimelineInstrumentation=class extends u{constructor(e){var r,n,t;super(),this.options=e,this.name="@grafana/faro-web-sdk:instrumentation-performance-timeline",this.version="1.5.0",this.resourceTimingBufferSize=null!==(r=null==e?void 0:e.resourceTimingBufferSize)&&void 0!==r?r:250,this.maxResourceTimingBufferSize=null!==(n=null==e?void 0:e.maxResourceTimingBufferSize)&&void 0!==n?n:500,this.observeEntryTypes=null!==(t=null==e?void 0:e.observeEntryTypes)&&void 0!==t?t:l}initialize(){"PerformanceObserver"in window?(this.validateIfObservedEntryTypesSupportedByBrowser(),this.setIgnoredUrls(),this.configureResourceTimingBuffer(),this.registerPerformanceObserver(),this.observe()):this.internalLogger.info("Browser does not support PerformanceObserver, stopping initialization of PerformanceTimelineInstrumentation")}validateIfObservedEntryTypesSupportedByBrowser(){const e=[];for(const r of this.observeEntryTypes)PerformanceObserver.supportedEntryTypes.includes(r.type)||e.push(r.type);e.length>0&&(this.observeEntryTypes=this.observeEntryTypes.filter((r=>!e.includes(r.type))),this.internalLogger.info(`The following entryTypes are not supported by this browser: ${e}. Observing only supported entryTypes which are: ${this.observeEntryTypes.map((({type:e})=>e))}`))}setIgnoredUrls(){var e,r;this.ignoredUrls=null!==(r=null===(e=this.options)||void 0===e?void 0:e.ignoredUrls)&&void 0!==r?r:this.getIgnoreUrls()}configureResourceTimingBuffer(){performance.setResourceTimingBufferSize(this.resourceTimingBufferSize),performance.addEventListener("resourcetimingbufferfull",(()=>{this.internalLogger.info(`Resource Timing Buffer is full! Increasing buffer size to ${this.maxResourceTimingBufferSize}.`),performance.setResourceTimingBufferSize(this.maxResourceTimingBufferSize)}))}registerPerformanceObserver(){this.observer=new PerformanceObserver(this.handlePerformanceEntry.bind(this))}handlePerformanceEntry(e,r,n=0){var t,i;for(const r of e.getEntries()){if(null===(t=this.ignoredUrls)||void 0===t?void 0:t.some((e=>null!=r.name.match(e)))){this.internalLogger.info("Drop performance entry because it matches one of the ignored URLs");continue}let e=r.toJSON();if("function"==typeof(null===(i=this.options)||void 0===i?void 0:i.beforeEmit)){const r=this.options.beforeEmit(e);if(!1===r){this.internalLogger.info("Performance entry dropped because beforeEmit returned false.");continue}e=r}this.api.pushEvent("faro.performanceEntry",this.objectValuesToString(e))}n>0&&this.internalLogger.warn(`${n} entries got dropped due to the browser buffer being full.`)}observe(){var e;null===(e=this.observeEntryTypes)||void 0===e||e.forEach((e=>{var r;null===(r=this.observer)||void 0===r||r.observe(e)}))}getIgnoreUrls(){var e;return null===(e=this.transports.transports)||void 0===e?void 0:e.flatMap((e=>e.getIgnoreUrls()))}objectValuesToString(e={}){const r={};for(const[i,o]of Object.entries(e))t(o)?r[i]=0===o.length?JSON.stringify(o):o.map((e=>this.objectValuesToString(e))).toString():n(o)?r[i]=this.objectValuesToString():r[i]=o.toString();return r}},e}({});
var GrafanaFaroInstrumentationPerformanceTimeline=function(e){"use strict";function r(e,r){return typeof e===r}const n=e=>!(e=>r(e,"null"))(e)&&r(e,"object"),t=e=>function(e,r){return Object.prototype.toString.call(e)===`[object ${r}]`}(e,"Array");function i(){}var o;!function(e){e[e.OFF=0]="OFF",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.VERBOSE=4]="VERBOSE"}(o||(o={}));const s={debug:i,error:i,info:i,prefix:"Faro",warn:i};o.ERROR;const a=Object.assign({},console);class f{constructor(){this.unpatchedConsole=a,this.internalLogger=s,this.config={},this.metas={}}logDebug(...e){this.internalLogger.debug(`${this.name}\n`,...e)}logInfo(...e){this.internalLogger.info(`${this.name}\n`,...e)}logWarn(...e){this.internalLogger.warn(`${this.name}\n`,...e)}logError(...e){this.internalLogger.error(`${this.name}\n`,...e)}}class u extends f{constructor(){super(...arguments),this.api={},this.transports={}}}const l=[{type:"navigation",buffered:!0},{type:"resource",buffered:!0}];return e.DEFAULT_PERFORMANCE_TIMELINE_ENTRY_TYPES=l,e.PerformanceTimelineInstrumentation=class extends u{constructor(e){var r,n,t;super(),this.options=e,this.name="@grafana/faro-web-sdk:instrumentation-performance-timeline",this.version="1.5.1",this.resourceTimingBufferSize=null!==(r=null==e?void 0:e.resourceTimingBufferSize)&&void 0!==r?r:250,this.maxResourceTimingBufferSize=null!==(n=null==e?void 0:e.maxResourceTimingBufferSize)&&void 0!==n?n:500,this.observeEntryTypes=null!==(t=null==e?void 0:e.observeEntryTypes)&&void 0!==t?t:l}initialize(){"PerformanceObserver"in window?(this.validateIfObservedEntryTypesSupportedByBrowser(),this.setIgnoredUrls(),this.configureResourceTimingBuffer(),this.registerPerformanceObserver(),this.observe()):this.internalLogger.info("Browser does not support PerformanceObserver, stopping initialization of PerformanceTimelineInstrumentation")}validateIfObservedEntryTypesSupportedByBrowser(){const e=[];for(const r of this.observeEntryTypes)PerformanceObserver.supportedEntryTypes.includes(r.type)||e.push(r.type);e.length>0&&(this.observeEntryTypes=this.observeEntryTypes.filter((r=>!e.includes(r.type))),this.internalLogger.info(`The following entryTypes are not supported by this browser: ${e}. Observing only supported entryTypes which are: ${this.observeEntryTypes.map((({type:e})=>e))}`))}setIgnoredUrls(){var e,r;this.ignoredUrls=null!==(r=null===(e=this.options)||void 0===e?void 0:e.ignoredUrls)&&void 0!==r?r:this.getIgnoreUrls()}configureResourceTimingBuffer(){performance.setResourceTimingBufferSize(this.resourceTimingBufferSize),performance.addEventListener("resourcetimingbufferfull",(()=>{this.internalLogger.info(`Resource Timing Buffer is full! Increasing buffer size to ${this.maxResourceTimingBufferSize}.`),performance.setResourceTimingBufferSize(this.maxResourceTimingBufferSize)}))}registerPerformanceObserver(){this.observer=new PerformanceObserver(this.handlePerformanceEntry.bind(this))}handlePerformanceEntry(e,r,n=0){var t,i;for(const r of e.getEntries()){if(null===(t=this.ignoredUrls)||void 0===t?void 0:t.some((e=>null!=r.name.match(e)))){this.internalLogger.info("Drop performance entry because it matches one of the ignored URLs");continue}let e=r.toJSON();if("function"==typeof(null===(i=this.options)||void 0===i?void 0:i.beforeEmit)){const r=this.options.beforeEmit(e);if(!1===r){this.internalLogger.info("Performance entry dropped because beforeEmit returned false.");continue}e=r}this.api.pushEvent("faro.performanceEntry",this.objectValuesToString(e))}n>0&&this.internalLogger.warn(`${n} entries got dropped due to the browser buffer being full.`)}observe(){var e;null===(e=this.observeEntryTypes)||void 0===e||e.forEach((e=>{var r;null===(r=this.observer)||void 0===r||r.observe(e)}))}getIgnoreUrls(){var e;return null===(e=this.transports.transports)||void 0===e?void 0:e.flatMap((e=>e.getIgnoreUrls()))}objectValuesToString(e={}){const r={};for(const[i,o]of Object.entries(e))t(o)?r[i]=0===o.length?JSON.stringify(o):o.map((e=>this.objectValuesToString(e))).toString():n(o)?r[i]=this.objectValuesToString():r[i]=o.toString();return r}},e}({});

@@ -17,3 +17,3 @@ import { BaseInstrumentation } from '@grafana/faro-core';

readonly name = "@grafana/faro-web-sdk:instrumentation-performance-timeline";
readonly version = "1.5.0";
readonly version = "1.5.1";
private resourceTimingBufferSize;

@@ -20,0 +20,0 @@ private maxResourceTimingBufferSize;

@@ -17,3 +17,3 @@ import { BaseInstrumentation } from '@grafana/faro-core';

readonly name = "@grafana/faro-web-sdk:instrumentation-performance-timeline";
readonly version = "1.5.0";
readonly version = "1.5.1";
private resourceTimingBufferSize;

@@ -20,0 +20,0 @@ private maxResourceTimingBufferSize;

{
"name": "@grafana/faro-instrumentation-performance-timeline",
"version": "1.5.0",
"version": "1.5.1",
"description": "Faro instrumentation to capture Browser Performance Timeline data.",

@@ -53,3 +53,3 @@ "keywords": [

"devDependencies": {
"@grafana/faro-core": "^1.5.0"
"@grafana/faro-core": "^1.5.1"
},

@@ -59,3 +59,3 @@ "publishConfig": {

},
"gitHead": "d986f24a192207f16a04dc63f366f2fe5c570d06"
"gitHead": "fea9639ee406789bb4e3e5378da84a5fed4a563c"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc