@kubesense/kubesense-browser-rum 1.8.0 → 2.0.0-beta.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/LICENSE +1 -1
- package/README.md +23 -0
- package/bundle/chunks/kubesenseProfiler-4b8cfd8f889074788478-kubesense-rum.js +1 -0
- package/bundle/chunks/kubesenseRecorder-db948e96649585a2b3e9-kubesense-rum.js +1 -0
- package/bundle/kubesense-rum.js +1 -1
- package/cjs/boot/kubesenseRecorder.d.ts +6 -0
- package/cjs/boot/kubesenseRecorder.js +75 -0
- package/cjs/boot/kubesenseRecorder.js.map +1 -0
- package/cjs/boot/lazyLoadProfiler.d.ts +3 -4
- package/cjs/boot/lazyLoadProfiler.js +18 -50
- package/cjs/boot/lazyLoadProfiler.js.map +1 -1
- package/cjs/boot/lazyLoadRecorder.d.ts +3 -4
- package/cjs/boot/lazyLoadRecorder.js +18 -50
- package/cjs/boot/lazyLoadRecorder.js.map +1 -1
- package/cjs/boot/postStartStrategy.d.ts +4 -4
- package/cjs/boot/postStartStrategy.js +89 -110
- package/cjs/boot/postStartStrategy.js.map +1 -1
- package/cjs/boot/preStartStrategy.js +21 -21
- package/cjs/boot/preStartStrategy.js.map +1 -1
- package/cjs/boot/profilerApi.js +44 -50
- package/cjs/boot/profilerApi.js.map +1 -1
- package/cjs/boot/recorderApi.d.ts +1 -3
- package/cjs/boot/recorderApi.js +41 -71
- package/cjs/boot/recorderApi.js.map +1 -1
- package/cjs/domain/deflate/deflateEncoder.d.ts +1 -2
- package/cjs/domain/deflate/deflateEncoder.js +94 -108
- package/cjs/domain/deflate/deflateEncoder.js.map +1 -1
- package/cjs/domain/deflate/deflateWorker.d.ts +3 -4
- package/cjs/domain/deflate/deflateWorker.js +79 -90
- package/cjs/domain/deflate/deflateWorker.js.map +1 -1
- package/cjs/domain/deflate/index.d.ts +1 -1
- package/cjs/domain/deflate/index.js +5 -10
- package/cjs/domain/getSessionReplayLink.d.ts +3 -2
- package/cjs/domain/getSessionReplayLink.js +17 -31
- package/cjs/domain/getSessionReplayLink.js.map +1 -1
- package/cjs/domain/profiling/actionHistory.d.ts +10 -0
- package/cjs/domain/profiling/actionHistory.js +37 -0
- package/cjs/domain/profiling/actionHistory.js.map +1 -0
- package/cjs/domain/profiling/kubesenseProfiler.d.ts +6 -0
- package/cjs/domain/profiling/kubesenseProfiler.js +243 -0
- package/cjs/domain/profiling/kubesenseProfiler.js.map +1 -0
- package/cjs/domain/profiling/longTaskHistory.d.ts +11 -0
- package/cjs/domain/profiling/longTaskHistory.js +22 -0
- package/cjs/domain/profiling/longTaskHistory.js.map +1 -0
- package/cjs/domain/profiling/profilerDebugIds.d.ts +2 -0
- package/cjs/domain/profiling/profilerDebugIds.js +18 -0
- package/cjs/domain/profiling/profilerDebugIds.js.map +1 -0
- package/cjs/domain/profiling/profilingContext.js +20 -25
- package/cjs/domain/profiling/profilingContext.js.map +1 -1
- package/cjs/domain/profiling/profilingSupported.js +6 -8
- package/cjs/domain/profiling/profilingSupported.js.map +1 -1
- package/cjs/domain/profiling/quotaCheck.d.ts +9 -0
- package/cjs/domain/profiling/quotaCheck.js +66 -0
- package/cjs/domain/profiling/quotaCheck.js.map +1 -0
- package/cjs/domain/profiling/test-utils/mockedTrace.d.ts +1 -1
- package/cjs/domain/profiling/transport/buildProfileEvent.d.ts +38 -0
- package/cjs/domain/profiling/transport/buildProfileEvent.js +91 -0
- package/cjs/domain/profiling/transport/buildProfileEvent.js.map +1 -0
- package/cjs/domain/profiling/transport/formDataEmitter.d.ts +5 -0
- package/cjs/domain/profiling/transport/formDataEmitter.js +17 -0
- package/cjs/domain/profiling/transport/formDataEmitter.js.map +1 -0
- package/cjs/domain/profiling/transport/profilingBridge.d.ts +2 -0
- package/cjs/domain/profiling/transport/profilingBridge.js +12 -0
- package/cjs/domain/profiling/transport/profilingBridge.js.map +1 -0
- package/cjs/domain/profiling/{types/rumProfiler.types.d.ts → types.d.ts} +13 -24
- package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.js +5 -5
- package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.js.map +1 -1
- package/cjs/domain/profiling/utils/getDefaultViewName.js +6 -10
- package/cjs/domain/profiling/utils/getDefaultViewName.js.map +1 -1
- package/cjs/domain/profiling/vitalHistory.d.ts +13 -0
- package/cjs/domain/profiling/vitalHistory.js +56 -0
- package/cjs/domain/profiling/vitalHistory.js.map +1 -0
- package/cjs/domain/record/assembly.d.ts +2 -1
- package/cjs/domain/record/assembly.js +15 -14
- package/cjs/domain/record/assembly.js.map +1 -1
- package/cjs/domain/record/canvas/canvasHash.d.ts +2 -0
- package/cjs/domain/record/canvas/canvasHash.js +33 -0
- package/cjs/domain/record/canvas/canvasHash.js.map +1 -0
- package/cjs/domain/record/canvas/canvasManager.d.ts +42 -0
- package/cjs/domain/record/canvas/canvasManager.js +99 -0
- package/cjs/domain/record/canvas/canvasManager.js.map +1 -0
- package/cjs/domain/record/canvas/canvasSnapshot.d.ts +8 -0
- package/cjs/domain/record/canvas/canvasSnapshot.js +40 -0
- package/cjs/domain/record/canvas/canvasSnapshot.js.map +1 -0
- package/cjs/domain/record/canvas/canvasUtils.d.ts +2 -0
- package/cjs/domain/record/canvas/canvasUtils.js +14 -0
- package/cjs/domain/record/canvas/canvasUtils.js.map +1 -0
- package/cjs/domain/record/elementsScrollPositions.js +17 -20
- package/cjs/domain/record/elementsScrollPositions.js.map +1 -1
- package/cjs/domain/record/encoding/changeDecoder.d.ts +39 -0
- package/cjs/domain/record/encoding/changeDecoder.js +152 -0
- package/cjs/domain/record/encoding/changeDecoder.js.map +1 -0
- package/cjs/domain/record/encoding/changeEncoder.d.ts +39 -0
- package/cjs/domain/record/encoding/changeEncoder.js +146 -0
- package/cjs/domain/record/encoding/changeEncoder.js.map +1 -0
- package/cjs/domain/record/encoding/index.d.ts +10 -0
- package/cjs/domain/record/encoding/itemIds.d.ts +32 -0
- package/cjs/domain/record/encoding/itemIds.js +49 -0
- package/cjs/domain/record/encoding/itemIds.js.map +1 -0
- package/cjs/domain/record/encoding/roles.d.ts +52 -0
- package/cjs/domain/record/encoding/roles.js +66 -0
- package/cjs/domain/record/encoding/roles.js.map +1 -0
- package/cjs/domain/record/encoding/stringIds.d.ts +15 -0
- package/cjs/domain/record/encoding/stringIds.js +47 -0
- package/cjs/domain/record/encoding/stringIds.js.map +1 -0
- package/cjs/domain/record/encoding/stringTable.d.ts +15 -0
- package/cjs/domain/record/encoding/stringTable.js +38 -0
- package/cjs/domain/record/encoding/stringTable.js.map +1 -0
- package/cjs/domain/record/eventsUtils.js +9 -10
- package/cjs/domain/record/eventsUtils.js.map +1 -1
- package/cjs/domain/record/index.d.ts +5 -2
- package/cjs/domain/record/index.js +13 -17
- package/cjs/domain/record/internalApi.d.ts +6 -6
- package/cjs/domain/record/internalApi.js +55 -49
- package/cjs/domain/record/internalApi.js.map +1 -1
- package/cjs/domain/record/mutationBatch.d.ts +1 -0
- package/cjs/domain/record/mutationBatch.js +38 -39
- package/cjs/domain/record/mutationBatch.js.map +1 -1
- package/cjs/domain/record/record.d.ts +7 -1
- package/cjs/domain/record/record.js +76 -87
- package/cjs/domain/record/record.js.map +1 -1
- package/cjs/domain/record/record.types.d.ts +1 -0
- package/cjs/domain/record/recordingScope.d.ts +7 -3
- package/cjs/domain/record/recordingScope.js +25 -11
- package/cjs/domain/record/recordingScope.js.map +1 -1
- package/cjs/domain/record/serialization/index.d.ts +4 -2
- package/cjs/domain/record/serialization/index.js +16 -18
- package/cjs/domain/record/serialization/insertionCursor.d.ts +57 -0
- package/cjs/domain/record/serialization/insertionCursor.js +55 -0
- package/cjs/domain/record/serialization/insertionCursor.js.map +1 -0
- package/cjs/domain/record/serialization/serialization.types.d.ts +0 -6
- package/cjs/domain/record/serialization/serializationStats.js +26 -25
- package/cjs/domain/record/serialization/serializationStats.js.map +1 -1
- package/cjs/domain/record/serialization/serializationTransaction.d.ts +44 -22
- package/cjs/domain/record/serialization/serializationTransaction.js +90 -36
- package/cjs/domain/record/serialization/serializationTransaction.js.map +1 -1
- package/cjs/domain/record/serialization/serializationUtils.d.ts +0 -1
- package/cjs/domain/record/serialization/serializationUtils.js +46 -75
- package/cjs/domain/record/serialization/serializationUtils.js.map +1 -1
- package/cjs/domain/record/serialization/serializeAttribute.js +24 -39
- package/cjs/domain/record/serialization/serializeAttribute.js.map +1 -1
- package/cjs/domain/record/serialization/serializeAttributes.d.ts +2 -2
- package/cjs/domain/record/serialization/serializeAttributes.js +100 -152
- package/cjs/domain/record/serialization/serializeAttributes.js.map +1 -1
- package/cjs/domain/record/serialization/serializeFullSnapshot.d.ts +5 -0
- package/cjs/domain/record/serialization/serializeFullSnapshot.js +14 -0
- package/cjs/domain/record/serialization/serializeFullSnapshot.js.map +1 -0
- package/cjs/domain/record/serialization/serializeMutations.d.ts +5 -0
- package/cjs/domain/record/serialization/serializeMutations.js +152 -0
- package/cjs/domain/record/serialization/serializeMutations.js.map +1 -0
- package/cjs/domain/record/serialization/serializeNode.d.ts +3 -6
- package/cjs/domain/record/serialization/serializeNode.js +116 -144
- package/cjs/domain/record/serialization/serializeNode.js.map +1 -1
- package/cjs/domain/record/shadowRootsController.d.ts +2 -2
- package/cjs/domain/record/shadowRootsController.js +37 -42
- package/cjs/domain/record/shadowRootsController.js.map +1 -1
- package/cjs/domain/record/startFullSnapshots.d.ts +1 -1
- package/cjs/domain/record/startFullSnapshots.js +38 -54
- package/cjs/domain/record/startFullSnapshots.js.map +1 -1
- package/cjs/domain/record/trackers/index.d.ts +2 -1
- package/cjs/domain/record/trackers/index.js +25 -27
- package/cjs/domain/record/trackers/trackCanvasCapture.d.ts +3 -0
- package/cjs/domain/record/trackers/trackCanvasCapture.js +102 -0
- package/cjs/domain/record/trackers/trackCanvasCapture.js.map +1 -0
- package/cjs/domain/record/trackers/trackCanvasContent.d.ts +3 -0
- package/cjs/domain/record/trackers/trackCanvasContent.js +31 -0
- package/cjs/domain/record/trackers/trackCanvasContent.js.map +1 -0
- package/cjs/domain/record/trackers/trackFocus.d.ts +1 -2
- package/cjs/domain/record/trackers/trackFocus.js +15 -13
- package/cjs/domain/record/trackers/trackFocus.js.map +1 -1
- package/cjs/domain/record/trackers/trackInput.d.ts +2 -2
- package/cjs/domain/record/trackers/trackInput.js +129 -102
- package/cjs/domain/record/trackers/trackInput.js.map +1 -1
- package/cjs/domain/record/trackers/trackMediaInteraction.js +22 -26
- package/cjs/domain/record/trackers/trackMediaInteraction.js.map +1 -1
- package/cjs/domain/record/trackers/trackMouseInteraction.js +47 -54
- package/cjs/domain/record/trackers/trackMouseInteraction.js.map +1 -1
- package/cjs/domain/record/trackers/trackMove.js +43 -49
- package/cjs/domain/record/trackers/trackMove.js.map +1 -1
- package/cjs/domain/record/trackers/trackMutation.d.ts +3 -3
- package/cjs/domain/record/trackers/trackMutation.js +42 -267
- package/cjs/domain/record/trackers/trackMutation.js.map +1 -1
- package/cjs/domain/record/trackers/trackScroll.js +36 -44
- package/cjs/domain/record/trackers/trackScroll.js.map +1 -1
- package/cjs/domain/record/trackers/trackStyleSheet.js +75 -84
- package/cjs/domain/record/trackers/trackStyleSheet.js.map +1 -1
- package/cjs/domain/record/trackers/trackViewEnd.js +17 -17
- package/cjs/domain/record/trackers/trackViewEnd.js.map +1 -1
- package/cjs/domain/record/trackers/trackViewportResize.d.ts +2 -3
- package/cjs/domain/record/trackers/trackViewportResize.js +36 -42
- package/cjs/domain/record/trackers/trackViewportResize.js.map +1 -1
- package/cjs/domain/record/viewports.js +32 -50
- package/cjs/domain/record/viewports.js.map +1 -1
- package/cjs/domain/replayStats.d.ts +1 -0
- package/cjs/domain/replayStats.js +36 -44
- package/cjs/domain/replayStats.js.map +1 -1
- package/cjs/domain/scriptLoadingError.js +15 -22
- package/cjs/domain/scriptLoadingError.js.map +1 -1
- package/cjs/domain/segmentCollection/buildReplayPayload.js +22 -23
- package/cjs/domain/segmentCollection/buildReplayPayload.js.map +1 -1
- package/cjs/domain/segmentCollection/buildResourcePayload.d.ts +5 -0
- package/cjs/domain/segmentCollection/buildResourcePayload.js +19 -0
- package/cjs/domain/segmentCollection/buildResourcePayload.js.map +1 -0
- package/cjs/domain/segmentCollection/index.d.ts +3 -0
- package/cjs/domain/segmentCollection/index.js +14 -11
- package/cjs/domain/segmentCollection/replayResourceCollection.d.ts +10 -0
- package/cjs/domain/segmentCollection/replayResourceCollection.js +52 -0
- package/cjs/domain/segmentCollection/replayResourceCollection.js.map +1 -0
- package/cjs/domain/segmentCollection/segment.js +50 -80
- package/cjs/domain/segmentCollection/segment.js.map +1 -1
- package/cjs/domain/segmentCollection/segmentCollection.d.ts +4 -4
- package/cjs/domain/segmentCollection/segmentCollection.js +87 -105
- package/cjs/domain/segmentCollection/segmentCollection.js.map +1 -1
- package/cjs/domain/segmentCollection/startDroppedSegmentRecovery.d.ts +16 -0
- package/cjs/domain/segmentCollection/startDroppedSegmentRecovery.js +29 -0
- package/cjs/domain/segmentCollection/startDroppedSegmentRecovery.js.map +1 -0
- package/cjs/domain/segmentCollection/startSegmentTelemetry.js +40 -42
- package/cjs/domain/segmentCollection/startSegmentTelemetry.js.map +1 -1
- package/cjs/domain/startRecordBridge.js +10 -14
- package/cjs/domain/startRecordBridge.js.map +1 -1
- package/cjs/domain/startRecorderInitTelemetry.js +42 -50
- package/cjs/domain/startRecorderInitTelemetry.js.map +1 -1
- package/cjs/entries/internal.d.ts +11 -2
- package/cjs/entries/internal.js +47 -28
- package/cjs/entries/internalSynthetics.js +26 -24
- package/cjs/entries/internalSynthetics.js.map +1 -1
- package/cjs/entries/main.d.ts +5 -3
- package/cjs/entries/main.js +50 -31
- package/cjs/entries/main.js.map +1 -1
- package/cjs/types/index.d.ts +1 -0
- package/cjs/types/profiling.d.ts +313 -0
- package/cjs/types/sessionReplay.d.ts +381 -3
- package/cjs/types/sessionReplayConstants.d.ts +57 -0
- package/cjs/types/sessionReplayConstants.js +104 -47
- package/cjs/types/sessionReplayConstants.js.map +1 -1
- package/esm/boot/kubesenseRecorder.mjs +75 -0
- package/esm/boot/kubesenseRecorder.mjs.map +1 -0
- package/esm/boot/lazyLoadProfiler.mjs +24 -0
- package/esm/boot/lazyLoadProfiler.mjs.map +1 -0
- package/esm/boot/lazyLoadRecorder.mjs +24 -0
- package/esm/boot/lazyLoadRecorder.mjs.map +1 -0
- package/esm/boot/postStartStrategy.mjs +97 -0
- package/esm/boot/postStartStrategy.mjs.map +1 -0
- package/esm/boot/preStartStrategy.mjs +24 -0
- package/esm/boot/preStartStrategy.mjs.map +1 -0
- package/esm/boot/profilerApi.mjs +47 -0
- package/esm/boot/profilerApi.mjs.map +1 -0
- package/esm/boot/recorderApi.mjs +43 -0
- package/esm/boot/recorderApi.mjs.map +1 -0
- package/esm/domain/deflate/deflateEncoder.mjs +96 -0
- package/esm/domain/deflate/deflateEncoder.mjs.map +1 -0
- package/esm/domain/deflate/deflateWorker.mjs +90 -0
- package/esm/domain/deflate/deflateWorker.mjs.map +1 -0
- package/esm/domain/deflate/index.mjs +3 -0
- package/esm/domain/getSessionReplayLink.mjs +21 -0
- package/esm/domain/getSessionReplayLink.mjs.map +1 -0
- package/esm/domain/profiling/actionHistory.mjs +36 -0
- package/esm/domain/profiling/actionHistory.mjs.map +1 -0
- package/esm/domain/profiling/kubesenseProfiler.mjs +242 -0
- package/esm/domain/profiling/kubesenseProfiler.mjs.map +1 -0
- package/esm/domain/profiling/longTaskHistory.mjs +21 -0
- package/esm/domain/profiling/longTaskHistory.mjs.map +1 -0
- package/esm/domain/profiling/profilerDebugIds.mjs +18 -0
- package/esm/domain/profiling/profilerDebugIds.mjs.map +1 -0
- package/esm/domain/profiling/profilingContext.mjs +23 -0
- package/esm/domain/profiling/profilingContext.mjs.map +1 -0
- package/esm/domain/profiling/profilingSupported.mjs +9 -0
- package/esm/domain/profiling/profilingSupported.mjs.map +1 -0
- package/esm/domain/profiling/quotaCheck.mjs +66 -0
- package/esm/domain/profiling/quotaCheck.mjs.map +1 -0
- package/esm/domain/profiling/transport/buildProfileEvent.mjs +90 -0
- package/esm/domain/profiling/transport/buildProfileEvent.mjs.map +1 -0
- package/esm/domain/profiling/transport/formDataEmitter.mjs +17 -0
- package/esm/domain/profiling/transport/formDataEmitter.mjs.map +1 -0
- package/esm/domain/profiling/transport/profilingBridge.mjs +12 -0
- package/esm/domain/profiling/transport/profilingBridge.mjs.map +1 -0
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.mjs +7 -0
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.mjs.map +1 -0
- package/esm/domain/profiling/utils/getDefaultViewName.mjs +10 -0
- package/esm/domain/profiling/utils/getDefaultViewName.mjs.map +1 -0
- package/esm/domain/profiling/vitalHistory.mjs +55 -0
- package/esm/domain/profiling/vitalHistory.mjs.map +1 -0
- package/esm/domain/record/assembly.mjs +17 -0
- package/esm/domain/record/assembly.mjs.map +1 -0
- package/esm/domain/record/canvas/canvasHash.mjs +33 -0
- package/esm/domain/record/canvas/canvasHash.mjs.map +1 -0
- package/esm/domain/record/canvas/canvasManager.mjs +99 -0
- package/esm/domain/record/canvas/canvasManager.mjs.map +1 -0
- package/esm/domain/record/canvas/canvasSnapshot.mjs +38 -0
- package/esm/domain/record/canvas/canvasSnapshot.mjs.map +1 -0
- package/esm/domain/record/canvas/canvasUtils.mjs +13 -0
- package/esm/domain/record/canvas/canvasUtils.mjs.map +1 -0
- package/esm/domain/record/elementsScrollPositions.mjs +20 -0
- package/esm/domain/record/elementsScrollPositions.mjs.map +1 -0
- package/esm/domain/record/encoding/changeDecoder.mjs +152 -0
- package/esm/domain/record/encoding/changeDecoder.mjs.map +1 -0
- package/esm/domain/record/encoding/changeEncoder.mjs +146 -0
- package/esm/domain/record/encoding/changeEncoder.mjs.map +1 -0
- package/esm/domain/record/encoding/itemIds.mjs +47 -0
- package/esm/domain/record/encoding/itemIds.mjs.map +1 -0
- package/esm/domain/record/encoding/roles.mjs +64 -0
- package/esm/domain/record/encoding/roles.mjs.map +1 -0
- package/esm/domain/record/encoding/stringIds.mjs +47 -0
- package/esm/domain/record/encoding/stringIds.mjs.map +1 -0
- package/esm/domain/record/encoding/stringTable.mjs +38 -0
- package/esm/domain/record/encoding/stringTable.mjs.map +1 -0
- package/esm/domain/record/eventsUtils.mjs +13 -0
- package/esm/domain/record/eventsUtils.mjs.map +1 -0
- package/esm/domain/record/index.mjs +8 -0
- package/esm/domain/record/internalApi.mjs +62 -0
- package/esm/domain/record/internalApi.mjs.map +1 -0
- package/esm/domain/record/mutationBatch.mjs +43 -0
- package/esm/domain/record/mutationBatch.mjs.map +1 -0
- package/esm/domain/record/record.mjs +79 -0
- package/esm/domain/record/record.mjs.map +1 -0
- package/esm/domain/record/recordingScope.mjs +27 -0
- package/esm/domain/record/recordingScope.mjs.map +1 -0
- package/esm/domain/record/serialization/index.mjs +9 -0
- package/esm/domain/record/serialization/insertionCursor.mjs +54 -0
- package/esm/domain/record/serialization/insertionCursor.mjs.map +1 -0
- package/esm/domain/record/serialization/serializationStats.mjs +31 -0
- package/esm/domain/record/serialization/serializationStats.mjs.map +1 -0
- package/esm/domain/record/serialization/serializationTransaction.mjs +92 -0
- package/esm/domain/record/serialization/serializationTransaction.mjs.map +1 -0
- package/esm/domain/record/serialization/serializationUtils.mjs +53 -0
- package/esm/domain/record/serialization/serializationUtils.mjs.map +1 -0
- package/esm/domain/record/serialization/serializeAttribute.mjs +26 -0
- package/esm/domain/record/serialization/serializeAttribute.mjs.map +1 -0
- package/esm/domain/record/serialization/serializeAttributes.mjs +113 -0
- package/esm/domain/record/serialization/serializeAttributes.mjs.map +1 -0
- package/esm/domain/record/serialization/serializeFullSnapshot.mjs +14 -0
- package/esm/domain/record/serialization/serializeFullSnapshot.mjs.map +1 -0
- package/esm/domain/record/serialization/serializeMutations.mjs +152 -0
- package/esm/domain/record/serialization/serializeMutations.mjs.map +1 -0
- package/esm/domain/record/serialization/serializeNode.mjs +126 -0
- package/esm/domain/record/serialization/serializeNode.mjs.map +1 -0
- package/esm/domain/record/shadowRootsController.mjs +40 -0
- package/esm/domain/record/shadowRootsController.mjs.map +1 -0
- package/esm/domain/record/startFullSnapshots.mjs +42 -0
- package/esm/domain/record/startFullSnapshots.mjs.map +1 -0
- package/esm/domain/record/trackers/index.mjs +13 -0
- package/esm/domain/record/trackers/trackCanvasCapture.mjs +102 -0
- package/esm/domain/record/trackers/trackCanvasCapture.mjs.map +1 -0
- package/esm/domain/record/trackers/trackCanvasContent.mjs +31 -0
- package/esm/domain/record/trackers/trackCanvasContent.mjs.map +1 -0
- package/esm/domain/record/trackers/trackFocus.mjs +17 -0
- package/esm/domain/record/trackers/trackFocus.mjs.map +1 -0
- package/esm/domain/record/trackers/trackInput.mjs +131 -0
- package/esm/domain/record/trackers/trackInput.mjs.map +1 -0
- package/esm/domain/record/trackers/trackMediaInteraction.mjs +25 -0
- package/esm/domain/record/trackers/trackMediaInteraction.mjs.map +1 -0
- package/esm/domain/record/trackers/trackMouseInteraction.mjs +52 -0
- package/esm/domain/record/trackers/trackMouseInteraction.mjs.map +1 -0
- package/esm/domain/record/trackers/trackMove.mjs +48 -0
- package/esm/domain/record/trackers/trackMove.mjs.map +1 -0
- package/esm/domain/record/trackers/trackMutation.mjs +45 -0
- package/esm/domain/record/trackers/trackMutation.mjs.map +1 -0
- package/esm/domain/record/trackers/trackScroll.mjs +40 -0
- package/esm/domain/record/trackers/trackScroll.mjs.map +1 -0
- package/esm/domain/record/trackers/trackStyleSheet.mjs +79 -0
- package/esm/domain/record/trackers/trackStyleSheet.mjs.map +1 -0
- package/esm/domain/record/trackers/trackViewEnd.mjs +20 -0
- package/esm/domain/record/trackers/trackViewEnd.mjs.map +1 -0
- package/esm/domain/record/trackers/trackViewportResize.mjs +39 -0
- package/esm/domain/record/trackers/trackViewportResize.mjs.map +1 -0
- package/esm/domain/record/viewports.mjs +41 -0
- package/esm/domain/record/viewports.mjs.map +1 -0
- package/esm/domain/replayStats.mjs +46 -0
- package/esm/domain/replayStats.mjs.map +1 -0
- package/esm/domain/scriptLoadingError.mjs +19 -0
- package/esm/domain/scriptLoadingError.mjs.map +1 -0
- package/esm/domain/segmentCollection/buildReplayPayload.mjs +25 -0
- package/esm/domain/segmentCollection/buildReplayPayload.mjs.map +1 -0
- package/esm/domain/segmentCollection/buildResourcePayload.mjs +19 -0
- package/esm/domain/segmentCollection/buildResourcePayload.mjs.map +1 -0
- package/esm/domain/segmentCollection/index.mjs +5 -0
- package/esm/domain/segmentCollection/replayResourceCollection.mjs +52 -0
- package/esm/domain/segmentCollection/replayResourceCollection.mjs.map +1 -0
- package/esm/domain/segmentCollection/segment.mjs +52 -0
- package/esm/domain/segmentCollection/segment.mjs.map +1 -0
- package/esm/domain/segmentCollection/segmentCollection.mjs +87 -0
- package/esm/domain/segmentCollection/segmentCollection.mjs.map +1 -0
- package/esm/domain/segmentCollection/startDroppedSegmentRecovery.mjs +28 -0
- package/esm/domain/segmentCollection/startDroppedSegmentRecovery.mjs.map +1 -0
- package/esm/domain/segmentCollection/startSegmentTelemetry.mjs +45 -0
- package/esm/domain/segmentCollection/startSegmentTelemetry.mjs.map +1 -0
- package/esm/domain/startRecordBridge.mjs +13 -0
- package/esm/domain/startRecordBridge.mjs.map +1 -0
- package/esm/domain/startRecorderInitTelemetry.mjs +47 -0
- package/esm/domain/startRecorderInitTelemetry.mjs.map +1 -0
- package/esm/entries/internal.mjs +8 -0
- package/esm/entries/internalSynthetics.mjs +22 -0
- package/esm/entries/internalSynthetics.mjs.map +1 -0
- package/esm/entries/main.mjs +35 -0
- package/esm/entries/main.mjs.map +1 -0
- package/esm/types/sessionReplayConstants.mjs +97 -0
- package/esm/types/sessionReplayConstants.mjs.map +1 -0
- package/internal/package.json +1 -1
- package/internal-synthetics/package.json +1 -1
- package/package.json +26 -15
- package/src/boot/kubesenseRecorder.ts +134 -0
- package/src/boot/lazyLoadProfiler.ts +6 -7
- package/src/boot/lazyLoadRecorder.ts +6 -7
- package/src/boot/postStartStrategy.ts +18 -16
- package/src/boot/profilerApi.ts +29 -19
- package/src/boot/recorderApi.ts +6 -21
- package/src/domain/deflate/deflateEncoder.ts +3 -8
- package/src/domain/deflate/deflateWorker.ts +8 -13
- package/src/domain/deflate/index.ts +1 -0
- package/src/domain/getSessionReplayLink.ts +15 -11
- package/src/domain/profiling/actionHistory.ts +66 -0
- package/src/domain/profiling/{profiler.ts → kubesenseProfiler.ts} +166 -79
- package/src/domain/profiling/longTaskHistory.ts +45 -0
- package/src/domain/profiling/profilerDebugIds.ts +17 -0
- package/src/domain/profiling/profilingContext.ts +8 -3
- package/src/domain/profiling/profilingSupported.ts +2 -7
- package/src/domain/profiling/quotaCheck.ts +89 -0
- package/src/domain/profiling/test-utils/mockedTrace.ts +1 -2
- package/src/domain/profiling/transport/buildProfileEvent.ts +143 -0
- package/src/domain/profiling/transport/formDataEmitter.ts +17 -0
- package/src/domain/profiling/transport/profilingBridge.ts +9 -0
- package/src/domain/profiling/{types/rumProfiler.types.ts → types.ts} +14 -26
- package/src/domain/profiling/vitalHistory.ts +106 -0
- package/src/domain/record/assembly.ts +5 -3
- package/src/domain/record/canvas/canvasHash.ts +54 -0
- package/src/domain/record/canvas/canvasManager.ts +175 -0
- package/src/domain/record/canvas/canvasSnapshot.ts +52 -0
- package/src/domain/record/canvas/canvasUtils.ts +11 -0
- package/src/domain/record/encoding/changeDecoder.ts +287 -0
- package/src/domain/record/encoding/changeEncoder.ts +327 -0
- package/src/domain/record/encoding/index.ts +19 -0
- package/src/domain/record/encoding/itemIds.ts +84 -0
- package/src/domain/record/encoding/roles.ts +136 -0
- package/src/domain/record/encoding/stringIds.ts +70 -0
- package/src/domain/record/encoding/stringTable.ts +68 -0
- package/src/domain/record/index.ts +5 -2
- package/src/domain/record/internalApi.ts +21 -18
- package/src/domain/record/mutationBatch.ts +14 -3
- package/src/domain/record/record.ts +35 -16
- package/src/domain/record/record.types.ts +1 -0
- package/src/domain/record/recordingScope.ts +28 -5
- package/src/domain/record/serialization/index.ts +4 -2
- package/src/domain/record/serialization/insertionCursor.ts +131 -0
- package/src/domain/record/serialization/serialization.types.ts +0 -16
- package/src/domain/record/serialization/serializationTransaction.ts +191 -37
- package/src/domain/record/serialization/serializationUtils.ts +1 -15
- package/src/domain/record/serialization/serializeAttributes.ts +36 -32
- package/src/domain/record/serialization/serializeFullSnapshot.ts +26 -0
- package/src/domain/record/serialization/serializeMutations.ts +357 -0
- package/src/domain/record/serialization/serializeNode.ts +200 -164
- package/src/domain/record/shadowRootsController.ts +4 -3
- package/src/domain/record/startFullSnapshots.ts +28 -41
- package/src/domain/record/trackers/index.ts +2 -1
- package/src/domain/record/trackers/trackCanvasCapture.ts +137 -0
- package/src/domain/record/trackers/trackCanvasContent.ts +46 -0
- package/src/domain/record/trackers/trackFocus.ts +4 -4
- package/src/domain/record/trackers/trackInput.ts +146 -41
- package/src/domain/record/trackers/trackMediaInteraction.ts +0 -1
- package/src/domain/record/trackers/trackMouseInteraction.ts +1 -2
- package/src/domain/record/trackers/trackMove.ts +0 -1
- package/src/domain/record/trackers/trackMutation.ts +17 -355
- package/src/domain/record/trackers/trackScroll.ts +1 -1
- package/src/domain/record/trackers/trackStyleSheet.ts +1 -1
- package/src/domain/record/trackers/trackViewEnd.ts +1 -1
- package/src/domain/record/trackers/trackViewportResize.ts +7 -16
- package/src/domain/record/trackers/tracker.types.ts +1 -1
- package/src/domain/replayStats.ts +5 -0
- package/src/domain/scriptLoadingError.ts +2 -1
- package/src/domain/segmentCollection/buildResourcePayload.ts +20 -0
- package/src/domain/segmentCollection/index.ts +3 -0
- package/src/domain/segmentCollection/replayResourceCollection.ts +79 -0
- package/src/domain/segmentCollection/segment.ts +2 -1
- package/src/domain/segmentCollection/segmentCollection.ts +14 -13
- package/src/domain/segmentCollection/startDroppedSegmentRecovery.ts +37 -0
- package/src/domain/segmentCollection/startSegmentTelemetry.ts +16 -2
- package/src/domain/startRecorderInitTelemetry.ts +5 -3
- package/src/entries/internal.ts +13 -2
- package/src/entries/internalSynthetics.ts +3 -4
- package/src/entries/main.ts +23 -14
- package/src/types/index.ts +1 -0
- package/src/types/profiling.ts +315 -0
- package/src/types/sessionReplay.ts +395 -3
- package/src/types/sessionReplayConstants.ts +109 -0
- package/bundle/chunks/profiler-6f621c66a29d9f39a9bd-kubesense-rum.js +0 -1
- package/bundle/chunks/recorder-c73b8d42b98d4a01f120-kubesense-rum.js +0 -1
- package/cjs/boot/isBrowserSupported.d.ts +0 -4
- package/cjs/boot/isBrowserSupported.js +0 -17
- package/cjs/boot/isBrowserSupported.js.map +0 -1
- package/cjs/boot/startRecording.d.ts +0 -6
- package/cjs/boot/startRecording.js +0 -45
- package/cjs/boot/startRecording.js.map +0 -1
- package/cjs/domain/deflate/index.js.map +0 -1
- package/cjs/domain/profiling/profiler.d.ts +0 -7
- package/cjs/domain/profiling/profiler.js +0 -244
- package/cjs/domain/profiling/profiler.js.map +0 -1
- package/cjs/domain/profiling/test-utils/mockedTrace.js +0 -57
- package/cjs/domain/profiling/test-utils/mockedTrace.js.map +0 -1
- package/cjs/domain/profiling/transport/assembly.d.ts +0 -21
- package/cjs/domain/profiling/transport/assembly.js +0 -45
- package/cjs/domain/profiling/transport/assembly.js.map +0 -1
- package/cjs/domain/profiling/transport/buildProfileEventAttributes.d.ts +0 -25
- package/cjs/domain/profiling/transport/buildProfileEventAttributes.js +0 -50
- package/cjs/domain/profiling/transport/buildProfileEventAttributes.js.map +0 -1
- package/cjs/domain/profiling/types/index.d.ts +0 -2
- package/cjs/domain/profiling/types/index.js +0 -3
- package/cjs/domain/profiling/types/index.js.map +0 -1
- package/cjs/domain/profiling/types/profilerApi.types.d.ts +0 -58
- package/cjs/domain/profiling/types/profilerApi.types.js +0 -5
- package/cjs/domain/profiling/types/profilerApi.types.js.map +0 -1
- package/cjs/domain/profiling/types/rumProfiler.types.js +0 -3
- package/cjs/domain/profiling/types/rumProfiler.types.js.map +0 -1
- package/cjs/domain/profiling/utils/getNumberOfSamples.d.ts +0 -7
- package/cjs/domain/profiling/utils/getNumberOfSamples.js +0 -18
- package/cjs/domain/profiling/utils/getNumberOfSamples.js.map +0 -1
- package/cjs/domain/record/eventIds.d.ts +0 -4
- package/cjs/domain/record/eventIds.js +0 -16
- package/cjs/domain/record/eventIds.js.map +0 -1
- package/cjs/domain/record/index.js.map +0 -1
- package/cjs/domain/record/nodeIds.d.ts +0 -15
- package/cjs/domain/record/nodeIds.js +0 -32
- package/cjs/domain/record/nodeIds.js.map +0 -1
- package/cjs/domain/record/record.types.js +0 -3
- package/cjs/domain/record/record.types.js.map +0 -1
- package/cjs/domain/record/serialization/index.js.map +0 -1
- package/cjs/domain/record/serialization/serialization.types.js +0 -3
- package/cjs/domain/record/serialization/serialization.types.js.map +0 -1
- package/cjs/domain/record/serialization/serializeDocument.d.ts +0 -3
- package/cjs/domain/record/serialization/serializeDocument.js +0 -11
- package/cjs/domain/record/serialization/serializeDocument.js.map +0 -1
- package/cjs/domain/record/serialization/serializeStyleSheets.d.ts +0 -2
- package/cjs/domain/record/serialization/serializeStyleSheets.js +0 -19
- package/cjs/domain/record/serialization/serializeStyleSheets.js.map +0 -1
- package/cjs/domain/record/trackers/index.js.map +0 -1
- package/cjs/domain/record/trackers/trackFrustration.d.ts +0 -7
- package/cjs/domain/record/trackers/trackFrustration.js +0 -31
- package/cjs/domain/record/trackers/trackFrustration.js.map +0 -1
- package/cjs/domain/record/trackers/tracker.types.js +0 -3
- package/cjs/domain/record/trackers/tracker.types.js.map +0 -1
- package/cjs/domain/segmentCollection/index.js.map +0 -1
- package/cjs/entries/internal.js.map +0 -1
- package/cjs/types/index.js +0 -18
- package/cjs/types/index.js.map +0 -1
- package/cjs/types/sessionReplay.js +0 -7
- package/cjs/types/sessionReplay.js.map +0 -1
- package/esm/boot/isBrowserSupported.d.ts +0 -4
- package/esm/boot/isBrowserSupported.js +0 -14
- package/esm/boot/isBrowserSupported.js.map +0 -1
- package/esm/boot/lazyLoadProfiler.d.ts +0 -4
- package/esm/boot/lazyLoadProfiler.js +0 -18
- package/esm/boot/lazyLoadProfiler.js.map +0 -1
- package/esm/boot/lazyLoadRecorder.d.ts +0 -4
- package/esm/boot/lazyLoadRecorder.js +0 -18
- package/esm/boot/lazyLoadRecorder.js.map +0 -1
- package/esm/boot/postStartStrategy.d.ts +0 -33
- package/esm/boot/postStartStrategy.js +0 -115
- package/esm/boot/postStartStrategy.js.map +0 -1
- package/esm/boot/preStartStrategy.d.ts +0 -6
- package/esm/boot/preStartStrategy.js +0 -21
- package/esm/boot/preStartStrategy.js.map +0 -1
- package/esm/boot/profilerApi.d.ts +0 -2
- package/esm/boot/profilerApi.js +0 -50
- package/esm/boot/profilerApi.js.map +0 -1
- package/esm/boot/recorderApi.d.ts +0 -4
- package/esm/boot/recorderApi.js +0 -70
- package/esm/boot/recorderApi.js.map +0 -1
- package/esm/boot/startRecording.d.ts +0 -6
- package/esm/boot/startRecording.js +0 -42
- package/esm/boot/startRecording.js.map +0 -1
- package/esm/domain/deflate/deflateEncoder.d.ts +0 -3
- package/esm/domain/deflate/deflateEncoder.js +0 -107
- package/esm/domain/deflate/deflateEncoder.js.map +0 -1
- package/esm/domain/deflate/deflateWorker.d.ts +0 -30
- package/esm/domain/deflate/deflateWorker.js +0 -97
- package/esm/domain/deflate/deflateWorker.js.map +0 -1
- package/esm/domain/deflate/index.d.ts +0 -3
- package/esm/domain/deflate/index.js +0 -3
- package/esm/domain/deflate/index.js.map +0 -1
- package/esm/domain/getSessionReplayLink.d.ts +0 -2
- package/esm/domain/getSessionReplayLink.js +0 -32
- package/esm/domain/getSessionReplayLink.js.map +0 -1
- package/esm/domain/profiling/profiler.d.ts +0 -7
- package/esm/domain/profiling/profiler.js +0 -240
- package/esm/domain/profiling/profiler.js.map +0 -1
- package/esm/domain/profiling/profilingContext.d.ts +0 -6
- package/esm/domain/profiling/profilingContext.js +0 -25
- package/esm/domain/profiling/profilingContext.js.map +0 -1
- package/esm/domain/profiling/profilingSupported.d.ts +0 -1
- package/esm/domain/profiling/profilingSupported.js +0 -8
- package/esm/domain/profiling/profilingSupported.js.map +0 -1
- package/esm/domain/profiling/test-utils/mockedTrace.d.ts +0 -3
- package/esm/domain/profiling/test-utils/mockedTrace.js +0 -54
- package/esm/domain/profiling/test-utils/mockedTrace.js.map +0 -1
- package/esm/domain/profiling/transport/assembly.d.ts +0 -21
- package/esm/domain/profiling/transport/assembly.js +0 -42
- package/esm/domain/profiling/transport/assembly.js.map +0 -1
- package/esm/domain/profiling/transport/buildProfileEventAttributes.d.ts +0 -25
- package/esm/domain/profiling/transport/buildProfileEventAttributes.js +0 -47
- package/esm/domain/profiling/transport/buildProfileEventAttributes.js.map +0 -1
- package/esm/domain/profiling/types/index.d.ts +0 -2
- package/esm/domain/profiling/types/index.js +0 -2
- package/esm/domain/profiling/types/index.js.map +0 -1
- package/esm/domain/profiling/types/profilerApi.types.d.ts +0 -58
- package/esm/domain/profiling/types/profilerApi.types.js +0 -4
- package/esm/domain/profiling/types/profilerApi.types.js.map +0 -1
- package/esm/domain/profiling/types/rumProfiler.types.d.ts +0 -72
- package/esm/domain/profiling/types/rumProfiler.types.js +0 -2
- package/esm/domain/profiling/types/rumProfiler.types.js.map +0 -1
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.d.ts +0 -1
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.js +0 -3
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.js.map +0 -1
- package/esm/domain/profiling/utils/getDefaultViewName.d.ts +0 -1
- package/esm/domain/profiling/utils/getDefaultViewName.js +0 -11
- package/esm/domain/profiling/utils/getDefaultViewName.js.map +0 -1
- package/esm/domain/profiling/utils/getNumberOfSamples.d.ts +0 -7
- package/esm/domain/profiling/utils/getNumberOfSamples.js +0 -15
- package/esm/domain/profiling/utils/getNumberOfSamples.js.map +0 -1
- package/esm/domain/record/assembly.d.ts +0 -2
- package/esm/domain/record/assembly.js +0 -13
- package/esm/domain/record/assembly.js.map +0 -1
- package/esm/domain/record/elementsScrollPositions.d.ts +0 -10
- package/esm/domain/record/elementsScrollPositions.js +0 -20
- package/esm/domain/record/elementsScrollPositions.js.map +0 -1
- package/esm/domain/record/eventIds.d.ts +0 -4
- package/esm/domain/record/eventIds.js +0 -13
- package/esm/domain/record/eventIds.js.map +0 -1
- package/esm/domain/record/eventsUtils.d.ts +0 -2
- package/esm/domain/record/eventsUtils.js +0 -11
- package/esm/domain/record/eventsUtils.js.map +0 -1
- package/esm/domain/record/index.d.ts +0 -7
- package/esm/domain/record/index.js +0 -6
- package/esm/domain/record/index.js.map +0 -1
- package/esm/domain/record/internalApi.d.ts +0 -22
- package/esm/domain/record/internalApi.js +0 -53
- package/esm/domain/record/internalApi.js.map +0 -1
- package/esm/domain/record/mutationBatch.d.ts +0 -12
- package/esm/domain/record/mutationBatch.js +0 -40
- package/esm/domain/record/mutationBatch.js.map +0 -1
- package/esm/domain/record/nodeIds.d.ts +0 -15
- package/esm/domain/record/nodeIds.js +0 -29
- package/esm/domain/record/nodeIds.js.map +0 -1
- package/esm/domain/record/record.d.ts +0 -16
- package/esm/domain/record/record.js +0 -54
- package/esm/domain/record/record.js.map +0 -1
- package/esm/domain/record/record.types.d.ts +0 -4
- package/esm/domain/record/record.types.js +0 -2
- package/esm/domain/record/record.types.js.map +0 -1
- package/esm/domain/record/recordingScope.d.ts +0 -19
- package/esm/domain/record/recordingScope.js +0 -10
- package/esm/domain/record/recordingScope.js.map +0 -1
- package/esm/domain/record/serialization/index.d.ts +0 -8
- package/esm/domain/record/serialization/index.js +0 -7
- package/esm/domain/record/serialization/index.js.map +0 -1
- package/esm/domain/record/serialization/serialization.types.d.ts +0 -28
- package/esm/domain/record/serialization/serialization.types.js +0 -2
- package/esm/domain/record/serialization/serialization.types.js.map +0 -1
- package/esm/domain/record/serialization/serializationStats.d.ts +0 -12
- package/esm/domain/record/serialization/serializationStats.js +0 -27
- package/esm/domain/record/serialization/serializationStats.js.map +0 -1
- package/esm/domain/record/serialization/serializationTransaction.d.ts +0 -45
- package/esm/domain/record/serialization/serializationTransaction.js +0 -35
- package/esm/domain/record/serialization/serializationTransaction.js.map +0 -1
- package/esm/domain/record/serialization/serializationUtils.d.ts +0 -18
- package/esm/domain/record/serialization/serializationUtils.js +0 -80
- package/esm/domain/record/serialization/serializationUtils.js.map +0 -1
- package/esm/domain/record/serialization/serializeAttribute.d.ts +0 -4
- package/esm/domain/record/serialization/serializeAttribute.js +0 -38
- package/esm/domain/record/serialization/serializeAttribute.js.map +0 -1
- package/esm/domain/record/serialization/serializeAttributes.d.ts +0 -7
- package/esm/domain/record/serialization/serializeAttributes.js +0 -161
- package/esm/domain/record/serialization/serializeAttributes.js.map +0 -1
- package/esm/domain/record/serialization/serializeDocument.d.ts +0 -3
- package/esm/domain/record/serialization/serializeDocument.js +0 -8
- package/esm/domain/record/serialization/serializeDocument.js.map +0 -1
- package/esm/domain/record/serialization/serializeNode.d.ts +0 -7
- package/esm/domain/record/serialization/serializeNode.js +0 -149
- package/esm/domain/record/serialization/serializeNode.js.map +0 -1
- package/esm/domain/record/serialization/serializeStyleSheets.d.ts +0 -2
- package/esm/domain/record/serialization/serializeStyleSheets.js +0 -16
- package/esm/domain/record/serialization/serializeStyleSheets.js.map +0 -1
- package/esm/domain/record/shadowRootsController.d.ts +0 -11
- package/esm/domain/record/shadowRootsController.js +0 -41
- package/esm/domain/record/shadowRootsController.js.map +0 -1
- package/esm/domain/record/startFullSnapshots.d.ts +0 -9
- package/esm/domain/record/startFullSnapshots.js +0 -55
- package/esm/domain/record/startFullSnapshots.js.map +0 -1
- package/esm/domain/record/trackers/index.d.ts +0 -12
- package/esm/domain/record/trackers/index.js +0 -12
- package/esm/domain/record/trackers/index.js.map +0 -1
- package/esm/domain/record/trackers/trackFocus.d.ts +0 -5
- package/esm/domain/record/trackers/trackFocus.js +0 -12
- package/esm/domain/record/trackers/trackFocus.js.map +0 -1
- package/esm/domain/record/trackers/trackFrustration.d.ts +0 -7
- package/esm/domain/record/trackers/trackFrustration.js +0 -28
- package/esm/domain/record/trackers/trackFrustration.js.map +0 -1
- package/esm/domain/record/trackers/trackInput.d.ts +0 -4
- package/esm/domain/record/trackers/trackInput.js +0 -101
- package/esm/domain/record/trackers/trackInput.js.map +0 -1
- package/esm/domain/record/trackers/trackMediaInteraction.d.ts +0 -5
- package/esm/domain/record/trackers/trackMediaInteraction.js +0 -26
- package/esm/domain/record/trackers/trackMediaInteraction.js.map +0 -1
- package/esm/domain/record/trackers/trackMouseInteraction.d.ts +0 -5
- package/esm/domain/record/trackers/trackMouseInteraction.js +0 -56
- package/esm/domain/record/trackers/trackMouseInteraction.js.map +0 -1
- package/esm/domain/record/trackers/trackMove.d.ts +0 -9
- package/esm/domain/record/trackers/trackMove.js +0 -51
- package/esm/domain/record/trackers/trackMove.js.map +0 -1
- package/esm/domain/record/trackers/trackMutation.d.ts +0 -11
- package/esm/domain/record/trackers/trackMutation.js +0 -266
- package/esm/domain/record/trackers/trackMutation.js.map +0 -1
- package/esm/domain/record/trackers/trackScroll.d.ts +0 -5
- package/esm/domain/record/trackers/trackScroll.js +0 -45
- package/esm/domain/record/trackers/trackScroll.js.map +0 -1
- package/esm/domain/record/trackers/trackStyleSheet.d.ts +0 -6
- package/esm/domain/record/trackers/trackStyleSheet.js +0 -85
- package/esm/domain/record/trackers/trackStyleSheet.js.map +0 -1
- package/esm/domain/record/trackers/trackViewEnd.d.ts +0 -5
- package/esm/domain/record/trackers/trackViewEnd.js +0 -17
- package/esm/domain/record/trackers/trackViewEnd.js.map +0 -1
- package/esm/domain/record/trackers/trackViewportResize.d.ts +0 -6
- package/esm/domain/record/trackers/trackViewportResize.js +0 -42
- package/esm/domain/record/trackers/trackViewportResize.js.map +0 -1
- package/esm/domain/record/trackers/tracker.types.d.ts +0 -3
- package/esm/domain/record/trackers/tracker.types.js +0 -2
- package/esm/domain/record/trackers/tracker.types.js.map +0 -1
- package/esm/domain/record/viewports.d.ts +0 -20
- package/esm/domain/record/viewports.js +0 -55
- package/esm/domain/record/viewports.js.map +0 -1
- package/esm/domain/replayStats.d.ts +0 -8
- package/esm/domain/replayStats.js +0 -51
- package/esm/domain/replayStats.js.map +0 -1
- package/esm/domain/scriptLoadingError.d.ts +0 -6
- package/esm/domain/scriptLoadingError.js +0 -23
- package/esm/domain/scriptLoadingError.js.map +0 -1
- package/esm/domain/segmentCollection/buildReplayPayload.d.ts +0 -15
- package/esm/domain/segmentCollection/buildReplayPayload.js +0 -23
- package/esm/domain/segmentCollection/buildReplayPayload.js.map +0 -1
- package/esm/domain/segmentCollection/index.d.ts +0 -4
- package/esm/domain/segmentCollection/index.js +0 -4
- package/esm/domain/segmentCollection/index.js.map +0 -1
- package/esm/domain/segmentCollection/segment.d.ts +0 -16
- package/esm/domain/segmentCollection/segment.js +0 -46
- package/esm/domain/segmentCollection/segment.js.map +0 -1
- package/esm/domain/segmentCollection/segmentCollection.d.ts +0 -31
- package/esm/domain/segmentCollection/segmentCollection.js +0 -106
- package/esm/domain/segmentCollection/segmentCollection.js.map +0 -1
- package/esm/domain/segmentCollection/startSegmentTelemetry.d.ts +0 -6
- package/esm/domain/segmentCollection/startSegmentTelemetry.js +0 -44
- package/esm/domain/segmentCollection/startSegmentTelemetry.js.map +0 -1
- package/esm/domain/startRecordBridge.d.ts +0 -5
- package/esm/domain/startRecordBridge.js +0 -14
- package/esm/domain/startRecordBridge.js.map +0 -1
- package/esm/domain/startRecorderInitTelemetry.d.ts +0 -15
- package/esm/domain/startRecorderInitTelemetry.js +0 -52
- package/esm/domain/startRecorderInitTelemetry.js.map +0 -1
- package/esm/entries/internal.d.ts +0 -11
- package/esm/entries/internal.js +0 -4
- package/esm/entries/internal.js.map +0 -1
- package/esm/entries/internalSynthetics.d.ts +0 -2
- package/esm/entries/internalSynthetics.js +0 -23
- package/esm/entries/internalSynthetics.js.map +0 -1
- package/esm/entries/main.d.ts +0 -23
- package/esm/entries/main.js +0 -31
- package/esm/entries/main.js.map +0 -1
- package/esm/types/index.d.ts +0 -2
- package/esm/types/index.js +0 -2
- package/esm/types/index.js.map +0 -1
- package/esm/types/sessionReplay.d.ts +0 -703
- package/esm/types/sessionReplay.js +0 -6
- package/esm/types/sessionReplay.js.map +0 -1
- package/esm/types/sessionReplayConstants.d.ts +0 -49
- package/esm/types/sessionReplayConstants.js +0 -46
- package/esm/types/sessionReplayConstants.js.map +0 -1
- package/src/boot/isBrowserSupported.ts +0 -14
- package/src/boot/startRecording.ts +0 -70
- package/src/domain/profiling/transport/assembly.ts +0 -78
- package/src/domain/profiling/transport/buildProfileEventAttributes.ts +0 -66
- package/src/domain/profiling/types/index.ts +0 -2
- package/src/domain/profiling/types/profilerApi.types.ts +0 -87
- package/src/domain/profiling/utils/getNumberOfSamples.ts +0 -16
- package/src/domain/record/eventIds.ts +0 -17
- package/src/domain/record/nodeIds.ts +0 -46
- package/src/domain/record/serialization/serializeDocument.ts +0 -13
- package/src/domain/record/serialization/serializeStyleSheets.ts +0 -18
- package/src/domain/record/trackers/trackFrustration.ts +0 -41
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
const require_segmentCollection = require("./segmentCollection.js");
|
|
2
|
+
const require_startSegmentTelemetry = require("./startSegmentTelemetry.js");
|
|
3
|
+
const require_startDroppedSegmentRecovery = require("./startDroppedSegmentRecovery.js");
|
|
4
|
+
const require_replayResourceCollection = require("./replayResourceCollection.js");
|
|
5
|
+
Object.defineProperty(exports, "SEGMENT_BYTES_LIMIT", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return require_segmentCollection.SEGMENT_BYTES_LIMIT;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
exports.startDroppedSegmentRecovery = require_startDroppedSegmentRecovery.startDroppedSegmentRecovery;
|
|
12
|
+
exports.startReplayResourceCollection = require_replayResourceCollection.startReplayResourceCollection;
|
|
13
|
+
exports.startSegmentCollection = require_segmentCollection.startSegmentCollection;
|
|
14
|
+
exports.startSegmentTelemetry = require_startSegmentTelemetry.startSegmentTelemetry;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HttpRequest } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
import type { LifeCycle } from '@kubesense/kubesense-browser-rum-core';
|
|
3
|
+
import type { EmitResourceCallback } from '../record';
|
|
4
|
+
import type { ResourcePayload } from './buildResourcePayload';
|
|
5
|
+
interface ReplayResourceCollection {
|
|
6
|
+
emitResource: EmitResourceCallback;
|
|
7
|
+
stop(this: void): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function startReplayResourceCollection(applicationId: string, lifeCycle: LifeCycle, httpRequest: HttpRequest<ResourcePayload>): ReplayResourceCollection;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const require_buildResourcePayload = require("./buildResourcePayload.js");
|
|
2
|
+
let _kubesense_kubesense_browser_rum_core = require("@kubesense/kubesense-browser-rum-core");
|
|
3
|
+
let _kubesense_kubesense_browser_core = require("@kubesense/kubesense-browser-core");
|
|
4
|
+
//#region src/domain/segmentCollection/replayResourceCollection.ts
|
|
5
|
+
function startReplayResourceCollection(applicationId, lifeCycle, httpRequest) {
|
|
6
|
+
const uploadedHashes = /* @__PURE__ */ new Set();
|
|
7
|
+
const pendingResourcesByHash = /* @__PURE__ */ new Map();
|
|
8
|
+
const { unsubscribe: unsubscribeRequest } = httpRequest.observable.subscribe((event) => {
|
|
9
|
+
if (event.type === "success") {
|
|
10
|
+
const resource = pendingResourcesByHash.get(event.payload.hash);
|
|
11
|
+
pendingResourcesByHash.delete(event.payload.hash);
|
|
12
|
+
if (resource) resource.onDiscards.clear();
|
|
13
|
+
} else if (event.type === "queue-full" || event.type === "dropped") {
|
|
14
|
+
const resource = pendingResourcesByHash.get(event.payload.hash);
|
|
15
|
+
pendingResourcesByHash.delete(event.payload.hash);
|
|
16
|
+
if (resource) {
|
|
17
|
+
uploadedHashes.delete(event.payload.hash);
|
|
18
|
+
resource.onDiscards.forEach((onDiscard) => onDiscard());
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const { unsubscribe: unsubscribePageMayExit } = lifeCycle.subscribe(_kubesense_kubesense_browser_rum_core.LifeCycleEventType.PREPARE_URGENT_FLUSH, (reason) => {
|
|
23
|
+
if ((0, _kubesense_kubesense_browser_core.isPageExitReason)(reason) && reason !== _kubesense_kubesense_browser_core.PageExitReason.HIDDEN) pendingResourcesByHash.forEach(({ payload }) => httpRequest.sendOnExit(payload));
|
|
24
|
+
});
|
|
25
|
+
return {
|
|
26
|
+
emitResource: (hash, content, onDiscard) => {
|
|
27
|
+
if (uploadedHashes.has(hash)) {
|
|
28
|
+
if (onDiscard) pendingResourcesByHash.get(hash)?.onDiscards.add(onDiscard);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
uploadedHashes.add(hash);
|
|
32
|
+
const payload = require_buildResourcePayload.buildResourcePayload(hash, content, applicationId);
|
|
33
|
+
const resource = {
|
|
34
|
+
payload,
|
|
35
|
+
onDiscards: /* @__PURE__ */ new Set()
|
|
36
|
+
};
|
|
37
|
+
if (onDiscard) resource.onDiscards.add(onDiscard);
|
|
38
|
+
pendingResourcesByHash.set(hash, resource);
|
|
39
|
+
httpRequest.send(payload);
|
|
40
|
+
},
|
|
41
|
+
stop: () => {
|
|
42
|
+
unsubscribeRequest();
|
|
43
|
+
unsubscribePageMayExit();
|
|
44
|
+
pendingResourcesByHash.clear();
|
|
45
|
+
uploadedHashes.clear();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
exports.startReplayResourceCollection = startReplayResourceCollection;
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=replayResourceCollection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replayResourceCollection.js","names":["LifeCycleEventType","isPageExitReason","PageExitReason","buildResourcePayload"],"sources":["../../../src/domain/segmentCollection/replayResourceCollection.ts"],"sourcesContent":["import { isPageExitReason, PageExitReason } from '@kubesense/kubesense-browser-core'\nimport type { HttpRequest } from '@kubesense/kubesense-browser-core'\nimport type { LifeCycle } from '@kubesense/kubesense-browser-rum-core'\nimport { LifeCycleEventType } from '@kubesense/kubesense-browser-rum-core'\nimport type { EmitResourceCallback } from '../record'\nimport { buildResourcePayload } from './buildResourcePayload'\nimport type { ResourcePayload } from './buildResourcePayload'\n\ninterface ReplayResourceCollection {\n emitResource: EmitResourceCallback\n stop(this: void): void\n}\n\ninterface PendingResource {\n payload: ResourcePayload\n onDiscards: Set<() => void>\n}\n\nexport function startReplayResourceCollection(\n applicationId: string,\n lifeCycle: LifeCycle,\n httpRequest: HttpRequest<ResourcePayload>\n): ReplayResourceCollection {\n const uploadedHashes = new Set<string>()\n const pendingResourcesByHash = new Map<string, PendingResource>()\n\n const { unsubscribe: unsubscribeRequest } = httpRequest.observable.subscribe((event) => {\n if (event.type === 'success') {\n const resource = pendingResourcesByHash.get(event.payload.hash)\n pendingResourcesByHash.delete(event.payload.hash)\n if (resource) {\n resource.onDiscards.clear()\n }\n } else if (event.type === 'queue-full' || event.type === 'dropped') {\n // Discarded — the queue was full, or the upload failed for good (see the retries in\n // kubesenseRecorder). Forgetting the hash lets the canvas be captured and uploaded again.\n const resource = pendingResourcesByHash.get(event.payload.hash)\n pendingResourcesByHash.delete(event.payload.hash)\n if (resource) {\n uploadedHashes.delete(event.payload.hash)\n resource.onDiscards.forEach((onDiscard) => onDiscard())\n }\n }\n })\n\n const { unsubscribe: unsubscribePageMayExit } = lifeCycle.subscribe(\n LifeCycleEventType.PREPARE_URGENT_FLUSH,\n (reason) => {\n if (isPageExitReason(reason) && reason !== PageExitReason.HIDDEN) {\n pendingResourcesByHash.forEach(({ payload }) => httpRequest.sendOnExit(payload))\n }\n }\n )\n\n return {\n emitResource: (hash, content, onDiscard) => {\n if (uploadedHashes.has(hash)) {\n if (onDiscard) {\n pendingResourcesByHash.get(hash)?.onDiscards.add(onDiscard)\n }\n return\n }\n uploadedHashes.add(hash)\n const payload = buildResourcePayload(hash, content, applicationId)\n const resource = { payload, onDiscards: new Set<() => void>() }\n if (onDiscard) {\n resource.onDiscards.add(onDiscard)\n }\n pendingResourcesByHash.set(hash, resource)\n httpRequest.send(payload)\n },\n stop: () => {\n unsubscribeRequest()\n unsubscribePageMayExit()\n pendingResourcesByHash.clear()\n uploadedHashes.clear()\n },\n }\n}\n"],"mappings":";;;;AAkBA,SAAgB,8BACd,eACA,WACA,aAC0B;CAC1B,MAAM,iCAAiB,IAAI,IAAY;CACvC,MAAM,yCAAyB,IAAI,IAA6B;CAEhE,MAAM,EAAE,aAAa,uBAAuB,YAAY,WAAW,WAAW,UAAU;EACtF,IAAI,MAAM,SAAS,WAAW;GAC5B,MAAM,WAAW,uBAAuB,IAAI,MAAM,QAAQ,IAAI;GAC9D,uBAAuB,OAAO,MAAM,QAAQ,IAAI;GAChD,IAAI,UACF,SAAS,WAAW,MAAM;EAE9B,OAAO,IAAI,MAAM,SAAS,gBAAgB,MAAM,SAAS,WAAW;GAGlE,MAAM,WAAW,uBAAuB,IAAI,MAAM,QAAQ,IAAI;GAC9D,uBAAuB,OAAO,MAAM,QAAQ,IAAI;GAChD,IAAI,UAAU;IACZ,eAAe,OAAO,MAAM,QAAQ,IAAI;IACxC,SAAS,WAAW,SAAS,cAAc,UAAU,CAAC;GACxD;EACF;CACF,CAAC;CAED,MAAM,EAAE,aAAa,2BAA2B,UAAU,UACxDA,sCAAAA,mBAAmB,uBAClB,WAAW;EACV,KAAA,GAAIC,kCAAAA,iBAAAA,CAAiB,MAAM,KAAK,WAAWC,kCAAAA,eAAe,QACxD,uBAAuB,SAAS,EAAE,cAAc,YAAY,WAAW,OAAO,CAAC;CAEnF,CACF;CAEA,OAAO;EACL,eAAe,MAAM,SAAS,cAAc;GAC1C,IAAI,eAAe,IAAI,IAAI,GAAG;IAC5B,IAAI,WACF,uBAAuB,IAAI,IAAI,CAAC,EAAE,WAAW,IAAI,SAAS;IAE5D;GACF;GACA,eAAe,IAAI,IAAI;GACvB,MAAM,UAAUC,6BAAAA,qBAAqB,MAAM,SAAS,aAAa;GACjE,MAAM,WAAW;IAAE;IAAS,4BAAY,IAAI,IAAgB;GAAE;GAC9D,IAAI,WACF,SAAS,WAAW,IAAI,SAAS;GAEnC,uBAAuB,IAAI,MAAM,QAAQ;GACzC,YAAY,KAAK,OAAO;EAC1B;EACA,YAAY;GACV,mBAAmB;GACnB,uBAAuB;GACvB,uBAAuB,MAAM;GAC7B,eAAe,MAAM;EACvB;CACF;AACF"}
|
|
@@ -1,82 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
records_count: 0,
|
|
49
|
-
has_full_snapshot: false,
|
|
50
|
-
index_in_view: indexInView,
|
|
51
|
-
source: 'browser',
|
|
52
|
-
...context,
|
|
53
|
-
};
|
|
54
|
-
const serializationStats = (0, record_1.createSerializationStats)();
|
|
55
|
-
replayStats.addSegment(viewId);
|
|
56
|
-
function addRecord(record, callback) {
|
|
57
|
-
metadata.start = Math.min(metadata.start, record.timestamp);
|
|
58
|
-
metadata.end = Math.max(metadata.end, record.timestamp);
|
|
59
|
-
metadata.records_count += 1;
|
|
60
|
-
metadata.has_full_snapshot || (metadata.has_full_snapshot = record.type === types_1.RecordType.FullSnapshot);
|
|
61
|
-
const prefix = encoder.isEmpty ? '{"records":[' : ',';
|
|
62
|
-
encoder.write(prefix + JSON.stringify(record), (additionalEncodedBytesCount) => {
|
|
63
|
-
encodedBytesCount += additionalEncodedBytesCount;
|
|
64
|
-
callback(encodedBytesCount);
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
function addStats(stats) {
|
|
68
|
-
(0, record_1.aggregateSerializationStats)(serializationStats, stats);
|
|
69
|
-
}
|
|
70
|
-
function flush(callback) {
|
|
71
|
-
if (encoder.isEmpty) {
|
|
72
|
-
throw new Error('Empty segment flushed');
|
|
73
|
-
}
|
|
74
|
-
encoder.write(`],${JSON.stringify(metadata).slice(1)}\n`);
|
|
75
|
-
encoder.finish((encoderResult) => {
|
|
76
|
-
replayStats.addWroteData(metadata.view.id, encoderResult.rawBytesCount);
|
|
77
|
-
callback(metadata, serializationStats, encoderResult);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
return { addRecord, addStats, flush };
|
|
1
|
+
const require_sessionReplayConstants = require("../../types/sessionReplayConstants.js");
|
|
2
|
+
const require_serializationStats = require("../record/serialization/serializationStats.js");
|
|
3
|
+
const require_replayStats = require("../replayStats.js");
|
|
4
|
+
require("../record/index.js");
|
|
5
|
+
//#region src/domain/segmentCollection/segment.ts
|
|
6
|
+
function createSegment({ context, creationReason, encoder }) {
|
|
7
|
+
let encodedBytesCount = 0;
|
|
8
|
+
const viewId = context.view.id;
|
|
9
|
+
const metadata = {
|
|
10
|
+
start: Infinity,
|
|
11
|
+
end: -Infinity,
|
|
12
|
+
creation_reason: creationReason,
|
|
13
|
+
records_count: 0,
|
|
14
|
+
has_full_snapshot: false,
|
|
15
|
+
index_in_view: require_replayStats.getSegmentsCount(viewId),
|
|
16
|
+
source: "browser",
|
|
17
|
+
...context
|
|
18
|
+
};
|
|
19
|
+
const serializationStats = require_serializationStats.createSerializationStats();
|
|
20
|
+
require_replayStats.addSegment(viewId);
|
|
21
|
+
function addRecord(record, callback) {
|
|
22
|
+
metadata.start = Math.min(metadata.start, record.timestamp);
|
|
23
|
+
metadata.end = Math.max(metadata.end, record.timestamp);
|
|
24
|
+
metadata.records_count += 1;
|
|
25
|
+
metadata.has_full_snapshot ||= record.type === require_sessionReplayConstants.RecordType.FullSnapshot || record.type === require_sessionReplayConstants.RecordType.Change && metadata.index_in_view === 0;
|
|
26
|
+
const prefix = encoder.isEmpty ? "{\"records\":[" : ",";
|
|
27
|
+
encoder.write(prefix + JSON.stringify(record), (additionalEncodedBytesCount) => {
|
|
28
|
+
encodedBytesCount += additionalEncodedBytesCount;
|
|
29
|
+
callback(encodedBytesCount);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function addStats(stats) {
|
|
33
|
+
require_serializationStats.aggregateSerializationStats(serializationStats, stats);
|
|
34
|
+
}
|
|
35
|
+
function flush(callback) {
|
|
36
|
+
if (encoder.isEmpty) throw new Error("Empty segment flushed");
|
|
37
|
+
encoder.write(`],${JSON.stringify(metadata).slice(1)}\n`);
|
|
38
|
+
encoder.finish((encoderResult) => {
|
|
39
|
+
require_replayStats.addWroteData(metadata.view.id, encoderResult.rawBytesCount);
|
|
40
|
+
callback(metadata, serializationStats, encoderResult);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
addRecord,
|
|
45
|
+
addStats,
|
|
46
|
+
flush
|
|
47
|
+
};
|
|
81
48
|
}
|
|
49
|
+
//#endregion
|
|
50
|
+
exports.createSegment = createSegment;
|
|
51
|
+
|
|
82
52
|
//# sourceMappingURL=segment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segment.js","
|
|
1
|
+
{"version":3,"file":"segment.js","names":["createSerializationStats","RecordType"],"sources":["../../../src/domain/segmentCollection/segment.ts"],"sourcesContent":["import type { Encoder, EncoderResult, Uint8ArrayBuffer } from '@kubesense/kubesense-browser-core'\nimport type { BrowserRecord, BrowserSegmentMetadata, CreationReason, SegmentContext } from '../../types'\nimport { RecordType } from '../../types'\nimport * as replayStats from '../replayStats'\nimport type { SerializationStats } from '../record'\nimport { aggregateSerializationStats, createSerializationStats } from '../record'\n\nexport type FlushReason = Exclude<CreationReason, 'init'> | 'stop'\nexport type FlushCallback = (\n metadata: BrowserSegmentMetadata,\n stats: SerializationStats,\n encoderResult: EncoderResult<Uint8ArrayBuffer>\n) => void\nexport type AddRecordCallback = (encodedBytesCount: number) => void\n\nexport interface Segment {\n addRecord: (record: BrowserRecord, callback: AddRecordCallback) => void\n addStats: (stats: SerializationStats) => void\n flush: (callback: FlushCallback) => void\n}\n\nexport function createSegment({\n context,\n creationReason,\n encoder,\n}: {\n context: SegmentContext\n creationReason: CreationReason\n encoder: Encoder<Uint8ArrayBuffer>\n}): Segment {\n let encodedBytesCount = 0\n const viewId = context.view.id\n const indexInView = replayStats.getSegmentsCount(viewId)\n const metadata: BrowserSegmentMetadata = {\n start: Infinity,\n end: -Infinity,\n creation_reason: creationReason,\n records_count: 0,\n has_full_snapshot: false,\n index_in_view: indexInView,\n source: 'browser' as const,\n ...context,\n }\n\n const serializationStats = createSerializationStats()\n replayStats.addSegment(viewId)\n\n function addRecord(record: BrowserRecord, callback: AddRecordCallback): void {\n metadata.start = Math.min(metadata.start, record.timestamp)\n metadata.end = Math.max(metadata.end, record.timestamp)\n metadata.records_count += 1\n metadata.has_full_snapshot ||=\n record.type === RecordType.FullSnapshot || (record.type === RecordType.Change && metadata.index_in_view === 0)\n\n const prefix = encoder.isEmpty ? '{\"records\":[' : ','\n encoder.write(prefix + JSON.stringify(record), (additionalEncodedBytesCount) => {\n encodedBytesCount += additionalEncodedBytesCount\n callback(encodedBytesCount)\n })\n }\n\n function addStats(stats: SerializationStats): void {\n aggregateSerializationStats(serializationStats, stats)\n }\n\n function flush(callback: FlushCallback) {\n if (encoder.isEmpty) {\n throw new Error('Empty segment flushed')\n }\n\n encoder.write(`],${JSON.stringify(metadata).slice(1)}\\n`)\n encoder.finish((encoderResult) => {\n replayStats.addWroteData(metadata.view.id, encoderResult.rawBytesCount)\n callback(metadata, serializationStats, encoderResult)\n })\n }\n\n return { addRecord, addStats, flush }\n}\n"],"mappings":";;;;;AAqBA,SAAgB,cAAc,EAC5B,SACA,gBACA,WAKU;CACV,IAAI,oBAAoB;CACxB,MAAM,SAAS,QAAQ,KAAK;CAE5B,MAAM,WAAmC;EACvC,OAAO;EACP,KAAK;EACL,iBAAiB;EACjB,eAAe;EACf,mBAAmB;EACnB,eAAA,oBAAA,iBAP+C,MAOtB;EACzB,QAAQ;EACR,GAAG;CACL;CAEA,MAAM,qBAAqBA,2BAAAA,yBAAyB;CACpD,oBAAA,WAAuB,MAAM;CAE7B,SAAS,UAAU,QAAuB,UAAmC;EAC3E,SAAS,QAAQ,KAAK,IAAI,SAAS,OAAO,OAAO,SAAS;EAC1D,SAAS,MAAM,KAAK,IAAI,SAAS,KAAK,OAAO,SAAS;EACtD,SAAS,iBAAiB;EAC1B,SAAS,sBACP,OAAO,SAASC,+BAAAA,WAAW,gBAAiB,OAAO,SAASA,+BAAAA,WAAW,UAAU,SAAS,kBAAkB;EAE9G,MAAM,SAAS,QAAQ,UAAU,mBAAiB;EAClD,QAAQ,MAAM,SAAS,KAAK,UAAU,MAAM,IAAI,gCAAgC;GAC9E,qBAAqB;GACrB,SAAS,iBAAiB;EAC5B,CAAC;CACH;CAEA,SAAS,SAAS,OAAiC;EACjD,2BAAA,4BAA4B,oBAAoB,KAAK;CACvD;CAEA,SAAS,MAAM,UAAyB;EACtC,IAAI,QAAQ,SACV,MAAM,IAAI,MAAM,uBAAuB;EAGzC,QAAQ,MAAM,KAAK,KAAK,UAAU,QAAQ,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG;EACxD,QAAQ,QAAQ,kBAAkB;GAChC,oBAAA,aAAyB,SAAS,KAAK,IAAI,cAAc,aAAa;GACtE,SAAS,UAAU,oBAAoB,aAAa;EACtD,CAAC;CACH;CAEA,OAAO;EAAE;EAAW;EAAU;CAAM;AACtC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DeflateEncoder, HttpRequest } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import type { LifeCycle, ViewHistory,
|
|
1
|
+
import type { DeflateEncoder, HttpRequest, SessionManager } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
import type { LifeCycle, ViewHistory, RumConfiguration } from '@kubesense/kubesense-browser-rum-core';
|
|
3
3
|
import type { BrowserRecord, SegmentContext } from '../../types';
|
|
4
4
|
import type { SerializationStats } from '../record';
|
|
5
5
|
import type { ReplayPayload } from './buildReplayPayload';
|
|
@@ -14,9 +14,9 @@ interface SegmentCollector {
|
|
|
14
14
|
addStats(this: void, stats: SerializationStats): void;
|
|
15
15
|
stop(this: void): void;
|
|
16
16
|
}
|
|
17
|
-
export declare function startSegmentCollection(lifeCycle: LifeCycle, configuration: RumConfiguration, sessionManager:
|
|
17
|
+
export declare function startSegmentCollection(lifeCycle: LifeCycle, configuration: RumConfiguration, sessionManager: SessionManager, viewHistory: ViewHistory, httpRequest: HttpRequest<ReplayPayload>, encoder: DeflateEncoder): SegmentCollector;
|
|
18
18
|
export declare function doStartSegmentCollection(lifeCycle: LifeCycle, getSegmentContext: () => SegmentContext | undefined, httpRequest: HttpRequest<ReplayPayload>, encoder: DeflateEncoder): SegmentCollector;
|
|
19
|
-
export declare function computeSegmentContext(applicationId: string, sessionManager:
|
|
19
|
+
export declare function computeSegmentContext(applicationId: string, sessionManager: SessionManager, viewHistory: ViewHistory): {
|
|
20
20
|
application: {
|
|
21
21
|
id: string;
|
|
22
22
|
};
|
|
@@ -1,113 +1,95 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.setSegmentBytesLimit = setSegmentBytesLimit;
|
|
8
|
-
const kubesense_browser_core_1 = require("@kubesense/kubesense-browser-core");
|
|
9
|
-
const buildReplayPayload_1 = require("./buildReplayPayload");
|
|
10
|
-
const segment_1 = require("./segment");
|
|
11
|
-
exports.SEGMENT_DURATION_LIMIT = 5 * kubesense_browser_core_1.ONE_SECOND;
|
|
1
|
+
const require_buildReplayPayload = require("./buildReplayPayload.js");
|
|
2
|
+
const require_segment = require("./segment.js");
|
|
3
|
+
let _kubesense_kubesense_browser_rum_core = require("@kubesense/kubesense-browser-rum-core");
|
|
4
|
+
let _kubesense_kubesense_browser_core = require("@kubesense/kubesense-browser-core");
|
|
5
|
+
//#region src/domain/segmentCollection/segmentCollection.ts
|
|
6
|
+
const SEGMENT_DURATION_LIMIT = 5 * require("@kubesense/kubesense-js-core/time").ONE_SECOND;
|
|
12
7
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
* beacon payload max queue size implementation is 64kb
|
|
9
|
+
* ensure that we leave room for logs, rum and potential other users
|
|
10
|
+
*/
|
|
11
|
+
let SEGMENT_BYTES_LIMIT = 6e4;
|
|
17
12
|
function startSegmentCollection(lifeCycle, configuration, sessionManager, viewHistory, httpRequest, encoder) {
|
|
18
|
-
|
|
13
|
+
return doStartSegmentCollection(lifeCycle, () => computeSegmentContext(configuration.applicationId, sessionManager, viewHistory), httpRequest, encoder);
|
|
19
14
|
}
|
|
20
15
|
function doStartSegmentCollection(lifeCycle, getSegmentContext, httpRequest, encoder) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
},
|
|
80
|
-
addStats: (stats) => {
|
|
81
|
-
if (state.status === 1 /* SegmentCollectionStatus.SegmentPending */) {
|
|
82
|
-
state.segment.addStats(stats);
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
stop: () => {
|
|
86
|
-
flushSegment('stop');
|
|
87
|
-
unsubscribeViewCreated();
|
|
88
|
-
unsubscribePageMayExit();
|
|
89
|
-
},
|
|
90
|
-
};
|
|
16
|
+
let state = {
|
|
17
|
+
status: 0,
|
|
18
|
+
nextSegmentCreationReason: "init"
|
|
19
|
+
};
|
|
20
|
+
const { unsubscribe: unsubscribeViewCreated } = lifeCycle.subscribe(_kubesense_kubesense_browser_rum_core.LifeCycleEventType.VIEW_CREATED, () => {
|
|
21
|
+
flushSegment("view_change");
|
|
22
|
+
});
|
|
23
|
+
const { unsubscribe: unsubscribePageMayExit } = lifeCycle.subscribe(_kubesense_kubesense_browser_rum_core.LifeCycleEventType.PREPARE_URGENT_FLUSH, (reason) => {
|
|
24
|
+
flushSegment(reason);
|
|
25
|
+
});
|
|
26
|
+
function flushSegment(flushReason) {
|
|
27
|
+
if (state.status === 1) {
|
|
28
|
+
state.segment.flush((metadata, stats, encoderResult) => {
|
|
29
|
+
const payload = require_buildReplayPayload.buildReplayPayload(encoderResult.output, metadata, stats, encoderResult.rawBytesCount);
|
|
30
|
+
if ((0, _kubesense_kubesense_browser_core.isPageExitReason)(flushReason) && flushReason !== _kubesense_kubesense_browser_core.PageExitReason.HIDDEN) httpRequest.sendOnExit(payload);
|
|
31
|
+
else httpRequest.send(payload);
|
|
32
|
+
});
|
|
33
|
+
(0, _kubesense_kubesense_browser_core.clearTimeout)(state.expirationTimeoutId);
|
|
34
|
+
}
|
|
35
|
+
if (flushReason !== "stop") state = {
|
|
36
|
+
status: 0,
|
|
37
|
+
nextSegmentCreationReason: flushReason
|
|
38
|
+
};
|
|
39
|
+
else state = { status: 2 };
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
addRecord: (record) => {
|
|
43
|
+
if (state.status === 2) return;
|
|
44
|
+
if (state.status === 0) {
|
|
45
|
+
const context = getSegmentContext();
|
|
46
|
+
if (!context) return;
|
|
47
|
+
state = {
|
|
48
|
+
status: 1,
|
|
49
|
+
segment: require_segment.createSegment({
|
|
50
|
+
encoder,
|
|
51
|
+
context,
|
|
52
|
+
creationReason: state.nextSegmentCreationReason
|
|
53
|
+
}),
|
|
54
|
+
expirationTimeoutId: (0, _kubesense_kubesense_browser_core.setTimeout)(() => {
|
|
55
|
+
flushSegment("segment_duration_limit");
|
|
56
|
+
}, SEGMENT_DURATION_LIMIT)
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
state.segment.addRecord(record, (encodedBytesCount) => {
|
|
60
|
+
if (encodedBytesCount > SEGMENT_BYTES_LIMIT) flushSegment("segment_bytes_limit");
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
addStats: (stats) => {
|
|
64
|
+
if (state.status === 1) state.segment.addStats(stats);
|
|
65
|
+
},
|
|
66
|
+
stop: () => {
|
|
67
|
+
flushSegment("stop");
|
|
68
|
+
unsubscribeViewCreated();
|
|
69
|
+
unsubscribePageMayExit();
|
|
70
|
+
}
|
|
71
|
+
};
|
|
91
72
|
}
|
|
92
73
|
function computeSegmentContext(applicationId, sessionManager, viewHistory) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
session: {
|
|
103
|
-
id: session.id,
|
|
104
|
-
},
|
|
105
|
-
view: {
|
|
106
|
-
id: viewContext.id,
|
|
107
|
-
},
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
function setSegmentBytesLimit(newSegmentBytesLimit = 60000) {
|
|
111
|
-
exports.SEGMENT_BYTES_LIMIT = newSegmentBytesLimit;
|
|
74
|
+
const session = sessionManager.findTrackedSession();
|
|
75
|
+
const viewContext = viewHistory.findView();
|
|
76
|
+
if (!session || !viewContext) return;
|
|
77
|
+
return {
|
|
78
|
+
application: { id: applicationId },
|
|
79
|
+
session: { id: session.id },
|
|
80
|
+
view: { id: viewContext.id }
|
|
81
|
+
};
|
|
112
82
|
}
|
|
83
|
+
//#endregion
|
|
84
|
+
Object.defineProperty(exports, "SEGMENT_BYTES_LIMIT", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function() {
|
|
87
|
+
return SEGMENT_BYTES_LIMIT;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
exports.SEGMENT_DURATION_LIMIT = SEGMENT_DURATION_LIMIT;
|
|
91
|
+
exports.computeSegmentContext = computeSegmentContext;
|
|
92
|
+
exports.doStartSegmentCollection = doStartSegmentCollection;
|
|
93
|
+
exports.startSegmentCollection = startSegmentCollection;
|
|
94
|
+
|
|
113
95
|
//# sourceMappingURL=segmentCollection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmentCollection.js","
|
|
1
|
+
{"version":3,"file":"segmentCollection.js","names":["ONE_SECOND","LifeCycleEventType","buildReplayPayload","isPageExitReason","PageExitReason","createSegment","setTimeout"],"sources":["../../../src/domain/segmentCollection/segmentCollection.ts"],"sourcesContent":["import type { DeflateEncoder, HttpRequest, TimeoutId, SessionManager } from '@kubesense/kubesense-browser-core'\nimport { ONE_SECOND } from '@kubesense/kubesense-js-core/time'\nimport { isPageExitReason, PageExitReason, clearTimeout, setTimeout } from '@kubesense/kubesense-browser-core'\nimport type { LifeCycle, ViewHistory, RumConfiguration } from '@kubesense/kubesense-browser-rum-core'\nimport { LifeCycleEventType } from '@kubesense/kubesense-browser-rum-core'\nimport type { BrowserRecord, CreationReason, SegmentContext } from '../../types'\nimport type { SerializationStats } from '../record'\nimport type { ReplayPayload } from './buildReplayPayload'\nimport { buildReplayPayload } from './buildReplayPayload'\nimport type { FlushReason, Segment } from './segment'\nimport { createSegment } from './segment'\n\nexport const SEGMENT_DURATION_LIMIT = 5 * ONE_SECOND\n/**\n * beacon payload max queue size implementation is 64kb\n * ensure that we leave room for logs, rum and potential other users\n */\nexport let SEGMENT_BYTES_LIMIT = 60_000\n\n// Segments are the main data structure for session replays. They contain context information used\n// for indexing or UI needs, and a list of records (RRWeb 'events', renamed to avoid confusing\n// namings). They are stored without any processing from the intake, and fetched one after the\n// other while a session is being replayed. Their encoding (deflate) are carefully crafted to allow\n// concatenating multiple segments together. Segments have a size overhead (metadata), so our goal is to\n// build segments containing as many records as possible while complying with the various flush\n// strategies to guarantee a good replay quality.\n//\n// When the recording starts, a segment is initially created. The segment is flushed (finalized and\n// sent) based on various events (non-exhaustive list):\n//\n// * the page visibility change or becomes to unload\n// * the segment duration reaches a limit\n// * the encoded segment bytes count reaches a limit\n// * ...\n//\n// A segment cannot be created without its context. If the RUM session ends and no session id is\n// available when creating a new segment, records will be ignored, until the session is renewed and\n// a new session id is available.\n//\n// Empty segments (segments with no record) aren't useful and should be ignored.\n//\n// To help investigate session replays issues, each segment is created with a \"creation reason\",\n// indicating why the session has been created.\n\ninterface SegmentCollector {\n addRecord(this: void, record: BrowserRecord): void\n addStats(this: void, stats: SerializationStats): void\n stop(this: void): void\n}\n\nexport function startSegmentCollection(\n lifeCycle: LifeCycle,\n configuration: RumConfiguration,\n sessionManager: SessionManager,\n viewHistory: ViewHistory,\n httpRequest: HttpRequest<ReplayPayload>,\n encoder: DeflateEncoder\n): SegmentCollector {\n return doStartSegmentCollection(\n lifeCycle,\n () => computeSegmentContext(configuration.applicationId, sessionManager, viewHistory),\n httpRequest,\n encoder\n )\n}\n\nconst enum SegmentCollectionStatus {\n WaitingForInitialRecord,\n SegmentPending,\n Stopped,\n}\ntype SegmentCollectionState =\n | {\n status: SegmentCollectionStatus.WaitingForInitialRecord\n nextSegmentCreationReason: CreationReason\n }\n | {\n status: SegmentCollectionStatus.SegmentPending\n segment: Segment\n expirationTimeoutId: TimeoutId\n }\n | {\n status: SegmentCollectionStatus.Stopped\n }\n\nexport function doStartSegmentCollection(\n lifeCycle: LifeCycle,\n getSegmentContext: () => SegmentContext | undefined,\n httpRequest: HttpRequest<ReplayPayload>,\n encoder: DeflateEncoder\n): SegmentCollector {\n let state: SegmentCollectionState = {\n status: SegmentCollectionStatus.WaitingForInitialRecord,\n nextSegmentCreationReason: 'init',\n }\n\n const { unsubscribe: unsubscribeViewCreated } = lifeCycle.subscribe(LifeCycleEventType.VIEW_CREATED, () => {\n flushSegment('view_change')\n })\n\n const { unsubscribe: unsubscribePageMayExit } = lifeCycle.subscribe(\n LifeCycleEventType.PREPARE_URGENT_FLUSH,\n (reason) => {\n flushSegment(reason as FlushReason)\n }\n )\n\n function flushSegment(flushReason: FlushReason) {\n if (state.status === SegmentCollectionStatus.SegmentPending) {\n state.segment.flush((metadata, stats, encoderResult) => {\n const payload = buildReplayPayload(encoderResult.output, metadata, stats, encoderResult.rawBytesCount)\n\n // sendOnExit() is less reliable than send() since it doesn't retry. If the page is\n // *really* about to close, sendOnExit() is still better, since it uses a mechanism\n // that outlives the page itself; for PageExitReason.HIDDEN, though, the page is\n // probably not actually closing, so we prefer send().\n if (isPageExitReason(flushReason) && flushReason !== PageExitReason.HIDDEN) {\n httpRequest.sendOnExit(payload)\n } else {\n httpRequest.send(payload)\n }\n })\n clearTimeout(state.expirationTimeoutId)\n }\n\n if (flushReason !== 'stop') {\n state = {\n status: SegmentCollectionStatus.WaitingForInitialRecord,\n nextSegmentCreationReason: flushReason,\n }\n } else {\n state = {\n status: SegmentCollectionStatus.Stopped,\n }\n }\n }\n\n return {\n addRecord: (record: BrowserRecord) => {\n if (state.status === SegmentCollectionStatus.Stopped) {\n return\n }\n\n if (state.status === SegmentCollectionStatus.WaitingForInitialRecord) {\n const context = getSegmentContext()\n if (!context) {\n return\n }\n\n state = {\n status: SegmentCollectionStatus.SegmentPending,\n segment: createSegment({ encoder, context, creationReason: state.nextSegmentCreationReason }),\n expirationTimeoutId: setTimeout(() => {\n flushSegment('segment_duration_limit')\n }, SEGMENT_DURATION_LIMIT),\n }\n }\n\n state.segment.addRecord(record, (encodedBytesCount) => {\n if (encodedBytesCount > SEGMENT_BYTES_LIMIT) {\n flushSegment('segment_bytes_limit')\n }\n })\n },\n\n addStats: (stats: SerializationStats) => {\n if (state.status === SegmentCollectionStatus.SegmentPending) {\n state.segment.addStats(stats)\n }\n },\n\n stop: () => {\n flushSegment('stop')\n unsubscribeViewCreated()\n unsubscribePageMayExit()\n },\n }\n}\n\nexport function computeSegmentContext(applicationId: string, sessionManager: SessionManager, viewHistory: ViewHistory) {\n const session = sessionManager.findTrackedSession()\n const viewContext = viewHistory.findView()\n if (!session || !viewContext) {\n return undefined\n }\n return {\n application: {\n id: applicationId,\n },\n session: {\n id: session.id,\n },\n view: {\n id: viewContext.id,\n },\n }\n}\n\nexport function setSegmentBytesLimit(newSegmentBytesLimit = 60_000) {\n SEGMENT_BYTES_LIMIT = newSegmentBytesLimit\n}\n"],"mappings":";;;;;AAYA,MAAa,yBAAyB,+CAAIA,CAAAA,CAAAA;;;;;AAK1C,IAAW,sBAAsB;AAiCjC,SAAgB,uBACd,WACA,eACA,gBACA,aACA,aACA,SACkB;CAClB,OAAO,yBACL,iBACM,sBAAsB,cAAc,eAAe,gBAAgB,WAAW,GACpF,aACA,OACF;AACF;AAqBA,SAAgB,yBACd,WACA,mBACA,aACA,SACkB;CAClB,IAAI,QAAgC;EAClC,QAAA;EACA,2BAA2B;CAC7B;CAEA,MAAM,EAAE,aAAa,2BAA2B,UAAU,UAAUC,sCAAAA,mBAAmB,oBAAoB;EACzG,aAAa,aAAa;CAC5B,CAAC;CAED,MAAM,EAAE,aAAa,2BAA2B,UAAU,UACxDA,sCAAAA,mBAAmB,uBAClB,WAAW;EACV,aAAa,MAAqB;CACpC,CACF;CAEA,SAAS,aAAa,aAA0B;EAC9C,IAAI,MAAM,WAAA,GAAmD;GAC3D,MAAM,QAAQ,OAAO,UAAU,OAAO,kBAAkB;IACtD,MAAM,UAAUC,2BAAAA,mBAAmB,cAAc,QAAQ,UAAU,OAAO,cAAc,aAAa;IAMrG,KAAA,GAAIC,kCAAAA,iBAAAA,CAAiB,WAAW,KAAK,gBAAgBC,kCAAAA,eAAe,QAClE,YAAY,WAAW,OAAO;SAE9B,YAAY,KAAK,OAAO;GAE5B,CAAC;GACD,CAAA,GAAA,kCAAA,aAAA,CAAa,MAAM,mBAAmB;EACxC;EAEA,IAAI,gBAAgB,QAClB,QAAQ;GACN,QAAA;GACA,2BAA2B;EAC7B;OAEA,QAAQ,EACN,QAAA,EACF;CAEJ;CAEA,OAAO;EACL,YAAY,WAA0B;GACpC,IAAI,MAAM,WAAA,GACR;GAGF,IAAI,MAAM,WAAA,GAA4D;IACpE,MAAM,UAAU,kBAAkB;IAClC,IAAI,CAAC,SACH;IAGF,QAAQ;KACN,QAAA;KACA,SAASC,gBAAAA,cAAc;MAAE;MAAS;MAAS,gBAAgB,MAAM;KAA0B,CAAC;KAC5F,sBAAA,GAAqBC,kCAAAA,WAAAA,OAAiB;MACpC,aAAa,wBAAwB;KACvC,GAAG,sBAAsB;IAC3B;GACF;GAEA,MAAM,QAAQ,UAAU,SAAS,sBAAsB;IACrD,IAAI,oBAAoB,qBACtB,aAAa,qBAAqB;GAEtC,CAAC;EACH;EAEA,WAAW,UAA8B;GACvC,IAAI,MAAM,WAAA,GACR,MAAM,QAAQ,SAAS,KAAK;EAEhC;EAEA,YAAY;GACV,aAAa,MAAM;GACnB,uBAAuB;GACvB,uBAAuB;EACzB;CACF;AACF;AAEA,SAAgB,sBAAsB,eAAuB,gBAAgC,aAA0B;CACrH,MAAM,UAAU,eAAe,mBAAmB;CAClD,MAAM,cAAc,YAAY,SAAS;CACzC,IAAI,CAAC,WAAW,CAAC,aACf;CAEF,OAAO;EACL,aAAa,EACX,IAAI,cACN;EACA,SAAS,EACP,IAAI,QAAQ,GACd;EACA,MAAM,EACJ,IAAI,YAAY,GAClB;CACF;AACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { HttpRequestEvent, Observable } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
import type { ReplayPayload } from './buildReplayPayload';
|
|
3
|
+
/** The least time between two recovery snapshots. */
|
|
4
|
+
export declare const DROPPED_SEGMENT_RECOVERY_INTERVAL: number;
|
|
5
|
+
/**
|
|
6
|
+
* Takes a new full snapshot when a segment is lost to a network error.
|
|
7
|
+
*
|
|
8
|
+
* Every record after a lost segment builds on DOM the intake never received, so without a new
|
|
9
|
+
* snapshot the replay freezes on the last DOM it has until the next view starts one. Only a
|
|
10
|
+
* network error triggers it — an upload the intake rejected (401, 413) would see the snapshot
|
|
11
|
+
* rejected too — and at most once per interval, so a failing network costs one snapshot per
|
|
12
|
+
* interval rather than one per segment.
|
|
13
|
+
*/
|
|
14
|
+
export declare function startDroppedSegmentRecovery(replayRequestObservable: Observable<HttpRequestEvent<ReplayPayload>>, takeFullSnapshot: () => void): {
|
|
15
|
+
stop: () => void;
|
|
16
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
let _kubesense_kubesense_js_core_time = require("@kubesense/kubesense-js-core/time");
|
|
2
|
+
//#region src/domain/segmentCollection/startDroppedSegmentRecovery.ts
|
|
3
|
+
/** The least time between two recovery snapshots. */
|
|
4
|
+
const DROPPED_SEGMENT_RECOVERY_INTERVAL = 30 * _kubesense_kubesense_js_core_time.ONE_SECOND;
|
|
5
|
+
/**
|
|
6
|
+
* Takes a new full snapshot when a segment is lost to a network error.
|
|
7
|
+
*
|
|
8
|
+
* Every record after a lost segment builds on DOM the intake never received, so without a new
|
|
9
|
+
* snapshot the replay freezes on the last DOM it has until the next view starts one. Only a
|
|
10
|
+
* network error triggers it — an upload the intake rejected (401, 413) would see the snapshot
|
|
11
|
+
* rejected too — and at most once per interval, so a failing network costs one snapshot per
|
|
12
|
+
* interval rather than one per segment.
|
|
13
|
+
*/
|
|
14
|
+
function startDroppedSegmentRecovery(replayRequestObservable, takeFullSnapshot) {
|
|
15
|
+
let lastRecovery;
|
|
16
|
+
const { unsubscribe } = replayRequestObservable.subscribe((event) => {
|
|
17
|
+
if (event.type !== "dropped" || event.status !== 0) return;
|
|
18
|
+
const now = (0, _kubesense_kubesense_js_core_time.timeStampNow)();
|
|
19
|
+
if (lastRecovery !== void 0 && (0, _kubesense_kubesense_js_core_time.elapsed)(lastRecovery, now) < DROPPED_SEGMENT_RECOVERY_INTERVAL) return;
|
|
20
|
+
lastRecovery = now;
|
|
21
|
+
takeFullSnapshot();
|
|
22
|
+
});
|
|
23
|
+
return { stop: unsubscribe };
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
exports.DROPPED_SEGMENT_RECOVERY_INTERVAL = DROPPED_SEGMENT_RECOVERY_INTERVAL;
|
|
27
|
+
exports.startDroppedSegmentRecovery = startDroppedSegmentRecovery;
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=startDroppedSegmentRecovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"startDroppedSegmentRecovery.js","names":["ONE_SECOND","timeStampNow","elapsed"],"sources":["../../../src/domain/segmentCollection/startDroppedSegmentRecovery.ts"],"sourcesContent":["import type { HttpRequestEvent, Observable } from '@kubesense/kubesense-browser-core'\nimport { elapsed, ONE_SECOND, timeStampNow } from '@kubesense/kubesense-js-core/time'\nimport type { TimeStamp } from '@kubesense/kubesense-js-core/time'\nimport type { ReplayPayload } from './buildReplayPayload'\n\n/** The least time between two recovery snapshots. */\nexport const DROPPED_SEGMENT_RECOVERY_INTERVAL = 30 * ONE_SECOND\n\n/**\n * Takes a new full snapshot when a segment is lost to a network error.\n *\n * Every record after a lost segment builds on DOM the intake never received, so without a new\n * snapshot the replay freezes on the last DOM it has until the next view starts one. Only a\n * network error triggers it — an upload the intake rejected (401, 413) would see the snapshot\n * rejected too — and at most once per interval, so a failing network costs one snapshot per\n * interval rather than one per segment.\n */\nexport function startDroppedSegmentRecovery(\n replayRequestObservable: Observable<HttpRequestEvent<ReplayPayload>>,\n takeFullSnapshot: () => void\n) {\n let lastRecovery: TimeStamp | undefined\n\n const { unsubscribe } = replayRequestObservable.subscribe((event) => {\n if (event.type !== 'dropped' || event.status !== 0) {\n return\n }\n const now = timeStampNow()\n if (lastRecovery !== undefined && elapsed(lastRecovery, now) < DROPPED_SEGMENT_RECOVERY_INTERVAL) {\n return\n }\n lastRecovery = now\n takeFullSnapshot()\n })\n\n return { stop: unsubscribe }\n}\n"],"mappings":";;;AAMA,MAAa,oCAAoC,KAAKA,kCAAAA;;;;;;;;;;AAWtD,SAAgB,4BACd,yBACA,kBACA;CACA,IAAI;CAEJ,MAAM,EAAE,gBAAgB,wBAAwB,WAAW,UAAU;EACnE,IAAI,MAAM,SAAS,aAAa,MAAM,WAAW,GAC/C;EAEF,MAAM,OAAA,GAAMC,kCAAAA,aAAAA,CAAa;EACzB,IAAI,iBAAiB,KAAA,MAAA,GAAaC,kCAAAA,QAAAA,CAAQ,cAAc,GAAG,IAAI,mCAC7D;EAEF,eAAe;EACf,iBAAiB;CACnB,CAAC;CAED,OAAO,EAAE,MAAM,YAAY;AAC7B"}
|