@lwrjs/o11y 0.10.0-alpha.4 → 0.10.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{getInstrumentation as t}from"o11y/client";import{MODULE_DEFINE as e,MODULE_DEFINE_COUNT as r,BOOTSTRAP_END as n,BOOTSTRAP_DURATION as s,MODULE_FETCH_DURATION as i,MAPPINGS_FETCH_DURATION as a,MODULE_FETCH as o,MAPPINGS_FETCH as c,ROUTER_NAV as m,ROUTER_VIEW as h,ROUTER_NAV_DURATION as l,ROUTER_VIEW_DURATION as u,BOOTSTRAP_ERROR as f,BOOTSTRAP_ERROR_COUNT as k,MODULE_FETCH_COUNT as g,MODULE_ERROR as p,MODULE_ERROR_COUNT as b,MAPPINGS_FETCH_COUNT as T,MAPPINGS_ERROR as y,MAPPINGS_ERROR_COUNT as W,ROUTER_NAV_COUNT as d,ROUTER_ERROR as v,ROUTER_ERROR_COUNT as E}from"lwr/metrics";const M=[o,c,m,h],w=[l,u],O={[f]:k,[e]:r,[o]:g,[p]:b,[c]:T,[y]:W,[m]:d,[v]:E},V=Object.keys(O);class x{constructor(t,e){this.config=e||{},this.instrumentation=t}track(){this.trackExistingMarks(),this.setupObserver()}trackExistingMarks(){const t=performance.getEntriesByType("mark").filter((t=>t.name.startsWith(e)));t.length>0&&this.instrumentation.incrementCounter(r,t.length)}setupObserver(){new PerformanceObserver((t=>{t.getEntries().forEach((t=>{const{name:e,duration:r,startTime:o}=t;e===n&&this.instrumentation.trackValue(s,o);const c=V.find((t=>e.startsWith(t)));c&&this.instrumentation.incrementCounter(O[c],1),this.config.enableModuleFetchTracking&&e.startsWith(i)&&this.instrumentation.trackValue(e,r),this.config.enableMappingFetchTracking&&e.startsWith(a)&&this.instrumentation.trackValue(e,r),w.some((t=>e.startsWith(t)))&&this.instrumentation.trackValue(e,r),M.some((t=>e.startsWith(t)))||performance.clearMarks(e)}))})).observe({entryTypes:["mark","measure"]})}}const C=void 0!==globalThis.performance&&"function"==typeof globalThis.performance.mark,j=globalThis.LWR,F={track:()=>{}};function B(e){const r=t("lwrjs"),n=j.metricsConfig||{};(C?new x(r,n):F).track()}export default
|
|
1
|
+
import{getInstrumentation as t}from"o11y/client";import{MODULE_DEFINE as e,MODULE_DEFINE_COUNT as r,BOOTSTRAP_END as n,BOOTSTRAP_DURATION as s,MODULE_FETCH_DURATION as i,MAPPINGS_FETCH_DURATION as a,MODULE_FETCH as o,MAPPINGS_FETCH as c,ROUTER_NAV as m,ROUTER_VIEW as h,ROUTER_NAV_DURATION as l,ROUTER_VIEW_DURATION as u,BOOTSTRAP_ERROR as f,BOOTSTRAP_ERROR_COUNT as k,MODULE_FETCH_COUNT as g,MODULE_ERROR as p,MODULE_ERROR_COUNT as b,MAPPINGS_FETCH_COUNT as T,MAPPINGS_ERROR as y,MAPPINGS_ERROR_COUNT as W,ROUTER_NAV_COUNT as d,ROUTER_ERROR as v,ROUTER_ERROR_COUNT as E}from"lwr/metrics";const M=[o,c,m,h],w=[l,u],O={[f]:k,[e]:r,[o]:g,[p]:b,[c]:T,[y]:W,[m]:d,[v]:E},V=Object.keys(O);class x{constructor(t,e){this.config=e||{},this.instrumentation=t}track(){this.trackExistingMarks(),this.setupObserver()}trackExistingMarks(){const t=performance.getEntriesByType("mark").filter((t=>t.name.startsWith(e)));t.length>0&&this.instrumentation.incrementCounter(r,t.length)}setupObserver(){new PerformanceObserver((t=>{t.getEntries().forEach((t=>{const{name:e,duration:r,startTime:o}=t;e===n&&this.instrumentation.trackValue(s,o);const c=V.find((t=>e.startsWith(t)));c&&this.instrumentation.incrementCounter(O[c],1),this.config.enableModuleFetchTracking&&e.startsWith(i)&&this.instrumentation.trackValue(e,r),this.config.enableMappingFetchTracking&&e.startsWith(a)&&this.instrumentation.trackValue(e,r),w.some((t=>e.startsWith(t)))&&this.instrumentation.trackValue(e,r),M.some((t=>e.startsWith(t)))||performance.clearMarks(e)}))})).observe({entryTypes:["mark","measure"]})}}const C=void 0!==globalThis.performance&&"function"==typeof globalThis.performance.mark,j=globalThis.LWR,F={track:()=>{}};function B(e){const r=t("lwrjs"),n=j.metricsConfig||{};(C?new x(r,n):F).track()}export{B as default};
|
|
2
|
+
//# sourceMappingURL=o11yService.js.map
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.10.0-alpha.
|
|
7
|
+
"version": "0.10.0-alpha.7",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -24,10 +24,12 @@
|
|
|
24
24
|
"build:bundle": "rollup --config scripts/rollup.moduleBundle.config.cjs"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@lwrjs/shared-utils": "0.10.0-alpha.
|
|
27
|
+
"@lwrjs/shared-utils": "0.10.0-alpha.7"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"rollup
|
|
30
|
+
"@rollup/plugin-sucrase": "^5.0.1",
|
|
31
|
+
"@rollup/plugin-terser": "^0.4.1",
|
|
32
|
+
"rollup": "^2.78.0"
|
|
31
33
|
},
|
|
32
34
|
"peerDependencies": {
|
|
33
35
|
"o11y": "244.x"
|
|
@@ -48,5 +50,5 @@
|
|
|
48
50
|
"engines": {
|
|
49
51
|
"node": ">=16.0.0 <20"
|
|
50
52
|
},
|
|
51
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "433dfb2be122a18ff6eddd39e05279f734de0e37"
|
|
52
54
|
}
|