@cloudcare/browser-rum 3.2.51 → 3.3.1
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.
- package/README.md +89 -1
- package/README.zh.md +105 -0
- package/bundle/dataflux-rum.js +1 -1
- package/cjs/boot/buildEnv.js +1 -1
- package/cjs/boot/perStartRum.js +16 -0
- package/cjs/boot/perStartRum.js.map +1 -1
- package/cjs/boot/recorderApi.js +197 -1
- package/cjs/boot/recorderApi.js.map +1 -1
- package/cjs/boot/rum.js +17 -2
- package/cjs/boot/rum.js.map +1 -1
- package/cjs/boot/rumPublicApi.js +63 -3
- package/cjs/boot/rumPublicApi.js.map +1 -1
- package/cjs/boot/startRecording.js +74 -4
- package/cjs/boot/startRecording.js.map +1 -1
- package/cjs/domain/configuration.js +99 -1
- package/cjs/domain/configuration.js.map +1 -1
- package/cjs/domain/deflate/deflateWorker.js +1 -1
- package/cjs/domain/replay/record/canvasAutoSnapshot.js +15 -0
- package/cjs/domain/replay/record/canvasAutoSnapshot.js.map +1 -0
- package/cjs/domain/replay/record/canvasCommandCapture.js +480 -0
- package/cjs/domain/replay/record/canvasCommandCapture.js.map +1 -0
- package/cjs/domain/replay/record/canvasCommandObserver.js +274 -0
- package/cjs/domain/replay/record/canvasCommandObserver.js.map +1 -0
- package/cjs/domain/replay/record/canvasCommandSerializeArgs.js +94 -0
- package/cjs/domain/replay/record/canvasCommandSerializeArgs.js.map +1 -0
- package/cjs/domain/replay/record/canvasContinuousScheduler.js +255 -0
- package/cjs/domain/replay/record/canvasContinuousScheduler.js.map +1 -0
- package/cjs/domain/replay/record/canvasEncodeBridge.js +247 -0
- package/cjs/domain/replay/record/canvasEncodeBridge.js.map +1 -0
- package/cjs/domain/replay/record/canvasEncodeWorker.js +154 -0
- package/cjs/domain/replay/record/canvasEncodeWorker.js.map +1 -0
- package/cjs/domain/replay/record/canvasFrameSignature.js +50 -0
- package/cjs/domain/replay/record/canvasFrameSignature.js.map +1 -0
- package/cjs/domain/replay/record/canvasMutationRecord.js +33 -0
- package/cjs/domain/replay/record/canvasMutationRecord.js.map +1 -0
- package/cjs/domain/replay/record/canvasObserver.js +190 -0
- package/cjs/domain/replay/record/canvasObserver.js.map +1 -0
- package/cjs/domain/replay/record/canvasReplayFixtures.js +105 -0
- package/cjs/domain/replay/record/canvasReplayFixtures.js.map +1 -0
- package/cjs/domain/replay/record/canvasSerializeArgs.js +110 -0
- package/cjs/domain/replay/record/canvasSerializeArgs.js.map +1 -0
- package/cjs/domain/replay/record/mutationBatch.js +7 -2
- package/cjs/domain/replay/record/mutationBatch.js.map +1 -1
- package/cjs/domain/replay/record/mutationObserver.js +382 -55
- package/cjs/domain/replay/record/mutationObserver.js.map +1 -1
- package/cjs/domain/replay/record/observers.js +8 -3
- package/cjs/domain/replay/record/observers.js.map +1 -1
- package/cjs/domain/replay/record/record.js +517 -1
- package/cjs/domain/replay/record/record.js.map +1 -1
- package/cjs/domain/replay/record/serializationUtils.js +60 -4
- package/cjs/domain/replay/record/serializationUtils.js.map +1 -1
- package/cjs/domain/replay/record/serialize.js +169 -46
- package/cjs/domain/replay/record/serialize.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/segment.js +58 -1
- package/cjs/domain/replay/segmentCollection/segment.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/segmentCollection.js +29 -3
- package/cjs/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
- package/cjs/domain/requestCollection.js +1 -1
- package/cjs/domain/requestCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/clickChain.js +1 -1
- package/cjs/domain/rumEventsCollection/actions/clickChain.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/interactionSelectorCache.js +2 -1
- package/cjs/domain/rumEventsCollection/actions/interactionSelectorCache.js.map +1 -1
- package/cjs/domain/rumEventsCollection/error/trackReportError.js +2 -2
- package/cjs/domain/rumEventsCollection/error/trackReportError.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/matchRequestResourceEntry.js +43 -39
- package/cjs/domain/rumEventsCollection/resource/matchRequestResourceEntry.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/resourceCollection.js +48 -8
- package/cjs/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/resourceTrackerManager.js +237 -0
- package/cjs/domain/rumEventsCollection/resource/resourceTrackerManager.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -1
- package/cjs/domain/rumSessionManager.js +2 -0
- package/cjs/domain/rumSessionManager.js.map +1 -1
- package/cjs/domain/tracing/jaegerTracer.js +6 -6
- package/cjs/domain/tracing/jaegerTracer.js.map +1 -1
- package/cjs/domain/tracing/skywalkingTracer.js +1 -1
- package/cjs/domain/tracing/skywalkingTracer.js.map +1 -1
- package/cjs/domain/tracing/traceIdentifier.js +22 -0
- package/cjs/domain/tracing/traceIdentifier.js.map +1 -1
- package/cjs/domain/tracing/zipkinMultiTracer.js +6 -6
- package/cjs/domain/tracing/zipkinMultiTracer.js.map +1 -1
- package/cjs/domain/tracing/zipkinSingleTracer.js +6 -6
- package/cjs/domain/tracing/zipkinSingleTracer.js.map +1 -1
- package/cjs/types/sessionReplayConstants.js +2 -2
- package/cjs/types/sessionReplayConstants.js.map +1 -1
- package/esm/boot/buildEnv.js +1 -1
- package/esm/boot/perStartRum.js +16 -0
- package/esm/boot/perStartRum.js.map +1 -1
- package/esm/boot/recorderApi.js +197 -1
- package/esm/boot/recorderApi.js.map +1 -1
- package/esm/boot/rum.js +17 -2
- package/esm/boot/rum.js.map +1 -1
- package/esm/boot/rumPublicApi.js +63 -3
- package/esm/boot/rumPublicApi.js.map +1 -1
- package/esm/boot/startRecording.js +75 -5
- package/esm/boot/startRecording.js.map +1 -1
- package/esm/domain/configuration.js +100 -2
- package/esm/domain/configuration.js.map +1 -1
- package/esm/domain/deflate/deflateWorker.js +1 -1
- package/esm/domain/replay/record/canvasAutoSnapshot.js +9 -0
- package/esm/domain/replay/record/canvasAutoSnapshot.js.map +1 -0
- package/esm/domain/replay/record/canvasCommandCapture.js +474 -0
- package/esm/domain/replay/record/canvasCommandCapture.js.map +1 -0
- package/esm/domain/replay/record/canvasCommandObserver.js +268 -0
- package/esm/domain/replay/record/canvasCommandObserver.js.map +1 -0
- package/esm/domain/replay/record/canvasCommandSerializeArgs.js +87 -0
- package/esm/domain/replay/record/canvasCommandSerializeArgs.js.map +1 -0
- package/esm/domain/replay/record/canvasContinuousScheduler.js +249 -0
- package/esm/domain/replay/record/canvasContinuousScheduler.js.map +1 -0
- package/esm/domain/replay/record/canvasEncodeBridge.js +240 -0
- package/esm/domain/replay/record/canvasEncodeBridge.js.map +1 -0
- package/esm/domain/replay/record/canvasEncodeWorker.js +146 -0
- package/esm/domain/replay/record/canvasEncodeWorker.js.map +1 -0
- package/esm/domain/replay/record/canvasFrameSignature.js +42 -0
- package/esm/domain/replay/record/canvasFrameSignature.js.map +1 -0
- package/esm/domain/replay/record/canvasMutationRecord.js +26 -0
- package/esm/domain/replay/record/canvasMutationRecord.js.map +1 -0
- package/esm/domain/replay/record/canvasObserver.js +184 -0
- package/esm/domain/replay/record/canvasObserver.js.map +1 -0
- package/esm/domain/replay/record/canvasReplayFixtures.js +96 -0
- package/esm/domain/replay/record/canvasReplayFixtures.js.map +1 -0
- package/esm/domain/replay/record/canvasSerializeArgs.js +101 -0
- package/esm/domain/replay/record/canvasSerializeArgs.js.map +1 -0
- package/esm/domain/replay/record/mutationBatch.js +7 -2
- package/esm/domain/replay/record/mutationBatch.js.map +1 -1
- package/esm/domain/replay/record/mutationObserver.js +382 -56
- package/esm/domain/replay/record/mutationObserver.js.map +1 -1
- package/esm/domain/replay/record/observers.js +8 -3
- package/esm/domain/replay/record/observers.js.map +1 -1
- package/esm/domain/replay/record/record.js +518 -2
- package/esm/domain/replay/record/record.js.map +1 -1
- package/esm/domain/replay/record/serializationUtils.js +58 -4
- package/esm/domain/replay/record/serializationUtils.js.map +1 -1
- package/esm/domain/replay/record/serialize.js +168 -47
- package/esm/domain/replay/record/serialize.js.map +1 -1
- package/esm/domain/replay/segmentCollection/segment.js +59 -2
- package/esm/domain/replay/segmentCollection/segment.js.map +1 -1
- package/esm/domain/replay/segmentCollection/segmentCollection.js +30 -4
- package/esm/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
- package/esm/domain/requestCollection.js +1 -1
- package/esm/domain/requestCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/clickChain.js +1 -1
- package/esm/domain/rumEventsCollection/actions/clickChain.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/interactionSelectorCache.js +2 -1
- package/esm/domain/rumEventsCollection/actions/interactionSelectorCache.js.map +1 -1
- package/esm/domain/rumEventsCollection/error/trackReportError.js +2 -2
- package/esm/domain/rumEventsCollection/error/trackReportError.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/matchRequestResourceEntry.js +43 -38
- package/esm/domain/rumEventsCollection/resource/matchRequestResourceEntry.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceCollection.js +50 -10
- package/esm/domain/rumEventsCollection/resource/resourceCollection.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceTrackerManager.js +231 -0
- package/esm/domain/rumEventsCollection/resource/resourceTrackerManager.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js.map +1 -1
- package/esm/domain/rumSessionManager.js +2 -0
- package/esm/domain/rumSessionManager.js.map +1 -1
- package/esm/domain/tracing/jaegerTracer.js +7 -7
- package/esm/domain/tracing/jaegerTracer.js.map +1 -1
- package/esm/domain/tracing/skywalkingTracer.js +1 -1
- package/esm/domain/tracing/skywalkingTracer.js.map +1 -1
- package/esm/domain/tracing/traceIdentifier.js +20 -0
- package/esm/domain/tracing/traceIdentifier.js.map +1 -1
- package/esm/domain/tracing/zipkinMultiTracer.js +7 -7
- package/esm/domain/tracing/zipkinMultiTracer.js.map +1 -1
- package/esm/domain/tracing/zipkinSingleTracer.js +7 -7
- package/esm/domain/tracing/zipkinSingleTracer.js.map +1 -1
- package/esm/types/sessionReplayConstants.js +2 -2
- package/esm/types/sessionReplayConstants.js.map +1 -1
- package/package.json +5 -5
- package/src/boot/perStartRum.js +16 -0
- package/src/boot/recorderApi.js +208 -1
- package/src/boot/rum.js +21 -2
- package/src/boot/rumPublicApi.js +70 -3
- package/src/boot/startRecording.js +99 -5
- package/src/domain/configuration.js +229 -1
- package/src/domain/replay/record/canvasAutoSnapshot.js +8 -0
- package/src/domain/replay/record/canvasCommandCapture.js +621 -0
- package/src/domain/replay/record/canvasCommandObserver.js +355 -0
- package/src/domain/replay/record/canvasCommandSerializeArgs.js +124 -0
- package/src/domain/replay/record/canvasContinuousScheduler.js +295 -0
- package/src/domain/replay/record/canvasEncodeBridge.js +299 -0
- package/src/domain/replay/record/canvasEncodeWorker.js +211 -0
- package/src/domain/replay/record/canvasFrameSignature.js +83 -0
- package/src/domain/replay/record/canvasMutationRecord.js +29 -0
- package/src/domain/replay/record/canvasObserver.js +279 -0
- package/src/domain/replay/record/canvasReplayFixtures.js +113 -0
- package/src/domain/replay/record/canvasSerializeArgs.js +129 -0
- package/src/domain/replay/record/mutationBatch.js +8 -2
- package/src/domain/replay/record/mutationObserver.js +462 -66
- package/src/domain/replay/record/observers.js +15 -3
- package/src/domain/replay/record/record.js +704 -2
- package/src/domain/replay/record/serializationUtils.js +75 -4
- package/src/domain/replay/record/serialize.js +217 -49
- package/src/domain/replay/segmentCollection/segment.js +65 -2
- package/src/domain/replay/segmentCollection/segmentCollection.js +46 -4
- package/src/domain/requestCollection.js +5 -1
- package/src/domain/rumEventsCollection/actions/clickChain.js +1 -1
- package/src/domain/rumEventsCollection/actions/interactionSelectorCache.js +2 -1
- package/src/domain/rumEventsCollection/error/trackReportError.js +3 -2
- package/src/domain/rumEventsCollection/resource/matchRequestResourceEntry.js +51 -46
- package/src/domain/rumEventsCollection/resource/resourceCollection.js +69 -10
- package/src/domain/rumEventsCollection/resource/resourceTrackerManager.js +264 -0
- package/src/domain/rumEventsCollection/view/trackCumulativeLayoutShift.js +0 -1
- package/src/domain/rumSessionManager.js +2 -0
- package/src/domain/tracing/jaegerTracer.js +16 -9
- package/src/domain/tracing/skywalkingTracer.js +1 -1
- package/src/domain/tracing/traceIdentifier.js +24 -0
- package/src/domain/tracing/zipkinMultiTracer.js +16 -9
- package/src/domain/tracing/zipkinSingleTracer.js +14 -7
- package/src/types/sessionReplayConstants.js +2 -2
- package/types/index.d.ts +148 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recorderApi.js","names":["noop","runOnReadyState","LifeCycleEventType","canUseEventBridge","bridgeSupports","BridgeCapability","PageExitReason","getReplayStats","getReplayStatsImpl","createDeflateEncoder","startDeflateWorker","DeflateWorkerStatus","getDeflateWorkerStatus","DeflateEncoderStreamId","RecorderStatus","Stopped","IntentToStart","Starting","Started","makeRecorderApi","startRecordingImpl","createDeflateWorkerImpl","RECORDS","isBrowserSupported","start","stop","takeSubsequentFullSnapshot","undefined","onRumStart","isRecording","state","status","startStrategy","stopStrategy","options","lifeCycle","configuration","sessionManager","viewContexts","worker","subscribe","SESSION_EXPIRED","PAGE_EXITED","pageExitEvent","reason","UNLOADING","SESSION_RENEWED","cachedDeflateEncoder","getOrCreateDeflateEncoder","REPLAY","session","findTrackedSession","sessionReplayAllowed","deflateEncoder","recordingImpl","stopRecording","Initialized","viewId","Array","from","CSSSupportsRule","URL","createObjectURL","NodeList","prototype"],"sources":["../../src/boot/recorderApi.js"],"sourcesContent":["import {\n noop,\n runOnReadyState,\n LifeCycleEventType,\n canUseEventBridge,\n bridgeSupports,\n BridgeCapability,\n PageExitReason\n} from '@cloudcare/browser-core'\n\nimport { getReplayStats as getReplayStatsImpl } from '../domain/replay/replayStats'\nimport {\n createDeflateEncoder,\n startDeflateWorker,\n DeflateWorkerStatus,\n getDeflateWorkerStatus,\n DeflateEncoderStreamId\n} from '../domain/deflate'\nvar RecorderStatus = {\n // The recorder is stopped.\n Stopped: 0,\n // The user started the recording while it wasn't possible yet. The recorder should start as soon\n // as possible.\n IntentToStart: 1,\n // The recorder is starting. It does not record anything yet.\n Starting: 2,\n // The recorder is started, it records the session.\n Started: 3\n}\n\nexport function makeRecorderApi(startRecordingImpl, createDeflateWorkerImpl) {\n if (\n (canUseEventBridge() && !bridgeSupports(BridgeCapability.RECORDS)) ||\n !isBrowserSupported()\n ) {\n return {\n start: noop,\n stop: noop,\n takeSubsequentFullSnapshot: noop,\n getReplayStats: function () {\n return undefined\n },\n onRumStart: noop,\n isRecording: function () {\n return false\n }\n }\n }\n\n var state = {\n status: RecorderStatus.Stopped\n }\n\n var startStrategy = function () {\n state = { status: RecorderStatus.IntentToStart }\n }\n var stopStrategy = function () {\n state = { status: RecorderStatus.Stopped }\n }\n var takeSubsequentFullSnapshot = function () {}\n return {\n start: function (options) {\n startStrategy(options)\n },\n stop: function () {\n stopStrategy()\n },\n\n onRumStart: function (\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n worker\n ) {\n lifeCycle.subscribe(LifeCycleEventType.SESSION_EXPIRED, function () {\n if (\n state.status === RecorderStatus.Starting ||\n state.status === RecorderStatus.Started\n ) {\n stopStrategy()\n state = { status: RecorderStatus.IntentToStart }\n }\n })\n lifeCycle.subscribe(\n LifeCycleEventType.PAGE_EXITED,\n function (pageExitEvent) {\n if (pageExitEvent.reason === PageExitReason.UNLOADING) {\n stopStrategy()\n }\n }\n )\n lifeCycle.subscribe(LifeCycleEventType.SESSION_RENEWED, function () {\n if (state.status === RecorderStatus.IntentToStart) {\n startStrategy()\n }\n })\n var cachedDeflateEncoder\n function getOrCreateDeflateEncoder() {\n if (!cachedDeflateEncoder) {\n if (!worker) {\n worker = startDeflateWorker(\n configuration,\n 'Session Replay',\n function () {\n stopStrategy()\n },\n createDeflateWorkerImpl\n )\n }\n if (worker) {\n cachedDeflateEncoder = createDeflateEncoder(\n worker,\n DeflateEncoderStreamId.REPLAY\n )\n }\n }\n return cachedDeflateEncoder\n }\n startStrategy = function (options) {\n var session = sessionManager.findTrackedSession()\n if (!session || !session.sessionReplayAllowed) {\n state = { status: RecorderStatus.IntentToStart }\n return\n }\n\n if (\n state.status === RecorderStatus.Starting ||\n state.status === RecorderStatus.Started\n ) {\n return\n }\n\n state = { status: RecorderStatus.Starting }\n\n runOnReadyState('interactive', function () {\n if (state.status !== RecorderStatus.Starting) {\n return\n }\n var deflateEncoder = getOrCreateDeflateEncoder()\n if (!deflateEncoder) {\n state = {\n status: RecorderStatus.Stopped\n }\n return\n }\n var recordingImpl = startRecordingImpl(\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n deflateEncoder\n )\n state = {\n status: RecorderStatus.Started,\n stopRecording: recordingImpl.stop,\n takeSubsequentFullSnapshot: recordingImpl.takeSubsequentFullSnapshot\n }\n })\n }\n\n stopStrategy = function () {\n if (state.status === RecorderStatus.Stopped) {\n return\n }\n\n if (state.status === RecorderStatus.Started) {\n state.stopRecording()\n }\n\n state = {\n status: RecorderStatus.Stopped\n }\n }\n takeSubsequentFullSnapshot = function () {\n state.takeSubsequentFullSnapshot()\n }\n if (state.status === RecorderStatus.IntentToStart) {\n startStrategy()\n }\n },\n takeSubsequentFullSnapshot() {\n takeSubsequentFullSnapshot()\n },\n isRecording: function () {\n return (\n getDeflateWorkerStatus() === DeflateWorkerStatus.Initialized &&\n state.status === RecorderStatus.Started\n )\n },\n getReplayStats: function (viewId) {\n return getDeflateWorkerStatus() === DeflateWorkerStatus.Initialized\n ? getReplayStatsImpl(viewId)\n : undefined\n }\n }\n}\n\n/**\n * Test for Browser features used while recording\n */\nfunction isBrowserSupported() {\n return (\n // Array.from is a bit less supported by browsers than CSSSupportsRule, but has higher chances\n // to be polyfilled. Test for both to be more confident. We could add more things if we find out\n // this test is not sufficient.\n typeof Array.from === 'function' &&\n typeof CSSSupportsRule === 'function' &&\n typeof URL.createObjectURL === 'function' &&\n 'forEach' in NodeList.prototype\n )\n}\n"],"mappings":"AAA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AACC,MAAM,KAAKjB,cAAc,CAACC,OAAO,EAAE;UAC3C;QACF;QAEA,IAAIe,KAAK,CAACC,MAAM,KAAKjB,cAAc,CAACI,OAAO,EAAE;UAC3CY,KAAK,CAACyB,aAAa,CAAC,CAAC;QACvB;QAEAzB,KAAK,GAAG;UACNC,MAAM,EAAEjB,cAAc,CAACC;QACzB,CAAC;MACH,CAAC;MACDW,2BAA0B,GAAG,SAA7BA,0BAA0BA,CAAA,EAAe;QACvCI,KAAK,CAACJ,0BAA0B,CAAC,CAAC;MACpC,CAAC;MACD,IAAII,KAAK,CAACC,MAAM,KAAKjB,cAAc,CAACE,aAAa,EAAE;QACjDgB,aAAa,CAAC,CAAC;MACjB;IACF,CAAC;IACDN,0BAA0B,WAA1BA,0BAA0BA,CAAA,EAAG;MAC3BA,2BAA0B,CAAC,CAAC;IAC9B,CAAC;IACDG,WAAW,EAAE,SAAbA,WAAWA,CAAA,EAAc;MACvB,OACEjB,sBAAsB,CAAC,CAAC,KAAKD,mBAAmB,CAAC6C,WAAW,IAC5D1B,KAAK,CAACC,MAAM,KAAKjB,cAAc,CAACI,OAAO;IAE3C,CAAC;IACDX,cAAc,EAAE,SAAhBA,cAAcA,CAAYkD,MAAM,EAAE;MAChC,OAAO7C,sBAAsB,CAAC,CAAC,KAAKD,mBAAmB,CAAC6C,WAAW,GAC/DhD,kBAAkB,CAACiD,MAAM,CAAC,GAC1B9B,SAAS;IACf;EACF,CAAC;AACH;;AAEA;AACA;AACA;AACA,SAASJ,kBAAkBA,CAAA,EAAG;EAC5B;IACE;IACA;IACA;IACA,OAAOmC,KAAK,CAACC,IAAI,KAAK,UAAU,IAChC,OAAOC,eAAe,KAAK,UAAU,IACrC,OAAOC,GAAG,CAACC,eAAe,KAAK,UAAU,IACzC,SAAS,IAAIC,QAAQ,CAACC;EAAS;AAEnC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"recorderApi.js","names":["noop","runOnReadyState","LifeCycleEventType","canUseEventBridge","bridgeSupports","BridgeCapability","PageExitReason","getReplayStats","getReplayStatsImpl","createDeflateEncoder","startDeflateWorker","DeflateWorkerStatus","getDeflateWorkerStatus","DeflateEncoderStreamId","RecorderStatus","Stopped","IntentToStart","Starting","Started","makeRecorderApi","startRecordingImpl","createDeflateWorkerImpl","RECORDS","isBrowserSupported","start","stop","takeSubsequentFullSnapshot","snapshotCanvas","ok","reason","getSerializedNodeIdForDebug","undefined","getLastAutoCanvasSnapshotResultForDebug","getAutoCanvasSnapshotDebugHistoryForDebug","getLastCanvasMutationForDebug","getCanvasMutationHistoryForDebug","getLastDomMutationForDebug","getDomMutationHistoryForDebug","getLastReplaySegmentFlushForDebug","getReplaySegmentFlushHistoryForDebug","getReplayPerformanceForDebug","flushReplayMutationsForDebug","onRumStart","isRecording","state","status","startStrategy","stopStrategy","options","lifeCycle","configuration","sessionManager","viewContexts","worker","subscribe","SESSION_EXPIRED","PAGE_EXITED","pageExitEvent","UNLOADING","SESSION_RENEWED","cachedDeflateEncoder","getOrCreateDeflateEncoder","REPLAY","session","findTrackedSession","sessionReplayAllowed","deflateEncoder","recordingImpl","stopRecording","canvas","node","Initialized","viewId","Array","from","CSSSupportsRule","URL","createObjectURL","NodeList","prototype"],"sources":["../../src/boot/recorderApi.js"],"sourcesContent":["import {\n noop,\n runOnReadyState,\n LifeCycleEventType,\n canUseEventBridge,\n bridgeSupports,\n BridgeCapability,\n PageExitReason\n} from '@cloudcare/browser-core'\n\nimport { getReplayStats as getReplayStatsImpl } from '../domain/replay/replayStats'\nimport {\n createDeflateEncoder,\n startDeflateWorker,\n DeflateWorkerStatus,\n getDeflateWorkerStatus,\n DeflateEncoderStreamId\n} from '../domain/deflate'\nvar RecorderStatus = {\n // The recorder is stopped.\n Stopped: 0,\n // The user started the recording while it wasn't possible yet. The recorder should start as soon\n // as possible.\n IntentToStart: 1,\n // The recorder is starting. It does not record anything yet.\n Starting: 2,\n // The recorder is started, it records the session.\n Started: 3\n}\n\nexport function makeRecorderApi(startRecordingImpl, createDeflateWorkerImpl) {\n if (\n (canUseEventBridge() && !bridgeSupports(BridgeCapability.RECORDS)) ||\n !isBrowserSupported()\n ) {\n return {\n start: noop,\n stop: noop,\n takeSubsequentFullSnapshot: noop,\n snapshotCanvas: function () {\n return {\n ok: false,\n reason: 'not_recording'\n }\n },\n getSerializedNodeIdForDebug: function () {\n return undefined\n },\n getLastAutoCanvasSnapshotResultForDebug: function () {\n return undefined\n },\n getAutoCanvasSnapshotDebugHistoryForDebug: function () {\n return undefined\n },\n getLastCanvasMutationForDebug: function () {\n return undefined\n },\n getCanvasMutationHistoryForDebug: function () {\n return undefined\n },\n getLastDomMutationForDebug: function () {\n return undefined\n },\n getDomMutationHistoryForDebug: function () {\n return undefined\n },\n getLastReplaySegmentFlushForDebug: function () {\n return undefined\n },\n getReplaySegmentFlushHistoryForDebug: function () {\n return undefined\n },\n getReplayPerformanceForDebug: function () {\n return undefined\n },\n flushReplayMutationsForDebug: noop,\n getReplayStats: function () {\n return undefined\n },\n onRumStart: noop,\n isRecording: function () {\n return false\n }\n }\n }\n\n var state = {\n status: RecorderStatus.Stopped\n }\n\n var startStrategy = function () {\n state = { status: RecorderStatus.IntentToStart }\n }\n var stopStrategy = function () {\n state = { status: RecorderStatus.Stopped }\n }\n var takeSubsequentFullSnapshot = function () {}\n var snapshotCanvas = function () {\n return {\n ok: false,\n reason: 'not_recording'\n }\n }\n var getSerializedNodeIdForDebug = function () {\n return undefined\n }\n var getLastAutoCanvasSnapshotResultForDebug = function () {\n return undefined\n }\n var getAutoCanvasSnapshotDebugHistoryForDebug = function () {\n return undefined\n }\n var getLastCanvasMutationForDebug = function () {\n return undefined\n }\n var getCanvasMutationHistoryForDebug = function () {\n return undefined\n }\n var getLastDomMutationForDebug = function () {\n return undefined\n }\n var getDomMutationHistoryForDebug = function () {\n return undefined\n }\n var getLastReplaySegmentFlushForDebug = function () {\n return undefined\n }\n var getReplaySegmentFlushHistoryForDebug = function () {\n return undefined\n }\n var getReplayPerformanceForDebug = function () {\n return undefined\n }\n var flushReplayMutationsForDebug = noop\n return {\n start: function (options) {\n startStrategy(options)\n },\n stop: function () {\n stopStrategy()\n },\n\n onRumStart: function (\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n worker\n ) {\n lifeCycle.subscribe(LifeCycleEventType.SESSION_EXPIRED, function () {\n if (\n state.status === RecorderStatus.Starting ||\n state.status === RecorderStatus.Started\n ) {\n stopStrategy()\n state = { status: RecorderStatus.IntentToStart }\n }\n })\n lifeCycle.subscribe(\n LifeCycleEventType.PAGE_EXITED,\n function (pageExitEvent) {\n if (pageExitEvent.reason === PageExitReason.UNLOADING) {\n stopStrategy()\n }\n }\n )\n lifeCycle.subscribe(LifeCycleEventType.SESSION_RENEWED, function () {\n if (state.status === RecorderStatus.IntentToStart) {\n startStrategy()\n }\n })\n var cachedDeflateEncoder\n function getOrCreateDeflateEncoder() {\n if (!cachedDeflateEncoder) {\n if (!worker) {\n worker = startDeflateWorker(\n configuration,\n 'Session Replay',\n function () {\n stopStrategy()\n },\n createDeflateWorkerImpl\n )\n }\n if (worker) {\n cachedDeflateEncoder = createDeflateEncoder(\n worker,\n DeflateEncoderStreamId.REPLAY\n )\n }\n }\n return cachedDeflateEncoder\n }\n startStrategy = function (options) {\n var session = sessionManager.findTrackedSession()\n if (!session || !session.sessionReplayAllowed) {\n state = { status: RecorderStatus.IntentToStart }\n return\n }\n\n if (\n state.status === RecorderStatus.Starting ||\n state.status === RecorderStatus.Started\n ) {\n return\n }\n\n state = { status: RecorderStatus.Starting }\n\n runOnReadyState('interactive', function () {\n if (state.status !== RecorderStatus.Starting) {\n return\n }\n var deflateEncoder = getOrCreateDeflateEncoder()\n if (!deflateEncoder) {\n state = {\n status: RecorderStatus.Stopped\n }\n return\n }\n var recordingImpl = startRecordingImpl(\n lifeCycle,\n configuration,\n sessionManager,\n viewContexts,\n deflateEncoder\n )\n state = {\n status: RecorderStatus.Started,\n stopRecording: recordingImpl.stop,\n takeSubsequentFullSnapshot: recordingImpl.takeSubsequentFullSnapshot,\n snapshotCanvas: recordingImpl.snapshotCanvas || noop,\n getSerializedNodeIdForDebug:\n recordingImpl.getSerializedNodeIdForDebug || noop,\n getLastAutoCanvasSnapshotResultForDebug:\n recordingImpl.getLastAutoCanvasSnapshotResultForDebug || noop,\n getAutoCanvasSnapshotDebugHistoryForDebug:\n recordingImpl.getAutoCanvasSnapshotDebugHistoryForDebug || noop,\n getLastCanvasMutationForDebug:\n recordingImpl.getLastCanvasMutationForDebug || noop,\n getCanvasMutationHistoryForDebug:\n recordingImpl.getCanvasMutationHistoryForDebug || noop,\n getLastDomMutationForDebug:\n recordingImpl.getLastDomMutationForDebug || noop,\n getDomMutationHistoryForDebug:\n recordingImpl.getDomMutationHistoryForDebug || noop,\n getLastReplaySegmentFlushForDebug:\n recordingImpl.getLastReplaySegmentFlushForDebug || noop,\n getReplaySegmentFlushHistoryForDebug:\n recordingImpl.getReplaySegmentFlushHistoryForDebug || noop,\n getReplayPerformanceForDebug:\n recordingImpl.getReplayPerformanceForDebug || noop,\n flushReplayMutationsForDebug:\n recordingImpl.flushReplayMutationsForDebug || noop\n }\n })\n }\n\n stopStrategy = function () {\n if (state.status === RecorderStatus.Stopped) {\n return\n }\n\n if (state.status === RecorderStatus.Started) {\n state.stopRecording()\n }\n\n state = {\n status: RecorderStatus.Stopped\n }\n }\n takeSubsequentFullSnapshot = function () {\n state.takeSubsequentFullSnapshot()\n }\n snapshotCanvas = function (canvas, options) {\n if (state.status === RecorderStatus.Started) {\n return state.snapshotCanvas(canvas, options)\n }\n return {\n ok: false,\n reason: 'not_recording'\n }\n }\n getSerializedNodeIdForDebug = function (node) {\n if (state.status === RecorderStatus.Started) {\n return state.getSerializedNodeIdForDebug(node)\n }\n return undefined\n }\n getLastAutoCanvasSnapshotResultForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getLastAutoCanvasSnapshotResultForDebug()\n }\n return undefined\n }\n getAutoCanvasSnapshotDebugHistoryForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getAutoCanvasSnapshotDebugHistoryForDebug()\n }\n return undefined\n }\n getLastCanvasMutationForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getLastCanvasMutationForDebug()\n }\n return undefined\n }\n getCanvasMutationHistoryForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getCanvasMutationHistoryForDebug()\n }\n return undefined\n }\n getLastDomMutationForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getLastDomMutationForDebug()\n }\n return undefined\n }\n getDomMutationHistoryForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getDomMutationHistoryForDebug()\n }\n return undefined\n }\n getLastReplaySegmentFlushForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getLastReplaySegmentFlushForDebug()\n }\n return undefined\n }\n getReplaySegmentFlushHistoryForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getReplaySegmentFlushHistoryForDebug()\n }\n return undefined\n }\n getReplayPerformanceForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n return state.getReplayPerformanceForDebug()\n }\n return undefined\n }\n flushReplayMutationsForDebug = function () {\n if (state.status === RecorderStatus.Started) {\n state.flushReplayMutationsForDebug()\n }\n }\n if (state.status === RecorderStatus.IntentToStart) {\n startStrategy()\n }\n },\n takeSubsequentFullSnapshot() {\n takeSubsequentFullSnapshot()\n },\n snapshotCanvas: function (canvas, options) {\n return snapshotCanvas(canvas, options)\n },\n getSerializedNodeIdForDebug: function (node) {\n return getSerializedNodeIdForDebug(node)\n },\n getLastReplaySegmentFlushForDebug: function () {\n return getLastReplaySegmentFlushForDebug()\n },\n getLastAutoCanvasSnapshotResultForDebug: function () {\n return getLastAutoCanvasSnapshotResultForDebug()\n },\n getAutoCanvasSnapshotDebugHistoryForDebug: function () {\n return getAutoCanvasSnapshotDebugHistoryForDebug()\n },\n getLastCanvasMutationForDebug: function () {\n return getLastCanvasMutationForDebug()\n },\n getCanvasMutationHistoryForDebug: function () {\n return getCanvasMutationHistoryForDebug()\n },\n getLastDomMutationForDebug: function () {\n return getLastDomMutationForDebug()\n },\n getDomMutationHistoryForDebug: function () {\n return getDomMutationHistoryForDebug()\n },\n getReplaySegmentFlushHistoryForDebug: function () {\n return getReplaySegmentFlushHistoryForDebug()\n },\n getReplayPerformanceForDebug: function () {\n return getReplayPerformanceForDebug()\n },\n flushReplayMutationsForDebug: function () {\n flushReplayMutationsForDebug()\n },\n isRecording: function () {\n return (\n getDeflateWorkerStatus() === DeflateWorkerStatus.Initialized &&\n state.status === RecorderStatus.Started\n )\n },\n getReplayStats: function (viewId) {\n return getDeflateWorkerStatus() === DeflateWorkerStatus.Initialized\n ? getReplayStatsImpl(viewId)\n : undefined\n }\n }\n}\n\n/**\n * Test for Browser features used while recording\n */\nfunction isBrowserSupported() {\n return (\n // Array.from is a bit less supported by browsers than CSSSupportsRule, but has higher chances\n // to be polyfilled. Test for both to be more confident. We could add more things if we find out\n // this test is not sufficient.\n typeof Array.from === 'function' &&\n typeof CSSSupportsRule === 'function' &&\n typeof URL.createObjectURL === 'function' &&\n 'forEach' in NodeList.prototype\n )\n}\n"],"mappings":"AAAA,SACEA,IAAI,EACJC,eAAe,EACfC,kBAAkB,EAClBC,iBAAiB,EACjBC,cAAc,EACdC,gBAAgB,EAChBC,cAAc,QACT,yBAAyB;AAEhC,SAASC,cAAc,IAAIC,kBAAkB,QAAQ,8BAA8B;AACnF,SACEC,oBAAoB,EACpBC,kBAAkB,EAClBC,mBAAmB,EACnBC,sBAAsB,EACtBC,sBAAsB,QACjB,mBAAmB;AAC1B,IAAIC,cAAc,GAAG;EACnB;EACAC,OAAO,EAAE,CAAC;EACV;EACA;EACAC,aAAa,EAAE,CAAC;EAChB;EACAC,QAAQ,EAAE,CAAC;EACX;EACAC,OAAO,EAAE;AACX,CAAC;AAED,OAAO,SAASC,eAAeA,CAACC,kBAAkB,EAAEC,uBAAuB,EAAE;EAC3E,IACGlB,iBAAiB,CAAC,CAAC,IA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,EAAc;MACzC,OAAOA,8BAA6B,CAAC,CAAC;IACxC,CAAC;IACDE,oCAAoC,EAAE,SAAtCA,oCAAoCA,CAAA,EAAc;MAChD,OAAOA,qCAAoC,CAAC,CAAC;IAC/C,CAAC;IACDC,4BAA4B,EAAE,SAA9BA,4BAA4BA,CAAA,EAAc;MACxC,OAAOA,6BAA4B,CAAC,CAAC;IACvC,CAAC;IACDC,4BAA4B,EAAE,SAA9BA,4BAA4BA,CAAA,EAAc;MACxCA,6BAA4B,CAAC,CAAC;IAChC,CAAC;IACDE,WAAW,EAAE,SAAbA,WAAWA,CAAA,EAAc;MACvB,OACE/B,sBAAsB,CAAC,CAAC,KAAKD,mBAAmB,CAAC4D,WAAW,IAC5D3B,KAAK,CAACC,MAAM,KAAK/B,cAAc,CAACI,OAAO;IAE3C,CAAC;IACDX,cAAc,EAAE,SAAhBA,cAAcA,CAAYiE,MAAM,EAAE;MAChC,OAAO5D,sBAAsB,CAAC,CAAC,KAAKD,mBAAmB,CAAC4D,WAAW,GAC/D/D,kBAAkB,CAACgE,MAAM,CAAC,GAC1BzC,SAAS;IACf;EACF,CAAC;AACH;;AAEA;AACA;AACA;AACA,SAASR,kBAAkBA,CAAA,EAAG;EAC5B;IACE;IACA;IACA;IACA,OAAOkD,KAAK,CAACC,IAAI,KAAK,UAAU,IAChC,OAAOC,eAAe,KAAK,UAAU,IACrC,OAAOC,GAAG,CAACC,eAAe,KAAK,UAAU,IACzC,SAAS,IAAIC,QAAQ,CAACC;EAAS;AAEnC","ignoreList":[]}
|
package/esm/boot/rum.js
CHANGED
|
@@ -19,7 +19,7 @@ import { startErrorCollection } from '../domain/rumEventsCollection/error/errorC
|
|
|
19
19
|
import { startViewCollection } from '../domain/rumEventsCollection/view/viewCollection';
|
|
20
20
|
import { startRequestCollection } from '../domain/requestCollection';
|
|
21
21
|
import { startResourceCollection } from '../domain/rumEventsCollection/resource/resourceCollection';
|
|
22
|
-
export function startRum(configuration, recorderApi, customerDataTrackerManager, getCommonContext, initialViewOptions, createEncoder) {
|
|
22
|
+
export function startRum(configuration, recorderApi, customerDataTrackerManager, getCommonContext, initialViewOptions, createEncoder, resourceTrackerManager) {
|
|
23
23
|
var cleanupTasks = [];
|
|
24
24
|
var lifeCycle = new LifeCycle();
|
|
25
25
|
var telemetry = startRumTelemetry(configuration);
|
|
@@ -82,7 +82,7 @@ export function startRum(configuration, recorderApi, customerDataTrackerManager,
|
|
|
82
82
|
getViewContext = _startViewCollection.getViewContext,
|
|
83
83
|
stopViewCollection = _startViewCollection.stop;
|
|
84
84
|
cleanupTasks.push(stopViewCollection);
|
|
85
|
-
var _startResourceCollection = startResourceCollection(lifeCycle, configuration, pageStateHistory);
|
|
85
|
+
var _startResourceCollection = startResourceCollection(lifeCycle, configuration, pageStateHistory, undefined, undefined, resourceTrackerManager);
|
|
86
86
|
var addResource = _startResourceCollection.addResource;
|
|
87
87
|
cleanupTasks.push(_startResourceCollection.stop);
|
|
88
88
|
if (PerformanceObserver.supportedEntryTypes && PerformanceObserver.supportedEntryTypes.includes(RumPerformanceEntryType.LONG_ANIMATION_FRAME)) {
|
|
@@ -120,6 +120,21 @@ export function startRum(configuration, recorderApi, customerDataTrackerManager,
|
|
|
120
120
|
cleanupTasks.forEach(function (task) {
|
|
121
121
|
task();
|
|
122
122
|
});
|
|
123
|
+
},
|
|
124
|
+
createResourceTrackerId: function createResourceTrackerId() {
|
|
125
|
+
return resourceTrackerManager.createTrackerId();
|
|
126
|
+
},
|
|
127
|
+
setResourceContext: function setResourceContext(trackerId, context) {
|
|
128
|
+
resourceTrackerManager.setResourceContext(trackerId, context);
|
|
129
|
+
},
|
|
130
|
+
appendResourceContext: function appendResourceContext(trackerId, context) {
|
|
131
|
+
resourceTrackerManager.appendResourceContext(trackerId, context);
|
|
132
|
+
},
|
|
133
|
+
finishResource: function finishResource(trackerId) {
|
|
134
|
+
resourceTrackerManager.finishResource(trackerId);
|
|
135
|
+
},
|
|
136
|
+
getResource: function getResource(trackerId) {
|
|
137
|
+
return resourceTrackerManager.getResource(trackerId);
|
|
123
138
|
}
|
|
124
139
|
};
|
|
125
140
|
}
|
package/esm/boot/rum.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rum.js","names":["startRumSessionManager","startRumSessionManagerStub","startCacheUsrCache","LifeCycle","LifeCycleEventType","createPageExitObservable","canUseEventBridge","startTelemetry","TelemetryService","drainPreStartTelemetry","createDOMMutationObservable","createLocationChangeObservable","startLongTaskCollection","startLongAnimationFrameCollection","RumPerformanceEntryType","startActionCollection","startRumBatch","startRumEventBridge","startRumAssembly","startDisplayContext","startInternalContext","startUrlContexts","startViewContexts","startPageStateHistory","startErrorCollection","startViewCollection","startRequestCollection","startResourceCollection","startRum","configuration","recorderApi","customerDataTrackerManager","getCommonContext","initialViewOptions","createEncoder","cleanupTasks","lifeCycle","telemetry","startRumTelemetry","reportError","error","notify","RAW_ERROR_COLLECTED","pageExitObservable","pageExitSubscription","subscribe","event","PAGE_EXITED","push","unsubscribe","session","batch","observable","expireObservable","stop","userSession","domMutationObservable","locationChangeObservable","location","pageStateHistory","_startRumEventCollection","startRumEventCollection","viewContexts","urlContexts","actionContexts","stopRumEventCollection","addAction","setContextProvider","application","id","applicationId","findTrackedSession","view","findView","action","findActionId","ids","findAllActionId","_startViewCollection","addTiming","startView","setViewName","setViewContext","setViewContextProperty","getViewContext","stopViewCollection","_startResourceCollection","addResource","PerformanceObserver","supportedEntryTypes","includes","LONG_ANIMATION_FRAME","longAnimationFrameCollection","_startErrorCollection","addError","internalContext","setForcedSession","stopSession","expire","getInternalContext","get","forEach","task","RUM","sessionManager","userSessionManager","_startActionCollection","displayContext"],"sources":["../../src/boot/rum.js"],"sourcesContent":["import {\n startRumSessionManager,\n startRumSessionManagerStub\n} from '../domain/rumSessionManager'\nimport { startCacheUsrCache } from '../domain/usr'\nimport {\n LifeCycle,\n LifeCycleEventType,\n createPageExitObservable,\n canUseEventBridge,\n startTelemetry,\n TelemetryService,\n drainPreStartTelemetry\n} from '@cloudcare/browser-core'\nimport { createDOMMutationObservable } from '../domain/domMutationObservable.js'\nimport { createLocationChangeObservable } from '../domain/locationChangeObservable'\nimport { startLongTaskCollection } from '../domain/rumEventsCollection/longTask/longTaskCollection'\nimport { startLongAnimationFrameCollection } from '../domain/rumEventsCollection/longTask/longAnimationFrameCollection'\nimport { RumPerformanceEntryType } from '../domain/performanceObservable'\nimport { startActionCollection } from '../domain/rumEventsCollection/actions/actionCollection'\nimport { startRumBatch } from '../transport/startRumBatch'\nimport { startRumEventBridge } from '../transport/startRumEventBridge'\nimport { startRumAssembly } from '../domain/assembly'\nimport { startDisplayContext } from '../domain/contexts/displayContext.js'\nimport { startInternalContext } from '../domain/contexts/internalContext'\nimport { startUrlContexts } from '../domain/contexts/urlContexts'\nimport { startViewContexts } from '../domain/contexts/viewContexts'\nimport { startPageStateHistory } from '../domain/contexts/pageStateHistory'\nimport { startErrorCollection } from '../domain/rumEventsCollection/error/errorCollection'\nimport { startViewCollection } from '../domain/rumEventsCollection/view/viewCollection'\nimport { startRequestCollection } from '../domain/requestCollection'\nimport { startResourceCollection } from '../domain/rumEventsCollection/resource/resourceCollection'\n\nexport function startRum(\n configuration,\n recorderApi,\n customerDataTrackerManager,\n getCommonContext,\n initialViewOptions,\n createEncoder\n) {\n var cleanupTasks = []\n var lifeCycle = new LifeCycle()\n var telemetry = startRumTelemetry(configuration)\n\n var reportError = function (error) {\n lifeCycle.notify(LifeCycleEventType.RAW_ERROR_COLLECTED, { error: error })\n }\n var pageExitObservable = createPageExitObservable()\n var pageExitSubscription = pageExitObservable.subscribe(function (event) {\n lifeCycle.notify(LifeCycleEventType.PAGE_EXITED, event)\n })\n cleanupTasks.push(function () {\n pageExitSubscription.unsubscribe()\n })\n var session = !canUseEventBridge()\n ? startRumSessionManager(configuration, lifeCycle)\n : startRumSessionManagerStub()\n if (!canUseEventBridge()) {\n var batch = startRumBatch(\n configuration,\n lifeCycle,\n telemetry.observable,\n reportError,\n pageExitObservable,\n session.expireObservable,\n createEncoder\n )\n cleanupTasks.push(function () {\n batch.stop()\n })\n } else {\n startRumEventBridge(lifeCycle)\n }\n\n var userSession = startCacheUsrCache(configuration)\n var domMutationObservable = createDOMMutationObservable()\n var locationChangeObservable = createLocationChangeObservable(location)\n var pageStateHistory = startPageStateHistory()\n var _startRumEventCollection = startRumEventCollection(\n lifeCycle,\n configuration,\n location,\n session,\n userSession,\n pageStateHistory,\n locationChangeObservable,\n domMutationObservable,\n getCommonContext,\n reportError\n )\n var viewContexts = _startRumEventCollection.viewContexts\n var urlContexts = _startRumEventCollection.urlContexts\n var actionContexts = _startRumEventCollection.actionContexts\n var stopRumEventCollection = _startRumEventCollection.stop\n var addAction = _startRumEventCollection.addAction\n cleanupTasks.push(stopRumEventCollection)\n drainPreStartTelemetry()\n\n telemetry.setContextProvider(function () {\n return {\n application: {\n id: configuration.applicationId\n },\n session: {\n id: session.findTrackedSession() && session.findTrackedSession().id\n },\n view: {\n id: viewContexts.findView() && viewContexts.findView().id\n },\n action: {\n id: actionContexts.findActionId(),\n ids: actionContexts.findAllActionId()\n }\n }\n })\n const {\n addTiming,\n startView,\n setViewName,\n setViewContext,\n setViewContextProperty,\n getViewContext,\n stop: stopViewCollection\n } = startViewCollection(\n lifeCycle,\n configuration,\n location,\n domMutationObservable,\n locationChangeObservable,\n pageStateHistory,\n recorderApi,\n initialViewOptions\n )\n cleanupTasks.push(stopViewCollection)\n\n const _startResourceCollection = startResourceCollection(\n lifeCycle,\n configuration,\n pageStateHistory\n )\n var addResource = _startResourceCollection.addResource\n cleanupTasks.push(_startResourceCollection.stop)\n if (\n PerformanceObserver.supportedEntryTypes &&\n PerformanceObserver.supportedEntryTypes.includes(\n RumPerformanceEntryType.LONG_ANIMATION_FRAME\n )\n ) {\n var longAnimationFrameCollection = startLongAnimationFrameCollection(\n lifeCycle,\n configuration\n )\n cleanupTasks.push(longAnimationFrameCollection.stop)\n } else {\n startLongTaskCollection(lifeCycle, configuration)\n }\n\n var _startErrorCollection = startErrorCollection(\n lifeCycle,\n configuration,\n session,\n pageStateHistory\n )\n var addError = _startErrorCollection.addError\n startRequestCollection(lifeCycle, configuration, session)\n\n var internalContext = startInternalContext(\n configuration.applicationId,\n session,\n viewContexts,\n actionContexts,\n urlContexts\n )\n return {\n addResource: addResource,\n addAction: addAction,\n addError: addError,\n addTiming: addTiming,\n configuration: configuration,\n startView,\n setViewContext,\n setViewContextProperty,\n getViewContext,\n setViewName,\n lifeCycle: lifeCycle,\n viewContexts: viewContexts,\n session: session,\n setForcedSession: function () {\n session.setForcedSession()\n },\n stopSession: function () {\n session.expire()\n },\n getInternalContext: internalContext.get,\n stop: function () {\n cleanupTasks.forEach(function (task) {\n task()\n })\n }\n }\n}\nfunction startRumTelemetry(configuration) {\n const telemetry = startTelemetry(TelemetryService.RUM, configuration)\n // if (canUseEventBridge()) {\n // const bridge = getEventBridge()\n // telemetry.observable.subscribe((event) =>\n // bridge.send('internal_telemetry', event)\n // )\n // }\n return telemetry\n}\n\nexport function startRumEventCollection(\n lifeCycle,\n configuration,\n location,\n sessionManager,\n userSessionManager,\n pageStateHistory,\n locationChangeObservable,\n domMutationObservable,\n getCommonContext,\n reportError\n) {\n var viewContexts = startViewContexts(lifeCycle)\n var urlContexts = startUrlContexts(\n lifeCycle,\n locationChangeObservable,\n location\n )\n\n var _startActionCollection = startActionCollection(\n lifeCycle,\n domMutationObservable,\n configuration,\n pageStateHistory\n )\n var actionContexts = _startActionCollection.actionContexts\n var addAction = _startActionCollection.addAction\n\n var displayContext = startDisplayContext()\n startRumAssembly(\n configuration,\n lifeCycle,\n sessionManager,\n userSessionManager,\n viewContexts,\n urlContexts,\n actionContexts,\n displayContext,\n getCommonContext,\n reportError\n )\n return {\n viewContexts: viewContexts,\n urlContexts: urlContexts,\n pageStateHistory: pageStateHistory,\n addAction: addAction,\n actionContexts: actionContexts,\n stop: function () {\n displayContext.stop()\n pageStateHistory.stop()\n urlContexts.stop()\n viewContexts.stop()\n }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sB,CAACxC,SAAS;EAEhD,IAAIyC,cAAc,GAAGxF,mBAAmB,CAAC,CAAC;EAC1CD,gBAAgB,CACdW,aAAa,EACbO,SAAS,EACToE,cAAc,EACdC,kBAAkB,EAClB3C,YAAY,EACZC,WAAW,EACXC,cAAc,EACd2C,cAAc,EACd3E,gBAAgB,EAChBO,WACF,CAAC;EACD,OAAO;IACLuB,YAAY,EAAEA,YAAY;IAC1BC,WAAW,EAAEA,WAAW;IACxBJ,gBAAgB,EAAEA,gBAAgB;IAClCO,SAAS,EAAEA,SAAS;IACpBF,cAAc,EAAEA,cAAc;IAC9BV,IAAI,EAAE,SAANA,IAAIA,CAAA,EAAc;MAChBqD,cAAc,CAACrD,IAAI,CAAC,CAAC;MACrBK,gBAAgB,CAACL,IAAI,CAAC,CAAC;MACvBS,WAAW,CAACT,IAAI,CAAC,CAAC;MAClBQ,YAAY,CAACR,IAAI,CAAC,CAAC;IACrB;EACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"rum.js","names":["startRumSessionManager","startRumSessionManagerStub","startCacheUsrCache","LifeCycle","LifeCycleEventType","createPageExitObservable","canUseEventBridge","startTelemetry","TelemetryService","drainPreStartTelemetry","createDOMMutationObservable","createLocationChangeObservable","startLongTaskCollection","startLongAnimationFrameCollection","RumPerformanceEntryType","startActionCollection","startRumBatch","startRumEventBridge","startRumAssembly","startDisplayContext","startInternalContext","startUrlContexts","startViewContexts","startPageStateHistory","startErrorCollection","startViewCollection","startRequestCollection","startResourceCollection","startRum","configuration","recorderApi","customerDataTrackerManager","getCommonContext","initialViewOptions","createEncoder","resourceTrackerManager","cleanupTasks","lifeCycle","telemetry","startRumTelemetry","reportError","error","notify","RAW_ERROR_COLLECTED","pageExitObservable","pageExitSubscription","subscribe","event","PAGE_EXITED","push","unsubscribe","session","batch","observable","expireObservable","stop","userSession","domMutationObservable","locationChangeObservable","location","pageStateHistory","_startRumEventCollection","startRumEventCollection","viewContexts","urlContexts","actionContexts","stopRumEventCollection","addAction","setContextProvider","application","id","applicationId","findTrackedSession","view","findView","action","findActionId","ids","findAllActionId","_startViewCollection","addTiming","startView","setViewName","setViewContext","setViewContextProperty","getViewContext","stopViewCollection","_startResourceCollection","undefined","addResource","PerformanceObserver","supportedEntryTypes","includes","LONG_ANIMATION_FRAME","longAnimationFrameCollection","_startErrorCollection","addError","internalContext","setForcedSession","stopSession","expire","getInternalContext","get","forEach","task","createResourceTrackerId","createTrackerId","setResourceContext","trackerId","context","appendResourceContext","finishResource","getResource","RUM","sessionManager","userSessionManager","_startActionCollection","displayContext"],"sources":["../../src/boot/rum.js"],"sourcesContent":["import {\n startRumSessionManager,\n startRumSessionManagerStub\n} from '../domain/rumSessionManager'\nimport { startCacheUsrCache } from '../domain/usr'\nimport {\n LifeCycle,\n LifeCycleEventType,\n createPageExitObservable,\n canUseEventBridge,\n startTelemetry,\n TelemetryService,\n drainPreStartTelemetry\n} from '@cloudcare/browser-core'\nimport { createDOMMutationObservable } from '../domain/domMutationObservable.js'\nimport { createLocationChangeObservable } from '../domain/locationChangeObservable'\nimport { startLongTaskCollection } from '../domain/rumEventsCollection/longTask/longTaskCollection'\nimport { startLongAnimationFrameCollection } from '../domain/rumEventsCollection/longTask/longAnimationFrameCollection'\nimport { RumPerformanceEntryType } from '../domain/performanceObservable'\nimport { startActionCollection } from '../domain/rumEventsCollection/actions/actionCollection'\nimport { startRumBatch } from '../transport/startRumBatch'\nimport { startRumEventBridge } from '../transport/startRumEventBridge'\nimport { startRumAssembly } from '../domain/assembly'\nimport { startDisplayContext } from '../domain/contexts/displayContext.js'\nimport { startInternalContext } from '../domain/contexts/internalContext'\nimport { startUrlContexts } from '../domain/contexts/urlContexts'\nimport { startViewContexts } from '../domain/contexts/viewContexts'\nimport { startPageStateHistory } from '../domain/contexts/pageStateHistory'\nimport { startErrorCollection } from '../domain/rumEventsCollection/error/errorCollection'\nimport { startViewCollection } from '../domain/rumEventsCollection/view/viewCollection'\nimport { startRequestCollection } from '../domain/requestCollection'\nimport { startResourceCollection } from '../domain/rumEventsCollection/resource/resourceCollection'\n\nexport function startRum(\n configuration,\n recorderApi,\n customerDataTrackerManager,\n getCommonContext,\n initialViewOptions,\n createEncoder,\n resourceTrackerManager\n) {\n var cleanupTasks = []\n var lifeCycle = new LifeCycle()\n var telemetry = startRumTelemetry(configuration)\n\n var reportError = function (error) {\n lifeCycle.notify(LifeCycleEventType.RAW_ERROR_COLLECTED, { error: error })\n }\n var pageExitObservable = createPageExitObservable()\n var pageExitSubscription = pageExitObservable.subscribe(function (event) {\n lifeCycle.notify(LifeCycleEventType.PAGE_EXITED, event)\n })\n cleanupTasks.push(function () {\n pageExitSubscription.unsubscribe()\n })\n var session = !canUseEventBridge()\n ? startRumSessionManager(configuration, lifeCycle)\n : startRumSessionManagerStub()\n if (!canUseEventBridge()) {\n var batch = startRumBatch(\n configuration,\n lifeCycle,\n telemetry.observable,\n reportError,\n pageExitObservable,\n session.expireObservable,\n createEncoder\n )\n cleanupTasks.push(function () {\n batch.stop()\n })\n } else {\n startRumEventBridge(lifeCycle)\n }\n\n var userSession = startCacheUsrCache(configuration)\n var domMutationObservable = createDOMMutationObservable()\n var locationChangeObservable = createLocationChangeObservable(location)\n var pageStateHistory = startPageStateHistory()\n var _startRumEventCollection = startRumEventCollection(\n lifeCycle,\n configuration,\n location,\n session,\n userSession,\n pageStateHistory,\n locationChangeObservable,\n domMutationObservable,\n getCommonContext,\n reportError\n )\n var viewContexts = _startRumEventCollection.viewContexts\n var urlContexts = _startRumEventCollection.urlContexts\n var actionContexts = _startRumEventCollection.actionContexts\n var stopRumEventCollection = _startRumEventCollection.stop\n var addAction = _startRumEventCollection.addAction\n cleanupTasks.push(stopRumEventCollection)\n drainPreStartTelemetry()\n\n telemetry.setContextProvider(function () {\n return {\n application: {\n id: configuration.applicationId\n },\n session: {\n id: session.findTrackedSession() && session.findTrackedSession().id\n },\n view: {\n id: viewContexts.findView() && viewContexts.findView().id\n },\n action: {\n id: actionContexts.findActionId(),\n ids: actionContexts.findAllActionId()\n }\n }\n })\n const {\n addTiming,\n startView,\n setViewName,\n setViewContext,\n setViewContextProperty,\n getViewContext,\n stop: stopViewCollection\n } = startViewCollection(\n lifeCycle,\n configuration,\n location,\n domMutationObservable,\n locationChangeObservable,\n pageStateHistory,\n recorderApi,\n initialViewOptions\n )\n cleanupTasks.push(stopViewCollection)\n\n const _startResourceCollection = startResourceCollection(\n lifeCycle,\n configuration,\n pageStateHistory,\n undefined,\n undefined,\n resourceTrackerManager\n )\n var addResource = _startResourceCollection.addResource\n cleanupTasks.push(_startResourceCollection.stop)\n if (\n PerformanceObserver.supportedEntryTypes &&\n PerformanceObserver.supportedEntryTypes.includes(\n RumPerformanceEntryType.LONG_ANIMATION_FRAME\n )\n ) {\n var longAnimationFrameCollection = startLongAnimationFrameCollection(\n lifeCycle,\n configuration\n )\n cleanupTasks.push(longAnimationFrameCollection.stop)\n } else {\n startLongTaskCollection(lifeCycle, configuration)\n }\n\n var _startErrorCollection = startErrorCollection(\n lifeCycle,\n configuration,\n session,\n pageStateHistory\n )\n var addError = _startErrorCollection.addError\n startRequestCollection(lifeCycle, configuration, session)\n\n var internalContext = startInternalContext(\n configuration.applicationId,\n session,\n viewContexts,\n actionContexts,\n urlContexts\n )\n return {\n addResource: addResource,\n addAction: addAction,\n addError: addError,\n addTiming: addTiming,\n configuration: configuration,\n startView,\n setViewContext,\n setViewContextProperty,\n getViewContext,\n setViewName,\n lifeCycle: lifeCycle,\n viewContexts: viewContexts,\n session: session,\n setForcedSession: function () {\n session.setForcedSession()\n },\n stopSession: function () {\n session.expire()\n },\n getInternalContext: internalContext.get,\n stop: function () {\n cleanupTasks.forEach(function (task) {\n task()\n })\n },\n createResourceTrackerId: function () {\n return resourceTrackerManager.createTrackerId()\n },\n setResourceContext: function (trackerId, context) {\n resourceTrackerManager.setResourceContext(trackerId, context)\n },\n appendResourceContext: function (trackerId, context) {\n resourceTrackerManager.appendResourceContext(trackerId, context)\n },\n finishResource: function (trackerId) {\n resourceTrackerManager.finishResource(trackerId)\n },\n getResource: function (trackerId) {\n return resourceTrackerManager.getResource(trackerId)\n }\n }\n}\nfunction startRumTelemetry(configuration) {\n const telemetry = startTelemetry(TelemetryService.RUM, configuration)\n // if (canUseEventBridge()) {\n // const bridge = getEventBridge()\n // telemetry.observable.subscribe((event) =>\n // bridge.send('internal_telemetry', event)\n // )\n // }\n return telemetry\n}\n\nexport function startRumEventCollection(\n lifeCycle,\n configuration,\n location,\n sessionManager,\n userSessionManager,\n pageStateHistory,\n locationChangeObservable,\n domMutationObservable,\n getCommonContext,\n reportError\n) {\n var viewContexts = startViewContexts(lifeCycle)\n var urlContexts = startUrlContexts(\n lifeCycle,\n locationChangeObservable,\n location\n )\n\n var _startActionCollection = startActionCollection(\n lifeCycle,\n domMutationObservable,\n configuration,\n pageStateHistory\n )\n var actionContexts = _startActionCollection.actionContexts\n var addAction = _startActionCollection.addAction\n\n var displayContext = startDisplayContext()\n startRumAssembly(\n configuration,\n lifeCycle,\n sessionManager,\n userSessionManager,\n viewContexts,\n urlContexts,\n actionContexts,\n displayContext,\n getCommonContext,\n reportError\n )\n return {\n viewContexts: viewContexts,\n urlContexts: urlContexts,\n pageStateHistory: pageStateHistory,\n addAction: addAction,\n actionContexts: actionContexts,\n stop: function () {\n displayContext.stop()\n pageStateHistory.stop()\n urlContexts.stop()\n viewContexts.stop()\n }\n }\n}\n"],"mappings":"AAAA,SACEA,sBAAsB,EACtBC,0BAA0B,QACrB,6BAA6B;AACpC,SAASC,kBAAkB,QAAQ,eAAe;AAClD,SACEC,SAAS,EACTC,kBAAkB,EAClBC,wBAAwB,EACxBC,iBAAiB,EACjBC,cAAc,EACdC,gBAAgB,EAChBC,sBAAsB,QACjB,yBAAyB;AAChC,SAASC,2BAA2B,QAAQ,oCAAoC;AAChF,SAASC,8BAA8B,QAAQ,oCAAoC;AACnF,SAASC,uBAAuB,QAAQ,2DAA2D;AACnG,SAASC,iCAAiC,QAAQ,qEAAqE;AACvH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ACX;EACA,IAAIuB,YAAY,GAAGzC,iBAAiB,CAACe,SAAS,CAAC;EAC/C,IAAI2B,WAAW,GAAG3C,gBAAgB,CAChCgB,SAAS,EACTqB,wBAAwB,EACxBC,QACF,CAAC;EAED,IAAIyD,sBAAsB,GAAGrG,qBAAqB,CAChDsB,SAAS,EACToB,qBAAqB,EACrB5B,aAAa,EACb+B,gBACF,CAAC;EACD,IAAIK,cAAc,GAAGmD,sBAAsB,CAACnD,cAAc;EAC1D,IAAIE,SAAS,GAAGiD,sBAAsB,CAACjD,SAAS;EAEhD,IAAIkD,cAAc,GAAGlG,mBAAmB,CAAC,CAAC;EAC1CD,gBAAgB,CACdW,aAAa,EACbQ,SAAS,EACT6E,cAAc,EACdC,kBAAkB,EAClBpD,YAAY,EACZC,WAAW,EACXC,cAAc,EACdoD,cAAc,EACdrF,gBAAgB,EAChBQ,WACF,CAAC;EACD,OAAO;IACLuB,YAAY,EAAEA,YAAY;IAC1BC,WAAW,EAAEA,WAAW;IACxBJ,gBAAgB,EAAEA,gBAAgB;IAClCO,SAAS,EAAEA,SAAS;IACpBF,cAAc,EAAEA,cAAc;IAC9BV,IAAI,EAAE,SAANA,IAAIA,CAAA,EAAc;MAChB8D,cAAc,CAAC9D,IAAI,CAAC,CAAC;MACrBK,gBAAgB,CAACL,IAAI,CAAC,CAAC;MACvBS,WAAW,CAACT,IAAI,CAAC,CAAC;MAClBQ,YAAY,CAACR,IAAI,CAAC,CAAC;IACrB;EACF,CAAC;AACH","ignoreList":[]}
|
package/esm/boot/rumPublicApi.js
CHANGED
|
@@ -2,12 +2,14 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
2
|
import { makePublicApi, createContextManager, CustomerDataType, clocksNow, ActionType, ResourceType, deepClone, createHandlingStack, sanitizeUser, checkUser, callMonitored, assign, monitor, storeContextManager, createIdentityEncoder, addTelemetryUsage, sanitize, createCustomerDataTrackerManager, CustomerDataCompressionStatus, displayAlreadyInitializedError, getType } from '@cloudcare/browser-core';
|
|
3
3
|
import { buildCommonContext } from '../domain/contexts/commonContext';
|
|
4
4
|
import { createPreStartStrategy } from './perStartRum';
|
|
5
|
+
import { createResourceTrackerManager } from '../domain/rumEventsCollection/resource/resourceTrackerManager';
|
|
5
6
|
var RUM_STORAGE_KEY = 'rum';
|
|
6
7
|
export function makeRumPublicApi(startRumImpl, recorderApi, options) {
|
|
7
8
|
if (options === undefined) {
|
|
8
9
|
options = {};
|
|
9
10
|
}
|
|
10
11
|
var customerDataTrackerManager = createCustomerDataTrackerManager(CustomerDataCompressionStatus.Unknown);
|
|
12
|
+
var resourceTrackerManager = createResourceTrackerManager();
|
|
11
13
|
var globalContextManager = createContextManager('global', {
|
|
12
14
|
customerDataTracker: customerDataTrackerManager.getOrCreateTracker(CustomerDataType.GlobalContext)
|
|
13
15
|
});
|
|
@@ -28,7 +30,9 @@ export function makeRumPublicApi(startRumImpl, recorderApi, options) {
|
|
|
28
30
|
function getCommonContext() {
|
|
29
31
|
return buildCommonContext(globalContextManager, userContextManager, recorderApi);
|
|
30
32
|
}
|
|
31
|
-
var strategy = createPreStartStrategy(
|
|
33
|
+
var strategy = createPreStartStrategy(assign({}, options, {
|
|
34
|
+
resourceTrackerManager: resourceTrackerManager
|
|
35
|
+
}), getCommonContext, function (configuration, deflateWorker, initialViewOptions) {
|
|
32
36
|
if (configuration.storeContextsToLocal) {
|
|
33
37
|
storeContextManager(configuration, globalContextManager, RUM_STORAGE_KEY, CustomerDataType.GlobalContext);
|
|
34
38
|
storeContextManager(configuration, userContextManager, RUM_STORAGE_KEY, CustomerDataType.User);
|
|
@@ -36,7 +40,7 @@ export function makeRumPublicApi(startRumImpl, recorderApi, options) {
|
|
|
36
40
|
customerDataTrackerManager.setCompressionStatus(deflateWorker ? CustomerDataCompressionStatus.Enabled : CustomerDataCompressionStatus.Disabled);
|
|
37
41
|
var startRumResult = startRumImpl(configuration, recorderApi, customerDataTrackerManager, getCommonContext, initialViewOptions, deflateWorker && options.createDeflateEncoder ? function (streamId) {
|
|
38
42
|
return options.createDeflateEncoder(deflateWorker, streamId);
|
|
39
|
-
} : createIdentityEncoder);
|
|
43
|
+
} : createIdentityEncoder, resourceTrackerManager);
|
|
40
44
|
recorderApi.onRumStart(startRumResult.lifeCycle, configuration, startRumResult.session, startRumResult.viewContexts, deflateWorker);
|
|
41
45
|
strategy = createPostStartStrategy(strategy, startRumResult);
|
|
42
46
|
return startRumResult;
|
|
@@ -249,8 +253,64 @@ export function makeRumPublicApi(startRumImpl, recorderApi, options) {
|
|
|
249
253
|
force: options && options.force
|
|
250
254
|
});
|
|
251
255
|
}),
|
|
256
|
+
isRecording: monitor(function () {
|
|
257
|
+
return recorderApi.isRecording();
|
|
258
|
+
}),
|
|
252
259
|
stopSessionReplayRecording: monitor(recorderApi.stop),
|
|
253
|
-
takeSubsequentFullSnapshot: monitor(recorderApi.takeSubsequentFullSnapshot)
|
|
260
|
+
takeSubsequentFullSnapshot: monitor(recorderApi.takeSubsequentFullSnapshot),
|
|
261
|
+
snapshotCanvas: monitor(function (canvas, options) {
|
|
262
|
+
return recorderApi.snapshotCanvas(canvas, options);
|
|
263
|
+
}),
|
|
264
|
+
getSerializedNodeIdForDebug: monitor(function (node) {
|
|
265
|
+
return recorderApi.getSerializedNodeIdForDebug(node);
|
|
266
|
+
}),
|
|
267
|
+
getLastAutoCanvasSnapshotResultForDebug: monitor(function () {
|
|
268
|
+
return recorderApi.getLastAutoCanvasSnapshotResultForDebug();
|
|
269
|
+
}),
|
|
270
|
+
getAutoCanvasSnapshotDebugHistoryForDebug: monitor(function () {
|
|
271
|
+
return recorderApi.getAutoCanvasSnapshotDebugHistoryForDebug();
|
|
272
|
+
}),
|
|
273
|
+
getLastCanvasMutationForDebug: monitor(function () {
|
|
274
|
+
return recorderApi.getLastCanvasMutationForDebug();
|
|
275
|
+
}),
|
|
276
|
+
getCanvasMutationHistoryForDebug: monitor(function () {
|
|
277
|
+
return recorderApi.getCanvasMutationHistoryForDebug();
|
|
278
|
+
}),
|
|
279
|
+
getLastDomMutationForDebug: monitor(function () {
|
|
280
|
+
return recorderApi.getLastDomMutationForDebug();
|
|
281
|
+
}),
|
|
282
|
+
getDomMutationHistoryForDebug: monitor(function () {
|
|
283
|
+
return recorderApi.getDomMutationHistoryForDebug();
|
|
284
|
+
}),
|
|
285
|
+
getLastReplaySegmentFlushForDebug: monitor(function () {
|
|
286
|
+
return recorderApi.getLastReplaySegmentFlushForDebug();
|
|
287
|
+
}),
|
|
288
|
+
getReplaySegmentFlushHistoryForDebug: monitor(function () {
|
|
289
|
+
return recorderApi.getReplaySegmentFlushHistoryForDebug();
|
|
290
|
+
}),
|
|
291
|
+
getReplayPerformanceForDebug: monitor(function () {
|
|
292
|
+
return recorderApi.getReplayPerformanceForDebug();
|
|
293
|
+
}),
|
|
294
|
+
flushReplayMutationsForDebug: monitor(function () {
|
|
295
|
+
if (recorderApi.flushReplayMutationsForDebug) {
|
|
296
|
+
recorderApi.flushReplayMutationsForDebug();
|
|
297
|
+
}
|
|
298
|
+
}),
|
|
299
|
+
createResourceTrackerId: monitor(function () {
|
|
300
|
+
return resourceTrackerManager.createTrackerId();
|
|
301
|
+
}),
|
|
302
|
+
setResourceContext: monitor(function (trackerId, context) {
|
|
303
|
+
return resourceTrackerManager.setResourceContext(trackerId, sanitize(context));
|
|
304
|
+
}),
|
|
305
|
+
appendResourceContext: monitor(function (trackerId, context) {
|
|
306
|
+
return resourceTrackerManager.appendResourceContext(trackerId, sanitize(context));
|
|
307
|
+
}),
|
|
308
|
+
finishResource: monitor(function (trackerId) {
|
|
309
|
+
return resourceTrackerManager.finishResource(trackerId);
|
|
310
|
+
}),
|
|
311
|
+
getResource: monitor(function (trackerId) {
|
|
312
|
+
return resourceTrackerManager.getResource(trackerId);
|
|
313
|
+
})
|
|
254
314
|
});
|
|
255
315
|
return rumPublicApi;
|
|
256
316
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rumPublicApi.js","names":["makePublicApi","createContextManager","CustomerDataType","clocksNow","ActionType","ResourceType","deepClone","createHandlingStack","sanitizeUser","checkUser","callMonitored","assign","monitor","storeContextManager","createIdentityEncoder","addTelemetryUsage","sanitize","createCustomerDataTrackerManager","CustomerDataCompressionStatus","displayAlreadyInitializedError","getType","buildCommonContext","createPreStartStrategy","RUM_STORAGE_KEY","makeRumPublicApi","startRumImpl","recorderApi","options","undefined","customerDataTrackerManager","Unknown","globalContextManager","customerDataTracker","getOrCreateTracker","GlobalContext","userContextManager","User","propertiesConfig","id","type","name","email","getCommonContext","strategy","configuration","deflateWorker","initialViewOptions","storeContextsToLocal","setCompressionStatus","Enabled","Disabled","startRumResult","createDeflateEncoder","streamId","onRumStart","lifeCycle","session","viewContexts","createPostStartStrategy","startView","sanitizedOptions","_typeof","context","View","updateCustomerData","feature","rumPublicApi","init","initConfiguration","setViewName","setViewContext","setViewContextProperty","key","value","getViewContext","addRumGlobalContext","setContextProperty","setGlobalContextProperty","removeRumGlobalContext","removeContextProperty","removeGlobalContextProperty","getRumGlobalContext","getContext","getGlobalContext","setRumGlobalContext","setContext","setGlobalContext","clearGlobalContext","clearContext","getInitConfiguration","getRemoteConfiguration","callback","getInternalContext","startTime","addDebugSession","clearDebugSession","getDebugSession","addResource","handlingStack","startClocks","CUSTOM","addTypeAction","sourceType","addAction","addError","error","addTiming","time","setUser","newUser","getUser","setUserProperty","property","sanitizedProperty","removeUserProperty","removeUser","clearUser","stopSession","setForcedSession","startSessionReplayRecording","start","force","stopSessionReplayRecording","stop","takeSubsequentFullSnapshot","preStartStrategy"],"sources":["../../src/boot/rumPublicApi.js"],"sourcesContent":["import {\n makePublicApi,\n createContextManager,\n CustomerDataType,\n clocksNow,\n ActionType,\n ResourceType,\n deepClone,\n createHandlingStack,\n sanitizeUser,\n checkUser,\n callMonitored,\n assign,\n monitor,\n storeContextManager,\n createIdentityEncoder,\n addTelemetryUsage,\n sanitize,\n createCustomerDataTrackerManager,\n CustomerDataCompressionStatus,\n displayAlreadyInitializedError,\n getType\n} from '@cloudcare/browser-core'\nimport { buildCommonContext } from '../domain/contexts/commonContext'\nimport { createPreStartStrategy } from './perStartRum'\nvar RUM_STORAGE_KEY = 'rum'\nexport function makeRumPublicApi(startRumImpl, recorderApi, options) {\n if (options === undefined) {\n options = {}\n }\n const customerDataTrackerManager = createCustomerDataTrackerManager(\n CustomerDataCompressionStatus.Unknown\n )\n const globalContextManager = createContextManager('global', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.GlobalContext\n )\n })\n const userContextManager = createContextManager('user', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.User\n ),\n propertiesConfig: {\n id: { type: 'string' },\n name: { type: 'string' },\n email: { type: 'string' }\n }\n })\n function getCommonContext() {\n return buildCommonContext(\n globalContextManager,\n userContextManager,\n recorderApi\n )\n }\n let strategy = createPreStartStrategy(\n options,\n getCommonContext,\n function (configuration, deflateWorker, initialViewOptions) {\n if (configuration.storeContextsToLocal) {\n storeContextManager(\n configuration,\n globalContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.GlobalContext\n )\n storeContextManager(\n configuration,\n userContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.User\n )\n }\n customerDataTrackerManager.setCompressionStatus(\n deflateWorker\n ? CustomerDataCompressionStatus.Enabled\n : CustomerDataCompressionStatus.Disabled\n )\n var startRumResult = startRumImpl(\n configuration,\n recorderApi,\n customerDataTrackerManager,\n getCommonContext,\n initialViewOptions,\n deflateWorker && options.createDeflateEncoder\n ? function (streamId) {\n return options.createDeflateEncoder(deflateWorker, streamId)\n }\n : createIdentityEncoder\n )\n recorderApi.onRumStart(\n startRumResult.lifeCycle,\n configuration,\n startRumResult.session,\n startRumResult.viewContexts,\n deflateWorker\n )\n\n strategy = createPostStartStrategy(strategy, startRumResult)\n\n return startRumResult\n }\n )\n\n const startView = monitor(function (options) {\n const sanitizedOptions =\n typeof options === 'object' ? options : { name: options }\n strategy.startView(sanitizedOptions)\n if (sanitizedOptions.context) {\n customerDataTrackerManager\n .getOrCreateTracker(CustomerDataType.View)\n .updateCustomerData(sanitizedOptions.context)\n }\n addTelemetryUsage({ feature: 'start-view' })\n })\n\n var rumPublicApi = makePublicApi({\n init: monitor(function (initConfiguration) {\n strategy.init(initConfiguration)\n }),\n setViewName: monitor((name) => {\n strategy.setViewName(name)\n addTelemetryUsage({ feature: 'set-view-name' })\n }),\n\n setViewContext: monitor((context) => {\n strategy.setViewContext(context)\n addTelemetryUsage({ feature: 'set-view-context' })\n }),\n\n setViewContextProperty: monitor((key, value) => {\n strategy.setViewContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-view-context-property' })\n }),\n\n getViewContext: monitor(() => {\n addTelemetryUsage({ feature: 'set-view-context-property' })\n return strategy.getViewContext()\n }),\n /** @deprecated: use setGlobalContextProperty instead */\n addRumGlobalContext: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContextProperty: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n /** @deprecated: use removeGlobalContextProperty instead */\n removeRumGlobalContext: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n removeGlobalContextProperty: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: use getGlobalContext instead */\n getRumGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n getGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n\n /** @deprecated: use setGlobalContext instead */\n setRumGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n clearGlobalContext: monitor(function () {\n return globalContextManager.clearContext()\n }),\n\n getInitConfiguration: monitor(function () {\n return deepClone(strategy.initConfiguration)\n }),\n getRemoteConfiguration: monitor(function (callback) {\n return strategy.getRemoteConfiguration(callback)\n }),\n getInternalContext: monitor(function (startTime) {\n return strategy.getInternalContext(startTime)\n }),\n addDebugSession: monitor(function (id) {}),\n clearDebugSession: monitor(function () {}),\n getDebugSession: monitor(function () {}),\n addResource: monitor(function (context) {\n const handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addResource({\n context: sanitize(context),\n startClocks: clocksNow(),\n type: ResourceType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-resource' })\n })\n }),\n addTypeAction: monitor(function (name, type, context) {\n const handlingStack = createHandlingStack()\n\n callMonitored(function () {\n const sourceType = sanitize(type)\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type:\n getType(sourceType) === 'string' ? sourceType : ActionType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-type-action' })\n })\n }),\n addAction: monitor(function (name, context) {\n const handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type: ActionType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-action' })\n })\n }),\n addError: monitor(function (error, context) {\n var handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addError({\n error, // Do not sanitize error here, it is needed unserialized by computeRawError()\n handlingStack,\n context: sanitize(context),\n startClocks: clocksNow()\n })\n addTelemetryUsage({ feature: 'add-error' })\n })\n }),\n addTiming: monitor(function (name, time) {\n strategy.addTiming(sanitize(name), time)\n }),\n setUser: monitor(function (newUser) {\n if (checkUser(newUser)) {\n userContextManager.setContext(sanitizeUser(newUser))\n }\n addTelemetryUsage({ feature: 'set-user' })\n }),\n getUser: monitor(function () {\n return userContextManager.getContext()\n }),\n setUserProperty: monitor(function (key, property) {\n var newUser = {}\n newUser[key] = property\n var sanitizedProperty = sanitizeUser(newUser)[key]\n userContextManager.setContextProperty(key, sanitizedProperty)\n addTelemetryUsage({ feature: 'set-user' })\n }),\n removeUserProperty: monitor(function (key) {\n return userContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: renamed to clearUser */\n removeUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n clearUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n startView: startView,\n stopSession: monitor(function () {\n strategy.stopSession()\n addTelemetryUsage({ feature: 'stop-session' })\n }),\n setForcedSession: monitor(function () {\n strategy.setForcedSession()\n addTelemetryUsage({ feature: 'set-forced-session' })\n }),\n startSessionReplayRecording: monitor(function (options) {\n recorderApi.start(options)\n addTelemetryUsage({\n feature: 'start-session-replay-recording',\n force: options && options.force\n })\n }),\n stopSessionReplayRecording: monitor(recorderApi.stop),\n takeSubsequentFullSnapshot: monitor(recorderApi.takeSubsequentFullSnapshot)\n })\n return rumPublicApi\n}\nfunction createPostStartStrategy(preStartStrategy, startRumResult) {\n return assign(\n {\n init: function (initConfiguration) {\n displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)\n },\n initConfiguration: preStartStrategy.getInitConfiguration(),\n getRemoteConfiguration: function (callback) {\n preStartStrategy.getRemoteConfiguration(callback)\n }\n },\n startRumResult\n )\n}\n"],"mappings":";AAAA,SACEA,aAAa,EACbC,oBAAoB,EACpBC,gBAAgB,EAChBC,SAAS,EACTC,UAAU,EACVC,YAAY,EACZC,SAAS,EACTC,mBAAmB,EACnBC,YAAY,EACZC,SAAS,EACTC,aAAa,EACbC,MAAM,EACNC,OAAO,EACPC,mBAAmB,EACnBC,qBAAqB,EACrBC,iBAAiB,EACjBC,QAAQ,EACRC,gCAAgC,EAChCC,6BAA6B,EAC7BC,8BAA8B,EAC9BC,OAAO,QACF,yBAAyB;AAChC,SAASC,kBAAkB,QAAQ,kCAAkC;AACrE,SAASC,sBAAsB,QAAQ,eAAe;AACtD,IAAIC,eAAe,GAAG,KAAK;AAC3B,OAAO,SAASC,gBAAgBA,CAACC,YA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;MACpC+B,QAAQ,CAAC2E,gBAAgB,CAAC,CAAC;MAC3BvG,iBAAiB,CAAC;QAAEkD,OAAO,EAAE;MAAqB,CAAC,CAAC;IACtD,CAAC,CAAC;IACFsD,2BAA2B,EAAE3G,OAAO,CAAC,UAAUe,OAAO,EAAE;MACtDD,WAAW,CAAC8F,KAAK,CAAC7F,OAAO,CAAC;MAC1BZ,iBAAiB,CAAC;QAChBkD,OAAO,EAAE,gCAAgC;QACzCwD,KAAK,EAAE9F,OAAO,IAAIA,OAAO,CAAC8F;MAC5B,CAAC,CAAC;IACJ,CAAC,CAAC;IACFC,0BAA0B,EAAE9G,OAAO,CAACc,WAAW,CAACiG,IAAI,CAAC;IACrDC,0BAA0B,EAAEhH,OAAO,CAACc,WAAW,CAACkG,0BAA0B;EAC5E,CAAC,CAAC;EACF,OAAO1D,YAAY;AACrB;AACA,SAASR,uBAAuBA,CAACmE,gBAAgB,EAAE1E,cAAc,EAAE;EACjE,OAAOxC,MAAM,CACX;IACEwD,IAAI,EAAE,SAANA,IAAIA,CAAYC,iBAAiB,EAAE;MACjCjD,8BAA8B,CAAC,cAAc,EAAEiD,iBAAiB,CAAC;IACnE,CAAC;IACDA,iBAAiB,EAAEyD,gBAAgB,CAACpC,oBAAoB,CAAC,CAAC;IAC1DC,sBAAsB,EAAE,SAAxBA,sBAAsBA,CAAYC,QAAQ,EAAE;MAC1CkC,gBAAgB,CAACnC,sBAAsB,CAACC,QAAQ,CAAC;IACnD;EACF,CAAC,EACDxC,cACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"rumPublicApi.js","names":["makePublicApi","createContextManager","CustomerDataType","clocksNow","ActionType","ResourceType","deepClone","createHandlingStack","sanitizeUser","checkUser","callMonitored","assign","monitor","storeContextManager","createIdentityEncoder","addTelemetryUsage","sanitize","createCustomerDataTrackerManager","CustomerDataCompressionStatus","displayAlreadyInitializedError","getType","buildCommonContext","createPreStartStrategy","createResourceTrackerManager","RUM_STORAGE_KEY","makeRumPublicApi","startRumImpl","recorderApi","options","undefined","customerDataTrackerManager","Unknown","resourceTrackerManager","globalContextManager","customerDataTracker","getOrCreateTracker","GlobalContext","userContextManager","User","propertiesConfig","id","type","name","email","getCommonContext","strategy","configuration","deflateWorker","initialViewOptions","storeContextsToLocal","setCompressionStatus","Enabled","Disabled","startRumResult","createDeflateEncoder","streamId","onRumStart","lifeCycle","session","viewContexts","createPostStartStrategy","startView","sanitizedOptions","_typeof","context","View","updateCustomerData","feature","rumPublicApi","init","initConfiguration","setViewName","setViewContext","setViewContextProperty","key","value","getViewContext","addRumGlobalContext","setContextProperty","setGlobalContextProperty","removeRumGlobalContext","removeContextProperty","removeGlobalContextProperty","getRumGlobalContext","getContext","getGlobalContext","setRumGlobalContext","setContext","setGlobalContext","clearGlobalContext","clearContext","getInitConfiguration","getRemoteConfiguration","callback","getInternalContext","startTime","addDebugSession","clearDebugSession","getDebugSession","addResource","handlingStack","startClocks","CUSTOM","addTypeAction","sourceType","addAction","addError","error","addTiming","time","setUser","newUser","getUser","setUserProperty","property","sanitizedProperty","removeUserProperty","removeUser","clearUser","stopSession","setForcedSession","startSessionReplayRecording","start","force","isRecording","stopSessionReplayRecording","stop","takeSubsequentFullSnapshot","snapshotCanvas","canvas","getSerializedNodeIdForDebug","node","getLastAutoCanvasSnapshotResultForDebug","getAutoCanvasSnapshotDebugHistoryForDebug","getLastCanvasMutationForDebug","getCanvasMutationHistoryForDebug","getLastDomMutationForDebug","getDomMutationHistoryForDebug","getLastReplaySegmentFlushForDebug","getReplaySegmentFlushHistoryForDebug","getReplayPerformanceForDebug","flushReplayMutationsForDebug","createResourceTrackerId","createTrackerId","setResourceContext","trackerId","appendResourceContext","finishResource","getResource","preStartStrategy"],"sources":["../../src/boot/rumPublicApi.js"],"sourcesContent":["import {\n makePublicApi,\n createContextManager,\n CustomerDataType,\n clocksNow,\n ActionType,\n ResourceType,\n deepClone,\n createHandlingStack,\n sanitizeUser,\n checkUser,\n callMonitored,\n assign,\n monitor,\n storeContextManager,\n createIdentityEncoder,\n addTelemetryUsage,\n sanitize,\n createCustomerDataTrackerManager,\n CustomerDataCompressionStatus,\n displayAlreadyInitializedError,\n getType\n} from '@cloudcare/browser-core'\nimport { buildCommonContext } from '../domain/contexts/commonContext'\nimport { createPreStartStrategy } from './perStartRum'\nimport { createResourceTrackerManager } from '../domain/rumEventsCollection/resource/resourceTrackerManager'\nvar RUM_STORAGE_KEY = 'rum'\nexport function makeRumPublicApi(startRumImpl, recorderApi, options) {\n if (options === undefined) {\n options = {}\n }\n const customerDataTrackerManager = createCustomerDataTrackerManager(\n CustomerDataCompressionStatus.Unknown\n )\n const resourceTrackerManager = createResourceTrackerManager()\n const globalContextManager = createContextManager('global', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.GlobalContext\n )\n })\n const userContextManager = createContextManager('user', {\n customerDataTracker: customerDataTrackerManager.getOrCreateTracker(\n CustomerDataType.User\n ),\n propertiesConfig: {\n id: { type: 'string' },\n name: { type: 'string' },\n email: { type: 'string' }\n }\n })\n function getCommonContext() {\n return buildCommonContext(\n globalContextManager,\n userContextManager,\n recorderApi\n )\n }\n let strategy = createPreStartStrategy(\n assign({}, options, {\n resourceTrackerManager: resourceTrackerManager\n }),\n getCommonContext,\n function (configuration, deflateWorker, initialViewOptions) {\n if (configuration.storeContextsToLocal) {\n storeContextManager(\n configuration,\n globalContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.GlobalContext\n )\n storeContextManager(\n configuration,\n userContextManager,\n RUM_STORAGE_KEY,\n CustomerDataType.User\n )\n }\n customerDataTrackerManager.setCompressionStatus(\n deflateWorker\n ? CustomerDataCompressionStatus.Enabled\n : CustomerDataCompressionStatus.Disabled\n )\n var startRumResult = startRumImpl(\n configuration,\n recorderApi,\n customerDataTrackerManager,\n getCommonContext,\n initialViewOptions,\n deflateWorker && options.createDeflateEncoder\n ? function (streamId) {\n return options.createDeflateEncoder(deflateWorker, streamId)\n }\n : createIdentityEncoder,\n resourceTrackerManager\n )\n recorderApi.onRumStart(\n startRumResult.lifeCycle,\n configuration,\n startRumResult.session,\n startRumResult.viewContexts,\n deflateWorker\n )\n\n strategy = createPostStartStrategy(strategy, startRumResult)\n\n return startRumResult\n }\n )\n\n const startView = monitor(function (options) {\n const sanitizedOptions =\n typeof options === 'object' ? options : { name: options }\n strategy.startView(sanitizedOptions)\n if (sanitizedOptions.context) {\n customerDataTrackerManager\n .getOrCreateTracker(CustomerDataType.View)\n .updateCustomerData(sanitizedOptions.context)\n }\n addTelemetryUsage({ feature: 'start-view' })\n })\n\n var rumPublicApi = makePublicApi({\n init: monitor(function (initConfiguration) {\n strategy.init(initConfiguration)\n }),\n setViewName: monitor((name) => {\n strategy.setViewName(name)\n addTelemetryUsage({ feature: 'set-view-name' })\n }),\n\n setViewContext: monitor((context) => {\n strategy.setViewContext(context)\n addTelemetryUsage({ feature: 'set-view-context' })\n }),\n\n setViewContextProperty: monitor((key, value) => {\n strategy.setViewContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-view-context-property' })\n }),\n\n getViewContext: monitor(() => {\n addTelemetryUsage({ feature: 'set-view-context-property' })\n return strategy.getViewContext()\n }),\n /** @deprecated: use setGlobalContextProperty instead */\n addRumGlobalContext: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContextProperty: monitor(function (key, value) {\n globalContextManager.setContextProperty(key, value)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n /** @deprecated: use removeGlobalContextProperty instead */\n removeRumGlobalContext: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n removeGlobalContextProperty: monitor(function (key) {\n return globalContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: use getGlobalContext instead */\n getRumGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n getGlobalContext: monitor(function () {\n return globalContextManager.getContext()\n }),\n\n /** @deprecated: use setGlobalContext instead */\n setRumGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n setGlobalContext: monitor(function (context) {\n globalContextManager.setContext(context)\n addTelemetryUsage({ feature: 'set-global-context' })\n }),\n\n clearGlobalContext: monitor(function () {\n return globalContextManager.clearContext()\n }),\n\n getInitConfiguration: monitor(function () {\n return deepClone(strategy.initConfiguration)\n }),\n getRemoteConfiguration: monitor(function (callback) {\n return strategy.getRemoteConfiguration(callback)\n }),\n getInternalContext: monitor(function (startTime) {\n return strategy.getInternalContext(startTime)\n }),\n addDebugSession: monitor(function (id) {}),\n clearDebugSession: monitor(function () {}),\n getDebugSession: monitor(function () {}),\n addResource: monitor(function (context) {\n const handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addResource({\n context: sanitize(context),\n startClocks: clocksNow(),\n type: ResourceType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-resource' })\n })\n }),\n addTypeAction: monitor(function (name, type, context) {\n const handlingStack = createHandlingStack()\n\n callMonitored(function () {\n const sourceType = sanitize(type)\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type:\n getType(sourceType) === 'string' ? sourceType : ActionType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-type-action' })\n })\n }),\n addAction: monitor(function (name, context) {\n const handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addAction({\n name: sanitize(name),\n context: sanitize(context),\n startClocks: clocksNow(),\n type: ActionType.CUSTOM,\n handlingStack: handlingStack\n })\n addTelemetryUsage({ feature: 'add-action' })\n })\n }),\n addError: monitor(function (error, context) {\n var handlingStack = createHandlingStack()\n callMonitored(function () {\n strategy.addError({\n error, // Do not sanitize error here, it is needed unserialized by computeRawError()\n handlingStack,\n context: sanitize(context),\n startClocks: clocksNow()\n })\n addTelemetryUsage({ feature: 'add-error' })\n })\n }),\n addTiming: monitor(function (name, time) {\n strategy.addTiming(sanitize(name), time)\n }),\n setUser: monitor(function (newUser) {\n if (checkUser(newUser)) {\n userContextManager.setContext(sanitizeUser(newUser))\n }\n addTelemetryUsage({ feature: 'set-user' })\n }),\n getUser: monitor(function () {\n return userContextManager.getContext()\n }),\n setUserProperty: monitor(function (key, property) {\n var newUser = {}\n newUser[key] = property\n var sanitizedProperty = sanitizeUser(newUser)[key]\n userContextManager.setContextProperty(key, sanitizedProperty)\n addTelemetryUsage({ feature: 'set-user' })\n }),\n removeUserProperty: monitor(function (key) {\n return userContextManager.removeContextProperty(key)\n }),\n\n /** @deprecated: renamed to clearUser */\n removeUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n clearUser: monitor(function () {\n return userContextManager.clearContext()\n }),\n startView: startView,\n stopSession: monitor(function () {\n strategy.stopSession()\n addTelemetryUsage({ feature: 'stop-session' })\n }),\n setForcedSession: monitor(function () {\n strategy.setForcedSession()\n addTelemetryUsage({ feature: 'set-forced-session' })\n }),\n startSessionReplayRecording: monitor(function (options) {\n recorderApi.start(options)\n addTelemetryUsage({\n feature: 'start-session-replay-recording',\n force: options && options.force\n })\n }),\n isRecording: monitor(function () {\n return recorderApi.isRecording()\n }),\n stopSessionReplayRecording: monitor(recorderApi.stop),\n takeSubsequentFullSnapshot: monitor(recorderApi.takeSubsequentFullSnapshot),\n snapshotCanvas: monitor(function (canvas, options) {\n return recorderApi.snapshotCanvas(canvas, options)\n }),\n getSerializedNodeIdForDebug: monitor(function (node) {\n return recorderApi.getSerializedNodeIdForDebug(node)\n }),\n getLastAutoCanvasSnapshotResultForDebug: monitor(function () {\n return recorderApi.getLastAutoCanvasSnapshotResultForDebug()\n }),\n getAutoCanvasSnapshotDebugHistoryForDebug: monitor(function () {\n return recorderApi.getAutoCanvasSnapshotDebugHistoryForDebug()\n }),\n getLastCanvasMutationForDebug: monitor(function () {\n return recorderApi.getLastCanvasMutationForDebug()\n }),\n getCanvasMutationHistoryForDebug: monitor(function () {\n return recorderApi.getCanvasMutationHistoryForDebug()\n }),\n getLastDomMutationForDebug: monitor(function () {\n return recorderApi.getLastDomMutationForDebug()\n }),\n getDomMutationHistoryForDebug: monitor(function () {\n return recorderApi.getDomMutationHistoryForDebug()\n }),\n getLastReplaySegmentFlushForDebug: monitor(function () {\n return recorderApi.getLastReplaySegmentFlushForDebug()\n }),\n getReplaySegmentFlushHistoryForDebug: monitor(function () {\n return recorderApi.getReplaySegmentFlushHistoryForDebug()\n }),\n getReplayPerformanceForDebug: monitor(function () {\n return recorderApi.getReplayPerformanceForDebug()\n }),\n flushReplayMutationsForDebug: monitor(function () {\n if (recorderApi.flushReplayMutationsForDebug) {\n recorderApi.flushReplayMutationsForDebug()\n }\n }),\n createResourceTrackerId: monitor(function () {\n return resourceTrackerManager.createTrackerId()\n }),\n setResourceContext: monitor(function (trackerId, context) {\n return resourceTrackerManager.setResourceContext(\n trackerId,\n sanitize(context)\n )\n }),\n appendResourceContext: monitor(function (trackerId, context) {\n return resourceTrackerManager.appendResourceContext(\n trackerId,\n sanitize(context)\n )\n }),\n finishResource: monitor(function (trackerId) {\n return resourceTrackerManager.finishResource(trackerId)\n }),\n getResource: monitor(function (trackerId) {\n return resourceTrackerManager.getResource(trackerId)\n })\n })\n return rumPublicApi\n}\nfunction createPostStartStrategy(preStartStrategy, startRumResult) {\n return assign(\n {\n init: function (initConfiguration) {\n displayAlreadyInitializedError('DATAFLUX_RUM', initConfiguration)\n },\n initConfiguration: preStartStrategy.getInitConfiguration(),\n getRemoteConfiguration: function (callback) {\n preStartStrategy.getRemoteConfiguration(callback)\n }\n },\n startRumResult\n )\n}\n"],"mappings":";AAAA,SACEA,aAAa,EACbC,oBAAoB,EACpBC,gBAAgB,EAChBC,SAAS,EACTC,UAAU,EACVC,YAAY,EACZC,SAAS,EACTC,mBAAmB,EACnBC,YAAY,EACZC,SAAS,EACTC,aAAa,EACbC,MAAM,EACNC,OAAO,EACPC,mBAAmB,EACnBC,qBAAqB,EACrBC,iBAAiB,EACjBC,QAAQ,EACRC,gCAA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C;IACjD,CAAC,CAAC;IACFC,kBAAkB,EAAEpI,OAAO,CAAC,UAAUqI,SAAS,EAAEjF,OAAO,EAAE;MACxD,OAAOhC,sBAAsB,CAACgH,kBAAkB,CAC9CC,SAAS,EACTjI,QAAQ,CAACgD,OAAO,CAClB,CAAC;IACH,CAAC,CAAC;IACFkF,qBAAqB,EAAEtI,OAAO,CAAC,UAAUqI,SAAS,EAAEjF,OAAO,EAAE;MAC3D,OAAOhC,sBAAsB,CAACkH,qBAAqB,CACjDD,SAAS,EACTjI,QAAQ,CAACgD,OAAO,CAClB,CAAC;IACH,CAAC,CAAC;IACFmF,cAAc,EAAEvI,OAAO,CAAC,UAAUqI,SAAS,EAAE;MAC3C,OAAOjH,sBAAsB,CAACmH,cAAc,CAACF,SAAS,CAAC;IACzD,CAAC,CAAC;IACFG,WAAW,EAAExI,OAAO,CAAC,UAAUqI,SAAS,EAAE;MACxC,OAAOjH,sBAAsB,CAACoH,WAAW,CAACH,SAAS,CAAC;IACtD,CAAC;EACH,CAAC,CAAC;EACF,OAAO7E,YAAY;AACrB;AACA,SAASR,uBAAuBA,CAACyF,gBAAgB,EAAEhG,cAAc,EAAE;EACjE,OAAO1C,MAAM,CACX;IACE0D,IAAI,EAAE,SAANA,IAAIA,CAAYC,iBAAiB,EAAE;MACjCnD,8BAA8B,CAAC,cAAc,EAAEmD,iBAAiB,CAAC;IACnE,CAAC;IACDA,iBAAiB,EAAE+E,gBAAgB,CAAC1D,oBAAoB,CAAC,CAAC;IAC1DC,sBAAsB,EAAE,SAAxBA,sBAAsBA,CAAYC,QAAQ,EAAE;MAC1CwD,gBAAgB,CAACzD,sBAAsB,CAACC,QAAQ,CAAC;IACnD;EACF,CAAC,EACDxC,cACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { timeStampNow, createHttpRequest, LifeCycleEventType, addTelemetryDebug, ONE_SECOND, canUseEventBridge } from '@cloudcare/browser-core';
|
|
1
|
+
import { timeStampNow, createHttpRequest, LifeCycleEventType, addTelemetryDebug, ONE_SECOND, canUseEventBridge, assign } from '@cloudcare/browser-core';
|
|
2
2
|
import { record } from '../domain/replay/record';
|
|
3
3
|
import { startRecordBridge } from '../domain/replay/startRecordBridge';
|
|
4
4
|
import { startSegmentCollection, SEGMENT_BYTES_LIMIT } from '../domain/replay/segmentCollection';
|
|
@@ -6,8 +6,12 @@ import { RecordType } from '../types';
|
|
|
6
6
|
import { deleteOldestStats } from '../domain/replay/replayStats';
|
|
7
7
|
/* How long to wait for error checkouts */
|
|
8
8
|
export var BUFFER_CHECKOUT_TIME = 60 * ONE_SECOND;
|
|
9
|
+
var REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT = 10;
|
|
9
10
|
export function startRecording(lifeCycle, configuration, sessionManager, viewContexts, encoder, httpRequest) {
|
|
10
11
|
var cleanupTasks = [];
|
|
12
|
+
var lastReplaySegmentFlushForDebug;
|
|
13
|
+
var replaySegmentFlushHistoryForDebug = [];
|
|
14
|
+
var replaySegmentFlushCount = 0;
|
|
11
15
|
var reportError = function reportError(error) {
|
|
12
16
|
lifeCycle.notify(LifeCycleEventType.RAW_ERROR_COLLECTED, {
|
|
13
17
|
error: error
|
|
@@ -21,7 +25,16 @@ export function startRecording(lifeCycle, configuration, sessionManager, viewCon
|
|
|
21
25
|
if (!canUseEventBridge()) {
|
|
22
26
|
var session = sessionManager.findTrackedSession();
|
|
23
27
|
var isRecordErrorSessionReplay = session && session.errorSessionReplayAllowed && !session.sessionHasError;
|
|
24
|
-
var segmentCollection = startSegmentCollection(lifeCycle, configuration, sessionManager, viewContexts, replayRequest, encoder, isRecordErrorSessionReplay
|
|
28
|
+
var segmentCollection = startSegmentCollection(lifeCycle, configuration, sessionManager, viewContexts, replayRequest, encoder, isRecordErrorSessionReplay, {
|
|
29
|
+
onSegmentFlushed: function onSegmentFlushed(segmentFlush) {
|
|
30
|
+
replaySegmentFlushCount += 1;
|
|
31
|
+
lastReplaySegmentFlushForDebug = cloneReplaySegmentFlushForDebug(segmentFlush, replaySegmentFlushCount);
|
|
32
|
+
replaySegmentFlushHistoryForDebug.push(lastReplaySegmentFlushForDebug);
|
|
33
|
+
if (replaySegmentFlushHistoryForDebug.length > REPLAY_SEGMENT_FLUSH_HISTORY_LIMIT) {
|
|
34
|
+
replaySegmentFlushHistoryForDebug.shift();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
25
38
|
addRecord = segmentCollection.addRecord;
|
|
26
39
|
var flushBufferSegment = segmentCollection.flushBufferSegment;
|
|
27
40
|
var unlockSegment = segmentCollection.unlockSegment;
|
|
@@ -57,7 +70,8 @@ export function startRecording(lifeCycle, configuration, sessionManager, viewCon
|
|
|
57
70
|
_record = record({
|
|
58
71
|
emit: wrappedEmit,
|
|
59
72
|
configuration: configuration,
|
|
60
|
-
lifeCycle: lifeCycle
|
|
73
|
+
lifeCycle: lifeCycle,
|
|
74
|
+
sessionManager: sessionManager
|
|
61
75
|
});
|
|
62
76
|
} else {
|
|
63
77
|
;
|
|
@@ -66,11 +80,31 @@ export function startRecording(lifeCycle, configuration, sessionManager, viewCon
|
|
|
66
80
|
_record = record({
|
|
67
81
|
emit: addRecord,
|
|
68
82
|
configuration: configuration,
|
|
69
|
-
lifeCycle: lifeCycle
|
|
83
|
+
lifeCycle: lifeCycle,
|
|
84
|
+
sessionManager: sessionManager
|
|
70
85
|
});
|
|
71
86
|
}
|
|
72
87
|
cleanupTasks.push(_record.stop);
|
|
73
88
|
var takeSubsequentFullSnapshot = _record.takeSubsequentFullSnapshot;
|
|
89
|
+
var snapshotCanvas = _record.snapshotCanvas;
|
|
90
|
+
var getSerializedNodeIdForDebug = _record.getSerializedNodeIdForDebug;
|
|
91
|
+
var getLastAutoCanvasSnapshotResultForDebug = _record.getLastAutoCanvasSnapshotResultForDebug;
|
|
92
|
+
var getAutoCanvasSnapshotDebugHistoryForDebug = _record.getAutoCanvasSnapshotDebugHistoryForDebug;
|
|
93
|
+
var getLastCanvasMutationForDebug = _record.getLastCanvasMutationForDebug;
|
|
94
|
+
var getCanvasMutationHistoryForDebug = _record.getCanvasMutationHistoryForDebug;
|
|
95
|
+
var getLastDomMutationForDebug = _record.getLastDomMutationForDebug;
|
|
96
|
+
var getDomMutationHistoryForDebug = _record.getDomMutationHistoryForDebug;
|
|
97
|
+
var getReplayPerformanceForDebug = function getReplayPerformanceForDebug() {
|
|
98
|
+
return cloneReplayPerformanceForDebug(_record.getReplayPerformanceForDebug ? _record.getReplayPerformanceForDebug() : undefined, replaySegmentFlushCount);
|
|
99
|
+
};
|
|
100
|
+
var getLastReplaySegmentFlushForDebug = function getLastReplaySegmentFlushForDebug() {
|
|
101
|
+
return cloneReplaySegmentFlushForDebug(lastReplaySegmentFlushForDebug);
|
|
102
|
+
};
|
|
103
|
+
var getReplaySegmentFlushHistoryForDebug = function getReplaySegmentFlushHistoryForDebug() {
|
|
104
|
+
return replaySegmentFlushHistoryForDebug.map(function (segmentFlush) {
|
|
105
|
+
return cloneReplaySegmentFlushForDebug(segmentFlush);
|
|
106
|
+
});
|
|
107
|
+
};
|
|
74
108
|
var flushMutations = _record.flushMutations;
|
|
75
109
|
var subscribeViewEnded = lifeCycle.subscribe(LifeCycleEventType.VIEW_ENDED, function () {
|
|
76
110
|
flushMutations();
|
|
@@ -90,7 +124,43 @@ export function startRecording(lifeCycle, configuration, sessionManager, viewCon
|
|
|
90
124
|
task();
|
|
91
125
|
});
|
|
92
126
|
},
|
|
93
|
-
takeSubsequentFullSnapshot: takeSubsequentFullSnapshot
|
|
127
|
+
takeSubsequentFullSnapshot: takeSubsequentFullSnapshot,
|
|
128
|
+
snapshotCanvas: snapshotCanvas,
|
|
129
|
+
getSerializedNodeIdForDebug: getSerializedNodeIdForDebug,
|
|
130
|
+
getLastAutoCanvasSnapshotResultForDebug: getLastAutoCanvasSnapshotResultForDebug,
|
|
131
|
+
getAutoCanvasSnapshotDebugHistoryForDebug: getAutoCanvasSnapshotDebugHistoryForDebug,
|
|
132
|
+
getLastCanvasMutationForDebug: getLastCanvasMutationForDebug,
|
|
133
|
+
getCanvasMutationHistoryForDebug: getCanvasMutationHistoryForDebug,
|
|
134
|
+
getLastDomMutationForDebug: getLastDomMutationForDebug,
|
|
135
|
+
getDomMutationHistoryForDebug: getDomMutationHistoryForDebug,
|
|
136
|
+
getLastReplaySegmentFlushForDebug: getLastReplaySegmentFlushForDebug,
|
|
137
|
+
getReplaySegmentFlushHistoryForDebug: getReplaySegmentFlushHistoryForDebug,
|
|
138
|
+
getReplayPerformanceForDebug: getReplayPerformanceForDebug,
|
|
139
|
+
flushReplayMutationsForDebug: flushMutations
|
|
94
140
|
};
|
|
95
141
|
}
|
|
142
|
+
function cloneReplaySegmentFlushForDebug(segmentFlush, sequence) {
|
|
143
|
+
if (!segmentFlush) {
|
|
144
|
+
return segmentFlush;
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
sequence: typeof sequence === 'number' ? sequence : segmentFlush.sequence,
|
|
148
|
+
creationReason: segmentFlush.creationReason,
|
|
149
|
+
flushReason: segmentFlush.flushReason,
|
|
150
|
+
recordsCount: segmentFlush.recordsCount,
|
|
151
|
+
recordCountsByType: assign({}, segmentFlush.recordCountsByType),
|
|
152
|
+
start: segmentFlush.start,
|
|
153
|
+
end: segmentFlush.end,
|
|
154
|
+
indexInView: segmentFlush.indexInView,
|
|
155
|
+
rawBytesCount: segmentFlush.rawBytesCount
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
function cloneReplayPerformanceForDebug(stats, replaySegmentFlushCount) {
|
|
159
|
+
if (!stats && typeof replaySegmentFlushCount === 'undefined') {
|
|
160
|
+
return undefined;
|
|
161
|
+
}
|
|
162
|
+
return assign({}, stats || {}, {
|
|
163
|
+
replaySegmentFlushCount: replaySegmentFlushCount || 0
|
|
164
|
+
});
|
|
165
|
+
}
|
|
96
166
|
//# sourceMappingURL=startRecording.js.map
|