@depup/datadog__browser-rum 6.31.0-depup.0
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 +201 -0
- package/README.md +25 -0
- package/bundle/chunks/profiler-9f1c1103f1ef0aa98257-datadog-rum.js +1 -0
- package/bundle/chunks/recorder-926b641c6ef51d09a378-datadog-rum.js +1 -0
- package/bundle/datadog-rum.js +1 -0
- package/changes.json +5 -0
- package/cjs/boot/isBrowserSupported.d.ts +4 -0
- package/cjs/boot/isBrowserSupported.js +17 -0
- package/cjs/boot/isBrowserSupported.js.map +1 -0
- package/cjs/boot/lazyLoadProfiler.d.ts +3 -0
- package/cjs/boot/lazyLoadProfiler.js +56 -0
- package/cjs/boot/lazyLoadProfiler.js.map +1 -0
- package/cjs/boot/lazyLoadRecorder.d.ts +3 -0
- package/cjs/boot/lazyLoadRecorder.js +56 -0
- package/cjs/boot/lazyLoadRecorder.js.map +1 -0
- package/cjs/boot/postStartStrategy.d.ts +33 -0
- package/cjs/boot/postStartStrategy.js +98 -0
- package/cjs/boot/postStartStrategy.js.map +1 -0
- package/cjs/boot/preStartStrategy.d.ts +6 -0
- package/cjs/boot/preStartStrategy.js +24 -0
- package/cjs/boot/preStartStrategy.js.map +1 -0
- package/cjs/boot/profilerApi.d.ts +2 -0
- package/cjs/boot/profilerApi.js +52 -0
- package/cjs/boot/profilerApi.js.map +1 -0
- package/cjs/boot/recorderApi.d.ts +3 -0
- package/cjs/boot/recorderApi.js +71 -0
- package/cjs/boot/recorderApi.js.map +1 -0
- package/cjs/boot/startRecording.d.ts +6 -0
- package/cjs/boot/startRecording.js +45 -0
- package/cjs/boot/startRecording.js.map +1 -0
- package/cjs/domain/deflate/deflateEncoder.d.ts +3 -0
- package/cjs/domain/deflate/deflateEncoder.js +110 -0
- package/cjs/domain/deflate/deflateEncoder.js.map +1 -0
- package/cjs/domain/deflate/deflateWorker.d.ts +29 -0
- package/cjs/domain/deflate/deflateWorker.js +105 -0
- package/cjs/domain/deflate/deflateWorker.js.map +1 -0
- package/cjs/domain/deflate/index.d.ts +3 -0
- package/cjs/domain/deflate/index.js +11 -0
- package/cjs/domain/deflate/index.js.map +1 -0
- package/cjs/domain/getSessionReplayLink.d.ts +2 -0
- package/cjs/domain/getSessionReplayLink.js +35 -0
- package/cjs/domain/getSessionReplayLink.js.map +1 -0
- package/cjs/domain/profiling/actionHistory.d.ts +10 -0
- package/cjs/domain/profiling/actionHistory.js +49 -0
- package/cjs/domain/profiling/actionHistory.js.map +1 -0
- package/cjs/domain/profiling/longTaskHistory.d.ts +11 -0
- package/cjs/domain/profiling/longTaskHistory.js +28 -0
- package/cjs/domain/profiling/longTaskHistory.js.map +1 -0
- package/cjs/domain/profiling/profiler.d.ts +7 -0
- package/cjs/domain/profiling/profiler.js +267 -0
- package/cjs/domain/profiling/profiler.js.map +1 -0
- package/cjs/domain/profiling/profilingContext.d.ts +6 -0
- package/cjs/domain/profiling/profilingContext.js +31 -0
- package/cjs/domain/profiling/profilingContext.js.map +1 -0
- package/cjs/domain/profiling/profilingSupported.d.ts +1 -0
- package/cjs/domain/profiling/profilingSupported.js +11 -0
- package/cjs/domain/profiling/profilingSupported.js.map +1 -0
- package/cjs/domain/profiling/test-utils/mockedTrace.d.ts +3 -0
- package/cjs/domain/profiling/test-utils/mockedTrace.js +57 -0
- package/cjs/domain/profiling/test-utils/mockedTrace.js.map +1 -0
- package/cjs/domain/profiling/transport/assembly.d.ts +7 -0
- package/cjs/domain/profiling/transport/assembly.js +45 -0
- package/cjs/domain/profiling/transport/assembly.js.map +1 -0
- package/cjs/domain/profiling/transport/buildProfileEventAttributes.d.ts +33 -0
- package/cjs/domain/profiling/transport/buildProfileEventAttributes.js +63 -0
- package/cjs/domain/profiling/transport/buildProfileEventAttributes.js.map +1 -0
- package/cjs/domain/profiling/types/index.d.ts +2 -0
- package/cjs/domain/profiling/types/index.js +3 -0
- package/cjs/domain/profiling/types/index.js.map +1 -0
- package/cjs/domain/profiling/types/profilerApi.types.d.ts +58 -0
- package/cjs/domain/profiling/types/profilerApi.types.js +5 -0
- package/cjs/domain/profiling/types/profilerApi.types.js.map +1 -0
- package/cjs/domain/profiling/types/rumProfiler.types.d.ts +55 -0
- package/cjs/domain/profiling/types/rumProfiler.types.js +3 -0
- package/cjs/domain/profiling/types/rumProfiler.types.js.map +1 -0
- package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.d.ts +1 -0
- package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.js +7 -0
- package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.js.map +1 -0
- package/cjs/domain/profiling/utils/getDefaultViewName.d.ts +1 -0
- package/cjs/domain/profiling/utils/getDefaultViewName.js +14 -0
- package/cjs/domain/profiling/utils/getDefaultViewName.js.map +1 -0
- package/cjs/domain/profiling/utils/getNumberOfSamples.d.ts +8 -0
- package/cjs/domain/profiling/utils/getNumberOfSamples.js +19 -0
- package/cjs/domain/profiling/utils/getNumberOfSamples.js.map +1 -0
- package/cjs/domain/profiling/vitalHistory.d.ts +10 -0
- package/cjs/domain/profiling/vitalHistory.js +42 -0
- package/cjs/domain/profiling/vitalHistory.js.map +1 -0
- package/cjs/domain/record/assembly.d.ts +3 -0
- package/cjs/domain/record/assembly.js +16 -0
- package/cjs/domain/record/assembly.js.map +1 -0
- package/cjs/domain/record/elementsScrollPositions.d.ts +10 -0
- package/cjs/domain/record/elementsScrollPositions.js +23 -0
- package/cjs/domain/record/elementsScrollPositions.js.map +1 -0
- package/cjs/domain/record/eventsUtils.d.ts +2 -0
- package/cjs/domain/record/eventsUtils.js +15 -0
- package/cjs/domain/record/eventsUtils.js.map +1 -0
- package/cjs/domain/record/index.d.ts +6 -0
- package/cjs/domain/record/index.js +17 -0
- package/cjs/domain/record/index.js.map +1 -0
- package/cjs/domain/record/internalApi.d.ts +22 -0
- package/cjs/domain/record/internalApi.js +55 -0
- package/cjs/domain/record/internalApi.js.map +1 -0
- package/cjs/domain/record/itemIds.d.ts +40 -0
- package/cjs/domain/record/itemIds.js +58 -0
- package/cjs/domain/record/itemIds.js.map +1 -0
- package/cjs/domain/record/mutationBatch.d.ts +12 -0
- package/cjs/domain/record/mutationBatch.js +44 -0
- package/cjs/domain/record/mutationBatch.js.map +1 -0
- package/cjs/domain/record/record.d.ts +16 -0
- package/cjs/domain/record/record.js +88 -0
- package/cjs/domain/record/record.js.map +1 -0
- package/cjs/domain/record/record.types.d.ts +18 -0
- package/cjs/domain/record/record.types.js +3 -0
- package/cjs/domain/record/record.types.js.map +1 -0
- package/cjs/domain/record/recordingScope.d.ts +24 -0
- package/cjs/domain/record/recordingScope.js +29 -0
- package/cjs/domain/record/recordingScope.js.map +1 -0
- package/cjs/domain/record/serialization/changeEncoder.d.ts +22 -0
- package/cjs/domain/record/serialization/changeEncoder.js +59 -0
- package/cjs/domain/record/serialization/changeEncoder.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/changeConverter.d.ts +10 -0
- package/cjs/domain/record/serialization/conversions/changeConverter.js +216 -0
- package/cjs/domain/record/serialization/conversions/changeConverter.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/changeDecoder.d.ts +16 -0
- package/cjs/domain/record/serialization/conversions/changeDecoder.js +137 -0
- package/cjs/domain/record/serialization/conversions/changeDecoder.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/index.d.ts +7 -0
- package/cjs/domain/record/serialization/conversions/index.js +11 -0
- package/cjs/domain/record/serialization/conversions/index.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/mutationLog.d.ts +15 -0
- package/cjs/domain/record/serialization/conversions/mutationLog.js +36 -0
- package/cjs/domain/record/serialization/conversions/mutationLog.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/nodeIdRemapper.d.ts +10 -0
- package/cjs/domain/record/serialization/conversions/nodeIdRemapper.js +53 -0
- package/cjs/domain/record/serialization/conversions/nodeIdRemapper.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/renderOptions.d.ts +6 -0
- package/cjs/domain/record/serialization/conversions/renderOptions.js +12 -0
- package/cjs/domain/record/serialization/conversions/renderOptions.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/stringTable.d.ts +5 -0
- package/cjs/domain/record/serialization/conversions/stringTable.js +22 -0
- package/cjs/domain/record/serialization/conversions/stringTable.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/vDocument.d.ts +23 -0
- package/cjs/domain/record/serialization/conversions/vDocument.js +176 -0
- package/cjs/domain/record/serialization/conversions/vDocument.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/vNode.d.ts +66 -0
- package/cjs/domain/record/serialization/conversions/vNode.js +285 -0
- package/cjs/domain/record/serialization/conversions/vNode.js.map +1 -0
- package/cjs/domain/record/serialization/conversions/vStyleSheet.d.ts +16 -0
- package/cjs/domain/record/serialization/conversions/vStyleSheet.js +29 -0
- package/cjs/domain/record/serialization/conversions/vStyleSheet.js.map +1 -0
- package/cjs/domain/record/serialization/experimentalFeatures.d.ts +2 -0
- package/cjs/domain/record/serialization/experimentalFeatures.js +16 -0
- package/cjs/domain/record/serialization/experimentalFeatures.js.map +1 -0
- package/cjs/domain/record/serialization/index.d.ts +17 -0
- package/cjs/domain/record/serialization/index.js +37 -0
- package/cjs/domain/record/serialization/index.js.map +1 -0
- package/cjs/domain/record/serialization/insertionCursor.d.ts +57 -0
- package/cjs/domain/record/serialization/insertionCursor.js +68 -0
- package/cjs/domain/record/serialization/insertionCursor.js.map +1 -0
- package/cjs/domain/record/serialization/serialization.types.d.ts +24 -0
- package/cjs/domain/record/serialization/serialization.types.js +3 -0
- package/cjs/domain/record/serialization/serialization.types.js.map +1 -0
- package/cjs/domain/record/serialization/serializationStats.d.ts +12 -0
- package/cjs/domain/record/serialization/serializationStats.js +32 -0
- package/cjs/domain/record/serialization/serializationStats.js.map +1 -0
- package/cjs/domain/record/serialization/serializationTransaction.d.ts +96 -0
- package/cjs/domain/record/serialization/serializationTransaction.js +103 -0
- package/cjs/domain/record/serialization/serializationTransaction.js.map +1 -0
- package/cjs/domain/record/serialization/serializationUtils.d.ts +18 -0
- package/cjs/domain/record/serialization/serializationUtils.js +88 -0
- package/cjs/domain/record/serialization/serializationUtils.js.map +1 -0
- package/cjs/domain/record/serialization/serializeAttribute.d.ts +4 -0
- package/cjs/domain/record/serialization/serializeAttribute.js +42 -0
- package/cjs/domain/record/serialization/serializeAttribute.js.map +1 -0
- package/cjs/domain/record/serialization/serializeAttributes.d.ts +7 -0
- package/cjs/domain/record/serialization/serializeAttributes.js +167 -0
- package/cjs/domain/record/serialization/serializeAttributes.js.map +1 -0
- package/cjs/domain/record/serialization/serializeFullSnapshot.d.ts +5 -0
- package/cjs/domain/record/serialization/serializeFullSnapshot.js +34 -0
- package/cjs/domain/record/serialization/serializeFullSnapshot.js.map +1 -0
- package/cjs/domain/record/serialization/serializeFullSnapshotAsChange.d.ts +5 -0
- package/cjs/domain/record/serialization/serializeFullSnapshotAsChange.js +13 -0
- package/cjs/domain/record/serialization/serializeFullSnapshotAsChange.js.map +1 -0
- package/cjs/domain/record/serialization/serializeMutations.d.ts +11 -0
- package/cjs/domain/record/serialization/serializeMutations.js +262 -0
- package/cjs/domain/record/serialization/serializeMutations.js.map +1 -0
- package/cjs/domain/record/serialization/serializeMutationsAsChange.d.ts +5 -0
- package/cjs/domain/record/serialization/serializeMutationsAsChange.js +204 -0
- package/cjs/domain/record/serialization/serializeMutationsAsChange.js.map +1 -0
- package/cjs/domain/record/serialization/serializeNode.d.ts +7 -0
- package/cjs/domain/record/serialization/serializeNode.js +154 -0
- package/cjs/domain/record/serialization/serializeNode.js.map +1 -0
- package/cjs/domain/record/serialization/serializeNodeAsChange.d.ts +4 -0
- package/cjs/domain/record/serialization/serializeNodeAsChange.js +153 -0
- package/cjs/domain/record/serialization/serializeNodeAsChange.js.map +1 -0
- package/cjs/domain/record/serialization/serializeStyleSheets.d.ts +3 -0
- package/cjs/domain/record/serialization/serializeStyleSheets.js +30 -0
- package/cjs/domain/record/serialization/serializeStyleSheets.js.map +1 -0
- package/cjs/domain/record/serializationVerifier.d.ts +18 -0
- package/cjs/domain/record/serializationVerifier.js +126 -0
- package/cjs/domain/record/serializationVerifier.js.map +1 -0
- package/cjs/domain/record/shadowRootsController.d.ts +11 -0
- package/cjs/domain/record/shadowRootsController.js +45 -0
- package/cjs/domain/record/shadowRootsController.js.map +1 -0
- package/cjs/domain/record/startFullSnapshots.d.ts +10 -0
- package/cjs/domain/record/startFullSnapshots.js +50 -0
- package/cjs/domain/record/startFullSnapshots.js.map +1 -0
- package/cjs/domain/record/trackers/index.d.ts +12 -0
- package/cjs/domain/record/trackers/index.js +27 -0
- package/cjs/domain/record/trackers/index.js.map +1 -0
- package/cjs/domain/record/trackers/trackFocus.d.ts +5 -0
- package/cjs/domain/record/trackers/trackFocus.js +15 -0
- package/cjs/domain/record/trackers/trackFocus.js.map +1 -0
- package/cjs/domain/record/trackers/trackFrustration.d.ts +6 -0
- package/cjs/domain/record/trackers/trackFrustration.js +31 -0
- package/cjs/domain/record/trackers/trackFrustration.js.map +1 -0
- package/cjs/domain/record/trackers/trackInput.d.ts +4 -0
- package/cjs/domain/record/trackers/trackInput.js +104 -0
- package/cjs/domain/record/trackers/trackInput.js.map +1 -0
- package/cjs/domain/record/trackers/trackMediaInteraction.d.ts +5 -0
- package/cjs/domain/record/trackers/trackMediaInteraction.js +29 -0
- package/cjs/domain/record/trackers/trackMediaInteraction.js.map +1 -0
- package/cjs/domain/record/trackers/trackMouseInteraction.d.ts +5 -0
- package/cjs/domain/record/trackers/trackMouseInteraction.js +59 -0
- package/cjs/domain/record/trackers/trackMouseInteraction.js.map +1 -0
- package/cjs/domain/record/trackers/trackMove.d.ts +9 -0
- package/cjs/domain/record/trackers/trackMove.js +55 -0
- package/cjs/domain/record/trackers/trackMove.js.map +1 -0
- package/cjs/domain/record/trackers/trackMutation.d.ts +13 -0
- package/cjs/domain/record/trackers/trackMutation.js +41 -0
- package/cjs/domain/record/trackers/trackMutation.js.map +1 -0
- package/cjs/domain/record/trackers/trackScroll.d.ts +5 -0
- package/cjs/domain/record/trackers/trackScroll.js +48 -0
- package/cjs/domain/record/trackers/trackScroll.js.map +1 -0
- package/cjs/domain/record/trackers/trackStyleSheet.d.ts +6 -0
- package/cjs/domain/record/trackers/trackStyleSheet.js +89 -0
- package/cjs/domain/record/trackers/trackStyleSheet.js.map +1 -0
- package/cjs/domain/record/trackers/trackViewEnd.d.ts +5 -0
- package/cjs/domain/record/trackers/trackViewEnd.js +20 -0
- package/cjs/domain/record/trackers/trackViewEnd.js.map +1 -0
- package/cjs/domain/record/trackers/trackViewportResize.d.ts +6 -0
- package/cjs/domain/record/trackers/trackViewportResize.js +46 -0
- package/cjs/domain/record/trackers/trackViewportResize.js.map +1 -0
- package/cjs/domain/record/trackers/tracker.types.d.ts +3 -0
- package/cjs/domain/record/trackers/tracker.types.js +3 -0
- package/cjs/domain/record/trackers/tracker.types.js.map +1 -0
- package/cjs/domain/record/viewports.d.ts +20 -0
- package/cjs/domain/record/viewports.js +60 -0
- package/cjs/domain/record/viewports.js.map +1 -0
- package/cjs/domain/replayStats.d.ts +8 -0
- package/cjs/domain/replayStats.js +60 -0
- package/cjs/domain/replayStats.js.map +1 -0
- package/cjs/domain/scriptLoadingError.d.ts +6 -0
- package/cjs/domain/scriptLoadingError.js +26 -0
- package/cjs/domain/scriptLoadingError.js.map +1 -0
- package/cjs/domain/segmentCollection/buildReplayPayload.d.ts +15 -0
- package/cjs/domain/segmentCollection/buildReplayPayload.js +26 -0
- package/cjs/domain/segmentCollection/buildReplayPayload.js.map +1 -0
- package/cjs/domain/segmentCollection/index.d.ts +4 -0
- package/cjs/domain/segmentCollection/index.js +11 -0
- package/cjs/domain/segmentCollection/index.js.map +1 -0
- package/cjs/domain/segmentCollection/segment.d.ts +16 -0
- package/cjs/domain/segmentCollection/segment.js +82 -0
- package/cjs/domain/segmentCollection/segment.js.map +1 -0
- package/cjs/domain/segmentCollection/segmentCollection.d.ts +31 -0
- package/cjs/domain/segmentCollection/segmentCollection.js +113 -0
- package/cjs/domain/segmentCollection/segmentCollection.js.map +1 -0
- package/cjs/domain/segmentCollection/startSegmentTelemetry.d.ts +6 -0
- package/cjs/domain/segmentCollection/startSegmentTelemetry.js +52 -0
- package/cjs/domain/segmentCollection/startSegmentTelemetry.js.map +1 -0
- package/cjs/domain/startRecordBridge.d.ts +5 -0
- package/cjs/domain/startRecordBridge.js +17 -0
- package/cjs/domain/startRecordBridge.js.map +1 -0
- package/cjs/domain/startRecorderInitTelemetry.d.ts +15 -0
- package/cjs/domain/startRecorderInitTelemetry.js +55 -0
- package/cjs/domain/startRecorderInitTelemetry.js.map +1 -0
- package/cjs/entries/internal.d.ts +11 -0
- package/cjs/entries/internal.js +28 -0
- package/cjs/entries/internal.js.map +1 -0
- package/cjs/entries/internalSynthetics.d.ts +2 -0
- package/cjs/entries/internalSynthetics.js +27 -0
- package/cjs/entries/internalSynthetics.js.map +1 -0
- package/cjs/entries/main.d.ts +23 -0
- package/cjs/entries/main.js +35 -0
- package/cjs/entries/main.js.map +1 -0
- package/cjs/types/index.d.ts +3 -0
- package/cjs/types/index.js +18 -0
- package/cjs/types/index.js.map +1 -0
- package/cjs/types/profiling.d.ts +296 -0
- package/cjs/types/profiling.js +6 -0
- package/cjs/types/profiling.js.map +1 -0
- package/cjs/types/sessionReplay.d.ts +934 -0
- package/cjs/types/sessionReplay.js +6 -0
- package/cjs/types/sessionReplay.js.map +1 -0
- package/cjs/types/sessionReplayConstants.d.ts +71 -0
- package/cjs/types/sessionReplayConstants.js +67 -0
- package/cjs/types/sessionReplayConstants.js.map +1 -0
- package/esm/boot/isBrowserSupported.d.ts +4 -0
- package/esm/boot/isBrowserSupported.js +14 -0
- package/esm/boot/isBrowserSupported.js.map +1 -0
- package/esm/boot/lazyLoadProfiler.d.ts +3 -0
- package/esm/boot/lazyLoadProfiler.js +19 -0
- package/esm/boot/lazyLoadProfiler.js.map +1 -0
- package/esm/boot/lazyLoadRecorder.d.ts +3 -0
- package/esm/boot/lazyLoadRecorder.js +19 -0
- package/esm/boot/lazyLoadRecorder.js.map +1 -0
- package/esm/boot/postStartStrategy.d.ts +33 -0
- package/esm/boot/postStartStrategy.js +95 -0
- package/esm/boot/postStartStrategy.js.map +1 -0
- package/esm/boot/preStartStrategy.d.ts +6 -0
- package/esm/boot/preStartStrategy.js +21 -0
- package/esm/boot/preStartStrategy.js.map +1 -0
- package/esm/boot/profilerApi.d.ts +2 -0
- package/esm/boot/profilerApi.js +49 -0
- package/esm/boot/profilerApi.js.map +1 -0
- package/esm/boot/recorderApi.d.ts +3 -0
- package/esm/boot/recorderApi.js +68 -0
- package/esm/boot/recorderApi.js.map +1 -0
- package/esm/boot/startRecording.d.ts +6 -0
- package/esm/boot/startRecording.js +42 -0
- package/esm/boot/startRecording.js.map +1 -0
- package/esm/domain/deflate/deflateEncoder.d.ts +3 -0
- package/esm/domain/deflate/deflateEncoder.js +107 -0
- package/esm/domain/deflate/deflateEncoder.js.map +1 -0
- package/esm/domain/deflate/deflateWorker.d.ts +29 -0
- package/esm/domain/deflate/deflateWorker.js +97 -0
- package/esm/domain/deflate/deflateWorker.js.map +1 -0
- package/esm/domain/deflate/index.d.ts +3 -0
- package/esm/domain/deflate/index.js +3 -0
- package/esm/domain/deflate/index.js.map +1 -0
- package/esm/domain/getSessionReplayLink.d.ts +2 -0
- package/esm/domain/getSessionReplayLink.js +32 -0
- package/esm/domain/getSessionReplayLink.js.map +1 -0
- package/esm/domain/profiling/actionHistory.d.ts +10 -0
- package/esm/domain/profiling/actionHistory.js +45 -0
- package/esm/domain/profiling/actionHistory.js.map +1 -0
- package/esm/domain/profiling/longTaskHistory.d.ts +11 -0
- package/esm/domain/profiling/longTaskHistory.js +24 -0
- package/esm/domain/profiling/longTaskHistory.js.map +1 -0
- package/esm/domain/profiling/profiler.d.ts +7 -0
- package/esm/domain/profiling/profiler.js +263 -0
- package/esm/domain/profiling/profiler.js.map +1 -0
- package/esm/domain/profiling/profilingContext.d.ts +6 -0
- package/esm/domain/profiling/profilingContext.js +28 -0
- package/esm/domain/profiling/profilingContext.js.map +1 -0
- package/esm/domain/profiling/profilingSupported.d.ts +1 -0
- package/esm/domain/profiling/profilingSupported.js +8 -0
- package/esm/domain/profiling/profilingSupported.js.map +1 -0
- package/esm/domain/profiling/test-utils/mockedTrace.d.ts +3 -0
- package/esm/domain/profiling/test-utils/mockedTrace.js +54 -0
- package/esm/domain/profiling/test-utils/mockedTrace.js.map +1 -0
- package/esm/domain/profiling/transport/assembly.d.ts +7 -0
- package/esm/domain/profiling/transport/assembly.js +42 -0
- package/esm/domain/profiling/transport/assembly.js.map +1 -0
- package/esm/domain/profiling/transport/buildProfileEventAttributes.d.ts +33 -0
- package/esm/domain/profiling/transport/buildProfileEventAttributes.js +60 -0
- package/esm/domain/profiling/transport/buildProfileEventAttributes.js.map +1 -0
- package/esm/domain/profiling/types/index.d.ts +2 -0
- package/esm/domain/profiling/types/index.js +2 -0
- package/esm/domain/profiling/types/index.js.map +1 -0
- package/esm/domain/profiling/types/profilerApi.types.d.ts +58 -0
- package/esm/domain/profiling/types/profilerApi.types.js +4 -0
- package/esm/domain/profiling/types/profilerApi.types.js.map +1 -0
- package/esm/domain/profiling/types/rumProfiler.types.d.ts +55 -0
- package/esm/domain/profiling/types/rumProfiler.types.js +2 -0
- package/esm/domain/profiling/types/rumProfiler.types.js.map +1 -0
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.d.ts +1 -0
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.js +3 -0
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.js.map +1 -0
- package/esm/domain/profiling/utils/getDefaultViewName.d.ts +1 -0
- package/esm/domain/profiling/utils/getDefaultViewName.js +11 -0
- package/esm/domain/profiling/utils/getDefaultViewName.js.map +1 -0
- package/esm/domain/profiling/utils/getNumberOfSamples.d.ts +8 -0
- package/esm/domain/profiling/utils/getNumberOfSamples.js +16 -0
- package/esm/domain/profiling/utils/getNumberOfSamples.js.map +1 -0
- package/esm/domain/profiling/vitalHistory.d.ts +10 -0
- package/esm/domain/profiling/vitalHistory.js +38 -0
- package/esm/domain/profiling/vitalHistory.js.map +1 -0
- package/esm/domain/record/assembly.d.ts +3 -0
- package/esm/domain/record/assembly.js +13 -0
- package/esm/domain/record/assembly.js.map +1 -0
- package/esm/domain/record/elementsScrollPositions.d.ts +10 -0
- package/esm/domain/record/elementsScrollPositions.js +20 -0
- package/esm/domain/record/elementsScrollPositions.js.map +1 -0
- package/esm/domain/record/eventsUtils.d.ts +2 -0
- package/esm/domain/record/eventsUtils.js +11 -0
- package/esm/domain/record/eventsUtils.js.map +1 -0
- package/esm/domain/record/index.d.ts +6 -0
- package/esm/domain/record/index.js +5 -0
- package/esm/domain/record/index.js.map +1 -0
- package/esm/domain/record/internalApi.d.ts +22 -0
- package/esm/domain/record/internalApi.js +51 -0
- package/esm/domain/record/internalApi.js.map +1 -0
- package/esm/domain/record/itemIds.d.ts +40 -0
- package/esm/domain/record/itemIds.js +52 -0
- package/esm/domain/record/itemIds.js.map +1 -0
- package/esm/domain/record/mutationBatch.d.ts +12 -0
- package/esm/domain/record/mutationBatch.js +40 -0
- package/esm/domain/record/mutationBatch.js.map +1 -0
- package/esm/domain/record/record.d.ts +16 -0
- package/esm/domain/record/record.js +52 -0
- package/esm/domain/record/record.js.map +1 -0
- package/esm/domain/record/record.types.d.ts +18 -0
- package/esm/domain/record/record.types.js +2 -0
- package/esm/domain/record/record.types.js.map +1 -0
- package/esm/domain/record/recordingScope.d.ts +24 -0
- package/esm/domain/record/recordingScope.js +26 -0
- package/esm/domain/record/recordingScope.js.map +1 -0
- package/esm/domain/record/serialization/changeEncoder.d.ts +22 -0
- package/esm/domain/record/serialization/changeEncoder.js +56 -0
- package/esm/domain/record/serialization/changeEncoder.js.map +1 -0
- package/esm/domain/record/serialization/conversions/changeConverter.d.ts +10 -0
- package/esm/domain/record/serialization/conversions/changeConverter.js +213 -0
- package/esm/domain/record/serialization/conversions/changeConverter.js.map +1 -0
- package/esm/domain/record/serialization/conversions/changeDecoder.d.ts +16 -0
- package/esm/domain/record/serialization/conversions/changeDecoder.js +134 -0
- package/esm/domain/record/serialization/conversions/changeDecoder.js.map +1 -0
- package/esm/domain/record/serialization/conversions/index.d.ts +7 -0
- package/esm/domain/record/serialization/conversions/index.js +4 -0
- package/esm/domain/record/serialization/conversions/index.js.map +1 -0
- package/esm/domain/record/serialization/conversions/mutationLog.d.ts +15 -0
- package/esm/domain/record/serialization/conversions/mutationLog.js +33 -0
- package/esm/domain/record/serialization/conversions/mutationLog.js.map +1 -0
- package/esm/domain/record/serialization/conversions/nodeIdRemapper.d.ts +10 -0
- package/esm/domain/record/serialization/conversions/nodeIdRemapper.js +49 -0
- package/esm/domain/record/serialization/conversions/nodeIdRemapper.js.map +1 -0
- package/esm/domain/record/serialization/conversions/renderOptions.d.ts +6 -0
- package/esm/domain/record/serialization/conversions/renderOptions.js +9 -0
- package/esm/domain/record/serialization/conversions/renderOptions.js.map +1 -0
- package/esm/domain/record/serialization/conversions/stringTable.d.ts +5 -0
- package/esm/domain/record/serialization/conversions/stringTable.js +19 -0
- package/esm/domain/record/serialization/conversions/stringTable.js.map +1 -0
- package/esm/domain/record/serialization/conversions/vDocument.d.ts +23 -0
- package/esm/domain/record/serialization/conversions/vDocument.js +173 -0
- package/esm/domain/record/serialization/conversions/vDocument.js.map +1 -0
- package/esm/domain/record/serialization/conversions/vNode.d.ts +66 -0
- package/esm/domain/record/serialization/conversions/vNode.js +282 -0
- package/esm/domain/record/serialization/conversions/vNode.js.map +1 -0
- package/esm/domain/record/serialization/conversions/vStyleSheet.d.ts +16 -0
- package/esm/domain/record/serialization/conversions/vStyleSheet.js +26 -0
- package/esm/domain/record/serialization/conversions/vStyleSheet.js.map +1 -0
- package/esm/domain/record/serialization/experimentalFeatures.d.ts +2 -0
- package/esm/domain/record/serialization/experimentalFeatures.js +12 -0
- package/esm/domain/record/serialization/experimentalFeatures.js.map +1 -0
- package/esm/domain/record/serialization/index.d.ts +17 -0
- package/esm/domain/record/serialization/index.js +14 -0
- package/esm/domain/record/serialization/index.js.map +1 -0
- package/esm/domain/record/serialization/insertionCursor.d.ts +57 -0
- package/esm/domain/record/serialization/insertionCursor.js +64 -0
- package/esm/domain/record/serialization/insertionCursor.js.map +1 -0
- package/esm/domain/record/serialization/serialization.types.d.ts +24 -0
- package/esm/domain/record/serialization/serialization.types.js +2 -0
- package/esm/domain/record/serialization/serialization.types.js.map +1 -0
- package/esm/domain/record/serialization/serializationStats.d.ts +12 -0
- package/esm/domain/record/serialization/serializationStats.js +27 -0
- package/esm/domain/record/serialization/serializationStats.js.map +1 -0
- package/esm/domain/record/serialization/serializationTransaction.d.ts +96 -0
- package/esm/domain/record/serialization/serializationTransaction.js +99 -0
- package/esm/domain/record/serialization/serializationTransaction.js.map +1 -0
- package/esm/domain/record/serialization/serializationUtils.d.ts +18 -0
- package/esm/domain/record/serialization/serializationUtils.js +80 -0
- package/esm/domain/record/serialization/serializationUtils.js.map +1 -0
- package/esm/domain/record/serialization/serializeAttribute.d.ts +4 -0
- package/esm/domain/record/serialization/serializeAttribute.js +38 -0
- package/esm/domain/record/serialization/serializeAttribute.js.map +1 -0
- package/esm/domain/record/serialization/serializeAttributes.d.ts +7 -0
- package/esm/domain/record/serialization/serializeAttributes.js +161 -0
- package/esm/domain/record/serialization/serializeAttributes.js.map +1 -0
- package/esm/domain/record/serialization/serializeFullSnapshot.d.ts +5 -0
- package/esm/domain/record/serialization/serializeFullSnapshot.js +31 -0
- package/esm/domain/record/serialization/serializeFullSnapshot.js.map +1 -0
- package/esm/domain/record/serialization/serializeFullSnapshotAsChange.d.ts +5 -0
- package/esm/domain/record/serialization/serializeFullSnapshotAsChange.js +10 -0
- package/esm/domain/record/serialization/serializeFullSnapshotAsChange.js.map +1 -0
- package/esm/domain/record/serialization/serializeMutations.d.ts +11 -0
- package/esm/domain/record/serialization/serializeMutations.js +257 -0
- package/esm/domain/record/serialization/serializeMutations.js.map +1 -0
- package/esm/domain/record/serialization/serializeMutationsAsChange.d.ts +5 -0
- package/esm/domain/record/serialization/serializeMutationsAsChange.js +201 -0
- package/esm/domain/record/serialization/serializeMutationsAsChange.js.map +1 -0
- package/esm/domain/record/serialization/serializeNode.d.ts +7 -0
- package/esm/domain/record/serialization/serializeNode.js +149 -0
- package/esm/domain/record/serialization/serializeNode.js.map +1 -0
- package/esm/domain/record/serialization/serializeNodeAsChange.d.ts +4 -0
- package/esm/domain/record/serialization/serializeNodeAsChange.js +150 -0
- package/esm/domain/record/serialization/serializeNodeAsChange.js.map +1 -0
- package/esm/domain/record/serialization/serializeStyleSheets.d.ts +3 -0
- package/esm/domain/record/serialization/serializeStyleSheets.js +27 -0
- package/esm/domain/record/serialization/serializeStyleSheets.js.map +1 -0
- package/esm/domain/record/serializationVerifier.d.ts +18 -0
- package/esm/domain/record/serializationVerifier.js +123 -0
- package/esm/domain/record/serializationVerifier.js.map +1 -0
- package/esm/domain/record/shadowRootsController.d.ts +11 -0
- package/esm/domain/record/shadowRootsController.js +41 -0
- package/esm/domain/record/shadowRootsController.js.map +1 -0
- package/esm/domain/record/startFullSnapshots.d.ts +10 -0
- package/esm/domain/record/startFullSnapshots.js +46 -0
- package/esm/domain/record/startFullSnapshots.js.map +1 -0
- package/esm/domain/record/trackers/index.d.ts +12 -0
- package/esm/domain/record/trackers/index.js +12 -0
- package/esm/domain/record/trackers/index.js.map +1 -0
- package/esm/domain/record/trackers/trackFocus.d.ts +5 -0
- package/esm/domain/record/trackers/trackFocus.js +12 -0
- package/esm/domain/record/trackers/trackFocus.js.map +1 -0
- package/esm/domain/record/trackers/trackFrustration.d.ts +6 -0
- package/esm/domain/record/trackers/trackFrustration.js +28 -0
- package/esm/domain/record/trackers/trackFrustration.js.map +1 -0
- package/esm/domain/record/trackers/trackInput.d.ts +4 -0
- package/esm/domain/record/trackers/trackInput.js +101 -0
- package/esm/domain/record/trackers/trackInput.js.map +1 -0
- package/esm/domain/record/trackers/trackMediaInteraction.d.ts +5 -0
- package/esm/domain/record/trackers/trackMediaInteraction.js +26 -0
- package/esm/domain/record/trackers/trackMediaInteraction.js.map +1 -0
- package/esm/domain/record/trackers/trackMouseInteraction.d.ts +5 -0
- package/esm/domain/record/trackers/trackMouseInteraction.js +56 -0
- package/esm/domain/record/trackers/trackMouseInteraction.js.map +1 -0
- package/esm/domain/record/trackers/trackMove.d.ts +9 -0
- package/esm/domain/record/trackers/trackMove.js +51 -0
- package/esm/domain/record/trackers/trackMove.js.map +1 -0
- package/esm/domain/record/trackers/trackMutation.d.ts +13 -0
- package/esm/domain/record/trackers/trackMutation.js +38 -0
- package/esm/domain/record/trackers/trackMutation.js.map +1 -0
- package/esm/domain/record/trackers/trackScroll.d.ts +5 -0
- package/esm/domain/record/trackers/trackScroll.js +45 -0
- package/esm/domain/record/trackers/trackScroll.js.map +1 -0
- package/esm/domain/record/trackers/trackStyleSheet.d.ts +6 -0
- package/esm/domain/record/trackers/trackStyleSheet.js +85 -0
- package/esm/domain/record/trackers/trackStyleSheet.js.map +1 -0
- package/esm/domain/record/trackers/trackViewEnd.d.ts +5 -0
- package/esm/domain/record/trackers/trackViewEnd.js +17 -0
- package/esm/domain/record/trackers/trackViewEnd.js.map +1 -0
- package/esm/domain/record/trackers/trackViewportResize.d.ts +6 -0
- package/esm/domain/record/trackers/trackViewportResize.js +42 -0
- package/esm/domain/record/trackers/trackViewportResize.js.map +1 -0
- package/esm/domain/record/trackers/tracker.types.d.ts +3 -0
- package/esm/domain/record/trackers/tracker.types.js +2 -0
- package/esm/domain/record/trackers/tracker.types.js.map +1 -0
- package/esm/domain/record/viewports.d.ts +20 -0
- package/esm/domain/record/viewports.js +55 -0
- package/esm/domain/record/viewports.js.map +1 -0
- package/esm/domain/replayStats.d.ts +8 -0
- package/esm/domain/replayStats.js +51 -0
- package/esm/domain/replayStats.js.map +1 -0
- package/esm/domain/scriptLoadingError.d.ts +6 -0
- package/esm/domain/scriptLoadingError.js +23 -0
- package/esm/domain/scriptLoadingError.js.map +1 -0
- package/esm/domain/segmentCollection/buildReplayPayload.d.ts +15 -0
- package/esm/domain/segmentCollection/buildReplayPayload.js +23 -0
- package/esm/domain/segmentCollection/buildReplayPayload.js.map +1 -0
- package/esm/domain/segmentCollection/index.d.ts +4 -0
- package/esm/domain/segmentCollection/index.js +4 -0
- package/esm/domain/segmentCollection/index.js.map +1 -0
- package/esm/domain/segmentCollection/segment.d.ts +16 -0
- package/esm/domain/segmentCollection/segment.js +46 -0
- package/esm/domain/segmentCollection/segment.js.map +1 -0
- package/esm/domain/segmentCollection/segmentCollection.d.ts +31 -0
- package/esm/domain/segmentCollection/segmentCollection.js +106 -0
- package/esm/domain/segmentCollection/segmentCollection.js.map +1 -0
- package/esm/domain/segmentCollection/startSegmentTelemetry.d.ts +6 -0
- package/esm/domain/segmentCollection/startSegmentTelemetry.js +49 -0
- package/esm/domain/segmentCollection/startSegmentTelemetry.js.map +1 -0
- package/esm/domain/startRecordBridge.d.ts +5 -0
- package/esm/domain/startRecordBridge.js +14 -0
- package/esm/domain/startRecordBridge.js.map +1 -0
- package/esm/domain/startRecorderInitTelemetry.d.ts +15 -0
- package/esm/domain/startRecorderInitTelemetry.js +52 -0
- package/esm/domain/startRecorderInitTelemetry.js.map +1 -0
- package/esm/entries/internal.d.ts +11 -0
- package/esm/entries/internal.js +4 -0
- package/esm/entries/internal.js.map +1 -0
- package/esm/entries/internalSynthetics.d.ts +2 -0
- package/esm/entries/internalSynthetics.js +23 -0
- package/esm/entries/internalSynthetics.js.map +1 -0
- package/esm/entries/main.d.ts +23 -0
- package/esm/entries/main.js +31 -0
- package/esm/entries/main.js.map +1 -0
- package/esm/types/index.d.ts +3 -0
- package/esm/types/index.js +2 -0
- package/esm/types/index.js.map +1 -0
- package/esm/types/profiling.d.ts +296 -0
- package/esm/types/profiling.js +5 -0
- package/esm/types/profiling.js.map +1 -0
- package/esm/types/sessionReplay.d.ts +934 -0
- package/esm/types/sessionReplay.js +5 -0
- package/esm/types/sessionReplay.js.map +1 -0
- package/esm/types/sessionReplayConstants.d.ts +71 -0
- package/esm/types/sessionReplayConstants.js +64 -0
- package/esm/types/sessionReplayConstants.js.map +1 -0
- package/internal/package.json +6 -0
- package/internal-synthetics/package.json +6 -0
- package/package.json +52 -0
- package/src/boot/isBrowserSupported.ts +14 -0
- package/src/boot/lazyLoadProfiler.ts +20 -0
- package/src/boot/lazyLoadRecorder.ts +20 -0
- package/src/boot/postStartStrategy.ts +176 -0
- package/src/boot/preStartStrategy.ts +34 -0
- package/src/boot/profilerApi.ts +82 -0
- package/src/boot/recorderApi.ts +113 -0
- package/src/boot/startRecording.ts +70 -0
- package/src/domain/deflate/deflateEncoder.ts +144 -0
- package/src/domain/deflate/deflateWorker.ts +152 -0
- package/src/domain/deflate/index.ts +9 -0
- package/src/domain/getSessionReplayLink.ts +40 -0
- package/src/domain/profiling/actionHistory.ts +65 -0
- package/src/domain/profiling/longTaskHistory.ts +40 -0
- package/src/domain/profiling/profiler.ts +366 -0
- package/src/domain/profiling/profilingContext.ts +39 -0
- package/src/domain/profiling/profilingSupported.ts +10 -0
- package/src/domain/profiling/test-utils/mockedTrace.ts +58 -0
- package/src/domain/profiling/transport/assembly.ts +63 -0
- package/src/domain/profiling/transport/buildProfileEventAttributes.ts +106 -0
- package/src/domain/profiling/types/index.ts +2 -0
- package/src/domain/profiling/types/profilerApi.types.ts +87 -0
- package/src/domain/profiling/types/rumProfiler.types.ts +62 -0
- package/src/domain/profiling/utils/getCustomOrDefaultViewName.ts +4 -0
- package/src/domain/profiling/utils/getDefaultViewName.ts +12 -0
- package/src/domain/profiling/utils/getNumberOfSamples.ts +17 -0
- package/src/domain/profiling/vitalHistory.ts +58 -0
- package/src/domain/record/assembly.ts +19 -0
- package/src/domain/record/elementsScrollPositions.ts +28 -0
- package/src/domain/record/eventsUtils.ts +12 -0
- package/src/domain/record/index.ts +12 -0
- package/src/domain/record/internalApi.ts +84 -0
- package/src/domain/record/itemIds.ts +97 -0
- package/src/domain/record/mutationBatch.ts +47 -0
- package/src/domain/record/record.ts +90 -0
- package/src/domain/record/record.types.ts +22 -0
- package/src/domain/record/recordingScope.ts +58 -0
- package/src/domain/record/serialization/changeEncoder.ts +89 -0
- package/src/domain/record/serialization/conversions/changeConverter.ts +277 -0
- package/src/domain/record/serialization/conversions/changeDecoder.ts +192 -0
- package/src/domain/record/serialization/conversions/index.ts +7 -0
- package/src/domain/record/serialization/conversions/mutationLog.ts +56 -0
- package/src/domain/record/serialization/conversions/nodeIdRemapper.ts +69 -0
- package/src/domain/record/serialization/conversions/renderOptions.ts +14 -0
- package/src/domain/record/serialization/conversions/stringTable.ts +25 -0
- package/src/domain/record/serialization/conversions/vDocument.ts +239 -0
- package/src/domain/record/serialization/conversions/vNode.ts +417 -0
- package/src/domain/record/serialization/conversions/vStyleSheet.ts +47 -0
- package/src/domain/record/serialization/experimentalFeatures.ts +15 -0
- package/src/domain/record/serialization/index.ts +21 -0
- package/src/domain/record/serialization/insertionCursor.ts +131 -0
- package/src/domain/record/serialization/serialization.types.ts +38 -0
- package/src/domain/record/serialization/serializationStats.ts +43 -0
- package/src/domain/record/serialization/serializationTransaction.ts +255 -0
- package/src/domain/record/serialization/serializationUtils.ts +103 -0
- package/src/domain/record/serialization/serializeAttribute.ts +55 -0
- package/src/domain/record/serialization/serializeAttributes.ts +194 -0
- package/src/domain/record/serialization/serializeFullSnapshot.ts +46 -0
- package/src/domain/record/serialization/serializeFullSnapshotAsChange.ts +33 -0
- package/src/domain/record/serialization/serializeMutations.ts +395 -0
- package/src/domain/record/serialization/serializeMutationsAsChange.ts +298 -0
- package/src/domain/record/serialization/serializeNode.ts +229 -0
- package/src/domain/record/serialization/serializeNodeAsChange.ts +237 -0
- package/src/domain/record/serialization/serializeStyleSheets.ts +36 -0
- package/src/domain/record/serializationVerifier.ts +208 -0
- package/src/domain/record/shadowRootsController.ts +62 -0
- package/src/domain/record/startFullSnapshots.ts +92 -0
- package/src/domain/record/trackers/index.ts +12 -0
- package/src/domain/record/trackers/trackFocus.ts +16 -0
- package/src/domain/record/trackers/trackFrustration.ts +39 -0
- package/src/domain/record/trackers/trackInput.ts +128 -0
- package/src/domain/record/trackers/trackMediaInteraction.ts +43 -0
- package/src/domain/record/trackers/trackMouseInteraction.ts +74 -0
- package/src/domain/record/trackers/trackMove.ts +78 -0
- package/src/domain/record/trackers/trackMutation.ts +74 -0
- package/src/domain/record/trackers/trackScroll.ts +61 -0
- package/src/domain/record/trackers/trackStyleSheet.ts +117 -0
- package/src/domain/record/trackers/trackViewEnd.ts +27 -0
- package/src/domain/record/trackers/trackViewportResize.ts +69 -0
- package/src/domain/record/trackers/tracker.types.ts +3 -0
- package/src/domain/record/viewports.ts +68 -0
- package/src/domain/replayStats.ts +61 -0
- package/src/domain/scriptLoadingError.ts +36 -0
- package/src/domain/segmentCollection/buildReplayPayload.ts +52 -0
- package/src/domain/segmentCollection/index.ts +4 -0
- package/src/domain/segmentCollection/segment.ts +79 -0
- package/src/domain/segmentCollection/segmentCollection.ts +200 -0
- package/src/domain/segmentCollection/startSegmentTelemetry.ts +91 -0
- package/src/domain/startRecordBridge.ts +17 -0
- package/src/domain/startRecorderInitTelemetry.ts +90 -0
- package/src/entries/internal.ts +18 -0
- package/src/entries/internalSynthetics.ts +24 -0
- package/src/entries/main.ts +96 -0
- package/src/types/index.ts +3 -0
- package/src/types/profiling.ts +298 -0
- package/src/types/sessionReplay.ts +990 -0
- package/src/types/sessionReplayConstants.ts +130 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { RawError, HttpRequest, DeflateEncoder, Telemetry } from '@datadog/browser-core'
|
|
2
|
+
import { createHttpRequest, addTelemetryDebug, canUseEventBridge, noop } from '@datadog/browser-core'
|
|
3
|
+
import type { LifeCycle, ViewHistory, RumConfiguration, RumSessionManager } from '@datadog/browser-rum-core'
|
|
4
|
+
import { LifeCycleEventType } from '@datadog/browser-rum-core'
|
|
5
|
+
|
|
6
|
+
import type { SerializationStats } from '../domain/record'
|
|
7
|
+
import { record } from '../domain/record'
|
|
8
|
+
import type { ReplayPayload } from '../domain/segmentCollection'
|
|
9
|
+
import { startSegmentCollection, SEGMENT_BYTES_LIMIT, startSegmentTelemetry } from '../domain/segmentCollection'
|
|
10
|
+
import type { BrowserRecord } from '../types'
|
|
11
|
+
import { startRecordBridge } from '../domain/startRecordBridge'
|
|
12
|
+
|
|
13
|
+
export function startRecording(
|
|
14
|
+
lifeCycle: LifeCycle,
|
|
15
|
+
configuration: RumConfiguration,
|
|
16
|
+
sessionManager: RumSessionManager,
|
|
17
|
+
viewHistory: ViewHistory,
|
|
18
|
+
encoder: DeflateEncoder,
|
|
19
|
+
telemetry: Telemetry,
|
|
20
|
+
httpRequest?: HttpRequest<ReplayPayload>
|
|
21
|
+
) {
|
|
22
|
+
const cleanupTasks: Array<() => void> = []
|
|
23
|
+
|
|
24
|
+
const reportError = (error: RawError) => {
|
|
25
|
+
lifeCycle.notify(LifeCycleEventType.RAW_ERROR_COLLECTED, { error })
|
|
26
|
+
// monitor-until: forever, to keep an eye on the errors reported to customers
|
|
27
|
+
addTelemetryDebug('Error reported to customer', { 'error.message': error.message })
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const replayRequest =
|
|
31
|
+
httpRequest || createHttpRequest([configuration.sessionReplayEndpointBuilder], reportError, SEGMENT_BYTES_LIMIT)
|
|
32
|
+
|
|
33
|
+
let addRecord: (record: BrowserRecord) => void
|
|
34
|
+
let addStats: (stats: SerializationStats) => void
|
|
35
|
+
|
|
36
|
+
if (!canUseEventBridge()) {
|
|
37
|
+
const segmentCollection = startSegmentCollection(
|
|
38
|
+
lifeCycle,
|
|
39
|
+
configuration,
|
|
40
|
+
sessionManager,
|
|
41
|
+
viewHistory,
|
|
42
|
+
replayRequest,
|
|
43
|
+
encoder
|
|
44
|
+
)
|
|
45
|
+
addRecord = segmentCollection.addRecord
|
|
46
|
+
addStats = segmentCollection.addStats
|
|
47
|
+
cleanupTasks.push(segmentCollection.stop)
|
|
48
|
+
|
|
49
|
+
const segmentTelemetry = startSegmentTelemetry(telemetry, replayRequest.observable)
|
|
50
|
+
cleanupTasks.push(segmentTelemetry.stop)
|
|
51
|
+
} else {
|
|
52
|
+
;({ addRecord } = startRecordBridge(viewHistory))
|
|
53
|
+
addStats = noop
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const { stop: stopRecording } = record({
|
|
57
|
+
emitRecord: addRecord,
|
|
58
|
+
emitStats: addStats,
|
|
59
|
+
configuration,
|
|
60
|
+
lifeCycle,
|
|
61
|
+
viewHistory,
|
|
62
|
+
})
|
|
63
|
+
cleanupTasks.push(stopRecording)
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
stop: () => {
|
|
67
|
+
cleanupTasks.forEach((task) => task())
|
|
68
|
+
},
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
DeflateWorkerResponse,
|
|
3
|
+
DeflateEncoder,
|
|
4
|
+
DeflateEncoderStreamId,
|
|
5
|
+
DeflateWorker,
|
|
6
|
+
EncoderResult,
|
|
7
|
+
Uint8ArrayBuffer,
|
|
8
|
+
} from '@datadog/browser-core'
|
|
9
|
+
import { addEventListener, concatBuffers } from '@datadog/browser-core'
|
|
10
|
+
import type { RumConfiguration } from '@datadog/browser-rum-core'
|
|
11
|
+
|
|
12
|
+
export function createDeflateEncoder(
|
|
13
|
+
configuration: RumConfiguration,
|
|
14
|
+
worker: DeflateWorker,
|
|
15
|
+
streamId: DeflateEncoderStreamId
|
|
16
|
+
): DeflateEncoder {
|
|
17
|
+
let rawBytesCount = 0
|
|
18
|
+
let compressedData: Uint8ArrayBuffer[] = []
|
|
19
|
+
let compressedDataTrailer: Uint8ArrayBuffer
|
|
20
|
+
|
|
21
|
+
let isEmpty = true
|
|
22
|
+
let nextWriteActionId = 0
|
|
23
|
+
const pendingWriteActions: Array<{
|
|
24
|
+
writeCallback?: (additionalEncodedBytesCount: number) => void
|
|
25
|
+
finishCallback?: () => void
|
|
26
|
+
id: number
|
|
27
|
+
data: string
|
|
28
|
+
}> = []
|
|
29
|
+
|
|
30
|
+
const { stop: removeMessageListener } = addEventListener(
|
|
31
|
+
configuration,
|
|
32
|
+
worker,
|
|
33
|
+
'message',
|
|
34
|
+
({ data: workerResponse }: MessageEvent<DeflateWorkerResponse>) => {
|
|
35
|
+
if (workerResponse.type !== 'wrote' || (workerResponse.streamId as DeflateEncoderStreamId) !== streamId) {
|
|
36
|
+
return
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const nextPendingAction = pendingWriteActions[0]
|
|
40
|
+
if (nextPendingAction) {
|
|
41
|
+
if (nextPendingAction.id === workerResponse.id) {
|
|
42
|
+
pendingWriteActions.shift()
|
|
43
|
+
|
|
44
|
+
rawBytesCount += workerResponse.additionalBytesCount
|
|
45
|
+
compressedData.push(workerResponse.result)
|
|
46
|
+
compressedDataTrailer = workerResponse.trailer
|
|
47
|
+
|
|
48
|
+
if (nextPendingAction.writeCallback) {
|
|
49
|
+
nextPendingAction.writeCallback(workerResponse.result.byteLength)
|
|
50
|
+
} else if (nextPendingAction.finishCallback) {
|
|
51
|
+
nextPendingAction.finishCallback()
|
|
52
|
+
}
|
|
53
|
+
} else if (nextPendingAction.id < workerResponse.id) {
|
|
54
|
+
// Worker responses received out of order
|
|
55
|
+
removeMessageListener()
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
function consumeResult(): EncoderResult<Uint8ArrayBuffer> {
|
|
62
|
+
const output =
|
|
63
|
+
compressedData.length === 0 ? new Uint8Array(0) : concatBuffers(compressedData.concat(compressedDataTrailer))
|
|
64
|
+
const result: EncoderResult<Uint8ArrayBuffer> = {
|
|
65
|
+
rawBytesCount,
|
|
66
|
+
output,
|
|
67
|
+
outputBytesCount: output.byteLength,
|
|
68
|
+
encoding: 'deflate',
|
|
69
|
+
}
|
|
70
|
+
rawBytesCount = 0
|
|
71
|
+
compressedData = []
|
|
72
|
+
return result
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function sendResetIfNeeded() {
|
|
76
|
+
if (!isEmpty) {
|
|
77
|
+
worker.postMessage({
|
|
78
|
+
action: 'reset',
|
|
79
|
+
streamId,
|
|
80
|
+
})
|
|
81
|
+
isEmpty = true
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
isAsync: true,
|
|
87
|
+
|
|
88
|
+
get isEmpty() {
|
|
89
|
+
return isEmpty
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
write(data, callback) {
|
|
93
|
+
worker.postMessage({
|
|
94
|
+
action: 'write',
|
|
95
|
+
id: nextWriteActionId,
|
|
96
|
+
data,
|
|
97
|
+
streamId,
|
|
98
|
+
})
|
|
99
|
+
pendingWriteActions.push({
|
|
100
|
+
id: nextWriteActionId,
|
|
101
|
+
writeCallback: callback,
|
|
102
|
+
data,
|
|
103
|
+
})
|
|
104
|
+
isEmpty = false
|
|
105
|
+
nextWriteActionId += 1
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
finish(callback) {
|
|
109
|
+
sendResetIfNeeded()
|
|
110
|
+
|
|
111
|
+
if (!pendingWriteActions.length) {
|
|
112
|
+
callback(consumeResult())
|
|
113
|
+
} else {
|
|
114
|
+
// Make sure we do not call any write callback
|
|
115
|
+
pendingWriteActions.forEach((pendingWriteAction) => {
|
|
116
|
+
delete pendingWriteAction.writeCallback
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
// Wait for the last action to finish before calling the finish callback
|
|
120
|
+
pendingWriteActions[pendingWriteActions.length - 1].finishCallback = () => callback(consumeResult())
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
finishSync() {
|
|
125
|
+
sendResetIfNeeded()
|
|
126
|
+
const pendingData = pendingWriteActions.map((pendingWriteAction) => pendingWriteAction.data).join('')
|
|
127
|
+
// Ignore all pending write actions responses from the worker
|
|
128
|
+
pendingWriteActions.length = 0
|
|
129
|
+
return { ...consumeResult(), pendingData }
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
estimateEncodedBytesCount(data) {
|
|
133
|
+
// This is a rough estimation of the data size once it'll be encoded by deflate. We observed
|
|
134
|
+
// that if it's the first chunk of data pushed to the stream, the ratio is lower (3-4), but
|
|
135
|
+
// after that the ratio is greater (10+). We chose 8 here, which (on average) seems to produce
|
|
136
|
+
// requests of the expected size.
|
|
137
|
+
return data.length / 8
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
stop() {
|
|
141
|
+
removeMessageListener()
|
|
142
|
+
},
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import type { DeflateWorker, DeflateWorkerResponse } from '@datadog/browser-core'
|
|
2
|
+
import { addTelemetryError, display, addEventListener, setTimeout, ONE_SECOND, mockable } from '@datadog/browser-core'
|
|
3
|
+
import type { RumConfiguration } from '@datadog/browser-rum-core'
|
|
4
|
+
import { reportScriptLoadingError } from '../scriptLoadingError'
|
|
5
|
+
|
|
6
|
+
export const INITIALIZATION_TIME_OUT_DELAY = 30 * ONE_SECOND
|
|
7
|
+
|
|
8
|
+
declare const __BUILD_ENV__WORKER_STRING__: string
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* In order to be sure that the worker is correctly working, we need a round trip of
|
|
12
|
+
* initialization messages, making the creation asynchronous.
|
|
13
|
+
* These worker lifecycle states handle this case.
|
|
14
|
+
*/
|
|
15
|
+
export const enum DeflateWorkerStatus {
|
|
16
|
+
Nil,
|
|
17
|
+
Loading,
|
|
18
|
+
Error,
|
|
19
|
+
Initialized,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type DeflateWorkerState =
|
|
23
|
+
| {
|
|
24
|
+
status: DeflateWorkerStatus.Nil
|
|
25
|
+
}
|
|
26
|
+
| {
|
|
27
|
+
status: DeflateWorkerStatus.Loading
|
|
28
|
+
worker: DeflateWorker
|
|
29
|
+
stop: () => void
|
|
30
|
+
initializationFailureCallbacks: Array<() => void>
|
|
31
|
+
}
|
|
32
|
+
| {
|
|
33
|
+
status: DeflateWorkerStatus.Error
|
|
34
|
+
}
|
|
35
|
+
| {
|
|
36
|
+
status: DeflateWorkerStatus.Initialized
|
|
37
|
+
worker: DeflateWorker
|
|
38
|
+
stop: () => void
|
|
39
|
+
version: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type CreateDeflateWorker = typeof createDeflateWorker
|
|
43
|
+
|
|
44
|
+
export function createDeflateWorker(configuration: RumConfiguration): DeflateWorker {
|
|
45
|
+
return new Worker(configuration.workerUrl || URL.createObjectURL(new Blob([__BUILD_ENV__WORKER_STRING__])))
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
let state: DeflateWorkerState = { status: DeflateWorkerStatus.Nil }
|
|
49
|
+
|
|
50
|
+
export function startDeflateWorker(
|
|
51
|
+
configuration: RumConfiguration,
|
|
52
|
+
source: string,
|
|
53
|
+
onInitializationFailure: () => void
|
|
54
|
+
) {
|
|
55
|
+
if (state.status === DeflateWorkerStatus.Nil) {
|
|
56
|
+
// doStartDeflateWorker updates the state to "loading" or "error"
|
|
57
|
+
doStartDeflateWorker(configuration, source)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
switch (state.status) {
|
|
61
|
+
case DeflateWorkerStatus.Loading:
|
|
62
|
+
state.initializationFailureCallbacks.push(onInitializationFailure)
|
|
63
|
+
return state.worker
|
|
64
|
+
case DeflateWorkerStatus.Initialized:
|
|
65
|
+
return state.worker
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function resetDeflateWorkerState() {
|
|
70
|
+
if (state.status === DeflateWorkerStatus.Initialized || state.status === DeflateWorkerStatus.Loading) {
|
|
71
|
+
state.stop()
|
|
72
|
+
}
|
|
73
|
+
state = { status: DeflateWorkerStatus.Nil }
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function getDeflateWorkerStatus() {
|
|
77
|
+
return state.status
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Starts the deflate worker and handle messages and errors
|
|
82
|
+
*
|
|
83
|
+
* The spec allow browsers to handle worker errors differently:
|
|
84
|
+
* - Chromium throws an exception
|
|
85
|
+
* - Firefox fires an error event
|
|
86
|
+
*
|
|
87
|
+
* more details: https://bugzilla.mozilla.org/show_bug.cgi?id=1736865#c2
|
|
88
|
+
*/
|
|
89
|
+
export function doStartDeflateWorker(configuration: RumConfiguration, source: string) {
|
|
90
|
+
try {
|
|
91
|
+
const worker = mockable(createDeflateWorker)(configuration)
|
|
92
|
+
const { stop: removeErrorListener } = addEventListener(configuration, worker, 'error', (error) => {
|
|
93
|
+
onError(configuration, source, error)
|
|
94
|
+
})
|
|
95
|
+
const { stop: removeMessageListener } = addEventListener(
|
|
96
|
+
configuration,
|
|
97
|
+
worker,
|
|
98
|
+
'message',
|
|
99
|
+
({ data }: MessageEvent<DeflateWorkerResponse>) => {
|
|
100
|
+
if (data.type === 'errored') {
|
|
101
|
+
onError(configuration, source, data.error, data.streamId)
|
|
102
|
+
} else if (data.type === 'initialized') {
|
|
103
|
+
onInitialized(data.version)
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
worker.postMessage({ action: 'init' })
|
|
108
|
+
setTimeout(() => onTimeout(source), INITIALIZATION_TIME_OUT_DELAY)
|
|
109
|
+
const stop = () => {
|
|
110
|
+
removeErrorListener()
|
|
111
|
+
removeMessageListener()
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
state = { status: DeflateWorkerStatus.Loading, worker, stop, initializationFailureCallbacks: [] }
|
|
115
|
+
} catch (error) {
|
|
116
|
+
onError(configuration, source, error)
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function onTimeout(source: string) {
|
|
121
|
+
if (state.status === DeflateWorkerStatus.Loading) {
|
|
122
|
+
display.error(`${source} failed to start: a timeout occurred while initializing the Worker`)
|
|
123
|
+
state.initializationFailureCallbacks.forEach((callback) => callback())
|
|
124
|
+
state = { status: DeflateWorkerStatus.Error }
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function onInitialized(version: string) {
|
|
129
|
+
if (state.status === DeflateWorkerStatus.Loading) {
|
|
130
|
+
state = { status: DeflateWorkerStatus.Initialized, worker: state.worker, stop: state.stop, version }
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function onError(configuration: RumConfiguration, source: string, error: unknown, streamId?: number) {
|
|
135
|
+
if (state.status === DeflateWorkerStatus.Loading || state.status === DeflateWorkerStatus.Nil) {
|
|
136
|
+
reportScriptLoadingError({
|
|
137
|
+
configuredUrl: configuration.workerUrl,
|
|
138
|
+
error,
|
|
139
|
+
source,
|
|
140
|
+
scriptType: 'worker',
|
|
141
|
+
})
|
|
142
|
+
if (state.status === DeflateWorkerStatus.Loading) {
|
|
143
|
+
state.initializationFailureCallbacks.forEach((callback) => callback())
|
|
144
|
+
}
|
|
145
|
+
state = { status: DeflateWorkerStatus.Error }
|
|
146
|
+
} else {
|
|
147
|
+
addTelemetryError(error, {
|
|
148
|
+
worker_version: state.status === DeflateWorkerStatus.Initialized && state.version,
|
|
149
|
+
stream_id: streamId,
|
|
150
|
+
})
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { createDeflateEncoder } from './deflateEncoder'
|
|
2
|
+
export type { CreateDeflateWorker } from './deflateWorker'
|
|
3
|
+
export {
|
|
4
|
+
startDeflateWorker,
|
|
5
|
+
DeflateWorkerStatus,
|
|
6
|
+
getDeflateWorkerStatus,
|
|
7
|
+
resetDeflateWorkerState,
|
|
8
|
+
createDeflateWorker,
|
|
9
|
+
} from './deflateWorker'
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { RumConfiguration, RumSessionManager, ViewHistory, RumSession } from '@datadog/browser-rum-core'
|
|
2
|
+
import { getSessionReplayUrl, SessionReplayState } from '@datadog/browser-rum-core'
|
|
3
|
+
import { isBrowserSupported } from '../boot/isBrowserSupported'
|
|
4
|
+
|
|
5
|
+
export function getSessionReplayLink(
|
|
6
|
+
configuration: RumConfiguration,
|
|
7
|
+
sessionManager: RumSessionManager,
|
|
8
|
+
viewHistory: ViewHistory,
|
|
9
|
+
isRecordingStarted: boolean
|
|
10
|
+
): string | undefined {
|
|
11
|
+
const session = sessionManager.findTrackedSession()
|
|
12
|
+
const errorType = getErrorType(session, isRecordingStarted)
|
|
13
|
+
const viewContext = viewHistory.findView()
|
|
14
|
+
|
|
15
|
+
return getSessionReplayUrl(configuration, {
|
|
16
|
+
viewContext,
|
|
17
|
+
errorType,
|
|
18
|
+
session,
|
|
19
|
+
})
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function getErrorType(session: RumSession | undefined, isRecordingStarted: boolean) {
|
|
23
|
+
if (!isBrowserSupported()) {
|
|
24
|
+
return 'browser-not-supported'
|
|
25
|
+
}
|
|
26
|
+
if (!session) {
|
|
27
|
+
// possibilities:
|
|
28
|
+
// - rum sampled out
|
|
29
|
+
// - session expired (edge case)
|
|
30
|
+
return 'rum-not-tracked'
|
|
31
|
+
}
|
|
32
|
+
if (session.sessionReplay === SessionReplayState.OFF) {
|
|
33
|
+
// possibilities
|
|
34
|
+
// - replay sampled out
|
|
35
|
+
return 'incorrect-session-plan'
|
|
36
|
+
}
|
|
37
|
+
if (!isRecordingStarted) {
|
|
38
|
+
return 'replay-not-started'
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { ClocksState, Duration } from '@datadog/browser-core'
|
|
2
|
+
import { addDuration, createValueHistory, SESSION_TIME_OUT_DELAY } from '@datadog/browser-core'
|
|
3
|
+
import type { LifeCycle } from '@datadog/browser-rum-core'
|
|
4
|
+
import { LifeCycleEventType } from '@datadog/browser-rum-core'
|
|
5
|
+
|
|
6
|
+
export const ACTION_ID_HISTORY_TIME_OUT_DELAY = SESSION_TIME_OUT_DELAY
|
|
7
|
+
|
|
8
|
+
export interface ActionContext {
|
|
9
|
+
id: string
|
|
10
|
+
label: string
|
|
11
|
+
duration?: Duration
|
|
12
|
+
startClocks: ClocksState
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function createActionHistory(lifeCycle: LifeCycle) {
|
|
16
|
+
const history = createValueHistory<ActionContext>({
|
|
17
|
+
expireDelay: ACTION_ID_HISTORY_TIME_OUT_DELAY,
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
lifeCycle.subscribe(LifeCycleEventType.ACTION_STARTED, (actionStart) => {
|
|
21
|
+
history.add(
|
|
22
|
+
{
|
|
23
|
+
id: actionStart.id,
|
|
24
|
+
// The label is temporarily empty since we need to account for customers that might
|
|
25
|
+
// redact the action name in the beforeSend callback. We will either try to do patch this
|
|
26
|
+
// behavior, or remove the label field entirely.
|
|
27
|
+
label: '',
|
|
28
|
+
startClocks: actionStart.startClocks,
|
|
29
|
+
duration: undefined,
|
|
30
|
+
},
|
|
31
|
+
actionStart.startClocks.relative
|
|
32
|
+
)
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
lifeCycle.subscribe(LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, ({ rawRumEvent, startClocks, duration }) => {
|
|
36
|
+
if (rawRumEvent.type === 'action') {
|
|
37
|
+
const historyEntry = history
|
|
38
|
+
.getEntries(startClocks.relative)
|
|
39
|
+
.find((entry) => entry.value.id === rawRumEvent.action.id)
|
|
40
|
+
const durationForEntry = duration ?? (0 as Duration)
|
|
41
|
+
|
|
42
|
+
if (historyEntry) {
|
|
43
|
+
historyEntry.value.duration = durationForEntry
|
|
44
|
+
historyEntry.close(addDuration(startClocks.relative, durationForEntry))
|
|
45
|
+
} else {
|
|
46
|
+
history
|
|
47
|
+
.add(
|
|
48
|
+
{
|
|
49
|
+
id: rawRumEvent.action.id,
|
|
50
|
+
// The label is temporarily empty since we need to account for customers that might
|
|
51
|
+
// redact the action name in the beforeSend callback. We will either try to do patch this
|
|
52
|
+
// behavior, or remove the label field entirely.
|
|
53
|
+
label: '',
|
|
54
|
+
startClocks,
|
|
55
|
+
duration,
|
|
56
|
+
},
|
|
57
|
+
startClocks.relative
|
|
58
|
+
)
|
|
59
|
+
.close(addDuration(startClocks.relative, durationForEntry))
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
return history
|
|
65
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ClocksState, Duration } from '@datadog/browser-core'
|
|
2
|
+
import { addDuration, createValueHistory, SESSION_TIME_OUT_DELAY } from '@datadog/browser-core'
|
|
3
|
+
import type { LifeCycle } from '@datadog/browser-rum-core'
|
|
4
|
+
import { RumPerformanceEntryType, LifeCycleEventType, RumLongTaskEntryType } from '@datadog/browser-rum-core'
|
|
5
|
+
|
|
6
|
+
export const LONG_TASK_ID_HISTORY_EXPIRE_DELAY = SESSION_TIME_OUT_DELAY
|
|
7
|
+
|
|
8
|
+
export interface LongTaskContext {
|
|
9
|
+
id: string
|
|
10
|
+
startClocks: ClocksState
|
|
11
|
+
duration: Duration
|
|
12
|
+
entryType: RumPerformanceEntryType.LONG_ANIMATION_FRAME | RumPerformanceEntryType.LONG_TASK
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function createLongTaskHistory(lifeCycle: LifeCycle) {
|
|
16
|
+
const history = createValueHistory<LongTaskContext>({
|
|
17
|
+
expireDelay: LONG_TASK_ID_HISTORY_EXPIRE_DELAY,
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
lifeCycle.subscribe(LifeCycleEventType.RAW_RUM_EVENT_COLLECTED, ({ rawRumEvent, startClocks, duration }) => {
|
|
21
|
+
if (rawRumEvent.type === 'long_task') {
|
|
22
|
+
history
|
|
23
|
+
.add(
|
|
24
|
+
{
|
|
25
|
+
id: rawRumEvent.long_task.id,
|
|
26
|
+
startClocks,
|
|
27
|
+
duration: duration!,
|
|
28
|
+
entryType:
|
|
29
|
+
rawRumEvent.long_task.entry_type === RumLongTaskEntryType.LONG_TASK
|
|
30
|
+
? RumPerformanceEntryType.LONG_TASK
|
|
31
|
+
: RumPerformanceEntryType.LONG_ANIMATION_FRAME,
|
|
32
|
+
},
|
|
33
|
+
startClocks.relative
|
|
34
|
+
)
|
|
35
|
+
.close(addDuration(startClocks.relative, duration!))
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
return history
|
|
40
|
+
}
|