@kubesense/kubesense-browser-rum 1.0.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 +34 -0
- package/bundle/chunks/profiler-b64730a2109c3ddbc539-kubesense-rum.js +1 -0
- package/bundle/chunks/recorder-9ae532a18bac5f4280da-kubesense-rum.js +1 -0
- package/bundle/kubesense-rum.js +1 -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 +4 -0
- package/cjs/boot/lazyLoadProfiler.js +54 -0
- package/cjs/boot/lazyLoadProfiler.js.map +1 -0
- package/cjs/boot/lazyLoadRecorder.d.ts +4 -0
- package/cjs/boot/lazyLoadRecorder.js +54 -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 +53 -0
- package/cjs/boot/profilerApi.js.map +1 -0
- package/cjs/boot/recorderApi.d.ts +4 -0
- package/cjs/boot/recorderApi.js +73 -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 +30 -0
- package/cjs/domain/deflate/deflateWorker.js +104 -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 +10 -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/profiler.d.ts +7 -0
- package/cjs/domain/profiling/profiler.js +244 -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 +28 -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 +21 -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 +25 -0
- package/cjs/domain/profiling/transport/buildProfileEventAttributes.js +50 -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 +72 -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 +7 -0
- package/cjs/domain/profiling/utils/getNumberOfSamples.js +18 -0
- package/cjs/domain/profiling/utils/getNumberOfSamples.js.map +1 -0
- package/cjs/domain/record/assembly.d.ts +2 -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/eventIds.d.ts +4 -0
- package/cjs/domain/record/eventIds.js +16 -0
- package/cjs/domain/record/eventIds.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 +7 -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 +57 -0
- package/cjs/domain/record/internalApi.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/nodeIds.d.ts +15 -0
- package/cjs/domain/record/nodeIds.js +32 -0
- package/cjs/domain/record/nodeIds.js.map +1 -0
- package/cjs/domain/record/record.d.ts +16 -0
- package/cjs/domain/record/record.js +90 -0
- package/cjs/domain/record/record.js.map +1 -0
- package/cjs/domain/record/record.types.d.ts +4 -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 +19 -0
- package/cjs/domain/record/recordingScope.js +13 -0
- package/cjs/domain/record/recordingScope.js.map +1 -0
- package/cjs/domain/record/serialization/index.d.ts +8 -0
- package/cjs/domain/record/serialization/index.js +18 -0
- package/cjs/domain/record/serialization/index.js.map +1 -0
- package/cjs/domain/record/serialization/serialization.types.d.ts +28 -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 +45 -0
- package/cjs/domain/record/serialization/serializationTransaction.js +38 -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/serializeDocument.d.ts +3 -0
- package/cjs/domain/record/serialization/serializeDocument.js +11 -0
- package/cjs/domain/record/serialization/serializeDocument.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/serializeStyleSheets.d.ts +2 -0
- package/cjs/domain/record/serialization/serializeStyleSheets.js +19 -0
- package/cjs/domain/record/serialization/serializeStyleSheets.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 +9 -0
- package/cjs/domain/record/startFullSnapshots.js +59 -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 +7 -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 +11 -0
- package/cjs/domain/record/trackers/trackMutation.js +270 -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 +47 -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 +2 -0
- package/cjs/types/index.js +18 -0
- package/cjs/types/index.js.map +1 -0
- package/cjs/types/sessionReplay.d.ts +703 -0
- package/cjs/types/sessionReplay.js +7 -0
- package/cjs/types/sessionReplay.js.map +1 -0
- package/cjs/types/sessionReplayConstants.d.ts +49 -0
- package/cjs/types/sessionReplayConstants.js +49 -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 +4 -0
- package/esm/boot/lazyLoadProfiler.js +18 -0
- package/esm/boot/lazyLoadProfiler.js.map +1 -0
- package/esm/boot/lazyLoadRecorder.d.ts +4 -0
- package/esm/boot/lazyLoadRecorder.js +18 -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 +50 -0
- package/esm/boot/profilerApi.js.map +1 -0
- package/esm/boot/recorderApi.d.ts +4 -0
- package/esm/boot/recorderApi.js +70 -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 +30 -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/profiler.d.ts +7 -0
- package/esm/domain/profiling/profiler.js +240 -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 +25 -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 +21 -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 +25 -0
- package/esm/domain/profiling/transport/buildProfileEventAttributes.js +47 -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 +72 -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 +7 -0
- package/esm/domain/profiling/utils/getNumberOfSamples.js +15 -0
- package/esm/domain/profiling/utils/getNumberOfSamples.js.map +1 -0
- package/esm/domain/record/assembly.d.ts +2 -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/eventIds.d.ts +4 -0
- package/esm/domain/record/eventIds.js +13 -0
- package/esm/domain/record/eventIds.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 +7 -0
- package/esm/domain/record/index.js +6 -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 +53 -0
- package/esm/domain/record/internalApi.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/nodeIds.d.ts +15 -0
- package/esm/domain/record/nodeIds.js +29 -0
- package/esm/domain/record/nodeIds.js.map +1 -0
- package/esm/domain/record/record.d.ts +16 -0
- package/esm/domain/record/record.js +54 -0
- package/esm/domain/record/record.js.map +1 -0
- package/esm/domain/record/record.types.d.ts +4 -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 +19 -0
- package/esm/domain/record/recordingScope.js +10 -0
- package/esm/domain/record/recordingScope.js.map +1 -0
- package/esm/domain/record/serialization/index.d.ts +8 -0
- package/esm/domain/record/serialization/index.js +7 -0
- package/esm/domain/record/serialization/index.js.map +1 -0
- package/esm/domain/record/serialization/serialization.types.d.ts +28 -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 +45 -0
- package/esm/domain/record/serialization/serializationTransaction.js +35 -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/serializeDocument.d.ts +3 -0
- package/esm/domain/record/serialization/serializeDocument.js +8 -0
- package/esm/domain/record/serialization/serializeDocument.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/serializeStyleSheets.d.ts +2 -0
- package/esm/domain/record/serialization/serializeStyleSheets.js +16 -0
- package/esm/domain/record/serialization/serializeStyleSheets.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 +9 -0
- package/esm/domain/record/startFullSnapshots.js +55 -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 +7 -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 +11 -0
- package/esm/domain/record/trackers/trackMutation.js +266 -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 +44 -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 +2 -0
- package/esm/types/index.js +2 -0
- package/esm/types/index.js.map +1 -0
- package/esm/types/sessionReplay.d.ts +703 -0
- package/esm/types/sessionReplay.js +6 -0
- package/esm/types/sessionReplay.js.map +1 -0
- package/esm/types/sessionReplayConstants.d.ts +49 -0
- package/esm/types/sessionReplayConstants.js +46 -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 +40 -0
- package/src/boot/isBrowserSupported.ts +14 -0
- package/src/boot/lazyLoadProfiler.ts +21 -0
- package/src/boot/lazyLoadRecorder.ts +21 -0
- package/src/boot/postStartStrategy.ts +176 -0
- package/src/boot/preStartStrategy.ts +34 -0
- package/src/boot/profilerApi.ts +86 -0
- package/src/boot/recorderApi.ts +124 -0
- package/src/boot/startRecording.ts +70 -0
- package/src/domain/deflate/deflateEncoder.ts +144 -0
- package/src/domain/deflate/deflateWorker.ts +157 -0
- package/src/domain/deflate/index.ts +8 -0
- package/src/domain/getSessionReplayLink.ts +40 -0
- package/src/domain/profiling/profiler.ts +338 -0
- package/src/domain/profiling/profilingContext.ts +34 -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 +78 -0
- package/src/domain/profiling/transport/buildProfileEventAttributes.ts +66 -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 +81 -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 +16 -0
- package/src/domain/record/assembly.ts +17 -0
- package/src/domain/record/elementsScrollPositions.ts +28 -0
- package/src/domain/record/eventIds.ts +17 -0
- package/src/domain/record/eventsUtils.ts +12 -0
- package/src/domain/record/index.ts +7 -0
- package/src/domain/record/internalApi.ts +88 -0
- package/src/domain/record/mutationBatch.ts +47 -0
- package/src/domain/record/nodeIds.ts +46 -0
- package/src/domain/record/record.ts +98 -0
- package/src/domain/record/record.types.ts +5 -0
- package/src/domain/record/recordingScope.ts +36 -0
- package/src/domain/record/serialization/index.ts +8 -0
- package/src/domain/record/serialization/serialization.types.ts +43 -0
- package/src/domain/record/serialization/serializationStats.ts +43 -0
- package/src/domain/record/serialization/serializationTransaction.ts +94 -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/serializeDocument.ts +13 -0
- package/src/domain/record/serialization/serializeNode.ts +229 -0
- package/src/domain/record/serialization/serializeStyleSheets.ts +18 -0
- package/src/domain/record/shadowRootsController.ts +62 -0
- package/src/domain/record/startFullSnapshots.ts +84 -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 +41 -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 +399 -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 +78 -0
- package/src/domain/segmentCollection/segmentCollection.ts +200 -0
- package/src/domain/segmentCollection/startSegmentTelemetry.ts +82 -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 +95 -0
- package/src/types/index.ts +2 -0
- package/src/types/sessionReplay.ts +734 -0
- package/src/types/sessionReplayConstants.ts +86 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SKIPPED } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
import { RumEventType } from '@kubesense/kubesense-browser-rum-core';
|
|
3
|
+
export function startProfilingContext(hooks) {
|
|
4
|
+
let currentContext = {
|
|
5
|
+
status: 'starting',
|
|
6
|
+
};
|
|
7
|
+
hooks.register(0 /* HookNames.Assemble */, ({ eventType }) => {
|
|
8
|
+
if (eventType !== RumEventType.VIEW && eventType !== RumEventType.LONG_TASK) {
|
|
9
|
+
return SKIPPED;
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
type: eventType,
|
|
13
|
+
_kubesense: {
|
|
14
|
+
profiling: currentContext,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
return {
|
|
19
|
+
get: () => currentContext,
|
|
20
|
+
set: (newContext) => {
|
|
21
|
+
currentContext = newContext;
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=profilingContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profilingContext.js","sourceRoot":"","sources":["../../../src/domain/profiling/profilingContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,OAAO,EAAE,MAAM,mCAAmC,CAAA;AAEtE,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAA;AAOpE,MAAM,UAAU,qBAAqB,CAAC,KAAY;IAChD,IAAI,cAAc,GAAmC;QACnD,MAAM,EAAE,UAAU;KACnB,CAAA;IAED,KAAK,CAAC,QAAQ,6BAAqB,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;QACnD,IAAI,SAAS,KAAK,YAAY,CAAC,IAAI,IAAI,SAAS,KAAK,YAAY,CAAC,SAAS,EAAE,CAAC;YAC5E,OAAO,OAAO,CAAA;QAChB,CAAC;QAED,OAAO;YACL,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACV,SAAS,EAAE,cAAc;aAC1B;SACF,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,OAAO;QACL,GAAG,EAAE,GAAG,EAAE,CAAC,cAAc;QACzB,GAAG,EAAE,CAAC,UAA0C,EAAE,EAAE;YAClD,cAAc,GAAG,UAAU,CAAA;QAC7B,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isProfilingSupported(): boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { getGlobalObject } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
export function isProfilingSupported() {
|
|
3
|
+
const globalThis = getGlobalObject();
|
|
4
|
+
// This API might be unavailable in some browsers
|
|
5
|
+
const globalThisProfiler = globalThis.Profiler;
|
|
6
|
+
return globalThisProfiler !== undefined;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=profilingSupported.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profilingSupported.js","sourceRoot":"","sources":["../../../src/domain/profiling/profilingSupported.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AAGnE,MAAM,UAAU,oBAAoB;IAClC,MAAM,UAAU,GAAG,eAAe,EAAE,CAAA;IAEpC,iDAAiD;IACjD,MAAM,kBAAkB,GAA0B,UAAkB,CAAC,QAAQ,CAAA;IAC7E,OAAO,kBAAkB,KAAK,SAAS,CAAA;AACzC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
const generateFiftyRandomSamples = () => {
|
|
2
|
+
const samples = [];
|
|
3
|
+
for (let i = 0; i < 50; i++) {
|
|
4
|
+
samples.push({
|
|
5
|
+
timestamp: i,
|
|
6
|
+
stackId: i % 3,
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
return samples;
|
|
10
|
+
};
|
|
11
|
+
// eslint-disable-next-line local-rules/disallow-side-effects
|
|
12
|
+
const randomSamples = generateFiftyRandomSamples();
|
|
13
|
+
export const mockedEmptyTrace = {
|
|
14
|
+
resources: [],
|
|
15
|
+
frames: [],
|
|
16
|
+
stacks: [],
|
|
17
|
+
samples: [],
|
|
18
|
+
};
|
|
19
|
+
export const mockedTrace = {
|
|
20
|
+
resources: ['resource1', 'resource2', 'resource3'],
|
|
21
|
+
frames: [
|
|
22
|
+
{
|
|
23
|
+
name: 'frame-0',
|
|
24
|
+
line: 1,
|
|
25
|
+
column: 1,
|
|
26
|
+
resourceId: 0,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'frame-1',
|
|
30
|
+
line: 2,
|
|
31
|
+
column: 2,
|
|
32
|
+
resourceId: 1,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'frame-2',
|
|
36
|
+
line: 3,
|
|
37
|
+
column: 3,
|
|
38
|
+
resourceId: 2,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
stacks: [
|
|
42
|
+
{
|
|
43
|
+
frameId: 0,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
frameId: 1,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
frameId: 2,
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
samples: randomSamples,
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=mockedTrace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mockedTrace.js","sourceRoot":"","sources":["../../../../src/domain/profiling/test-utils/mockedTrace.ts"],"names":[],"mappings":"AAEA,MAAM,0BAA0B,GAAG,GAAG,EAAE;IACtC,MAAM,OAAO,GAAG,EAAE,CAAA;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5B,OAAO,CAAC,IAAI,CAAC;YACX,SAAS,EAAE,CAAC;YACZ,OAAO,EAAE,CAAC,GAAG,CAAC;SACf,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED,6DAA6D;AAC7D,MAAM,aAAa,GAAG,0BAA0B,EAAE,CAAA;AAElD,MAAM,CAAC,MAAM,gBAAgB,GAAkB;IAC7C,SAAS,EAAE,EAAE;IACb,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,EAAE;CACZ,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAkB;IACxC,SAAS,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC;IAClD,MAAM,EAAE;QACN;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,CAAC;YACP,MAAM,EAAE,CAAC;YACT,UAAU,EAAE,CAAC;SACd;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,CAAC;YACP,MAAM,EAAE,CAAC;YACT,UAAU,EAAE,CAAC;SACd;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,CAAC;YACP,MAAM,EAAE,CAAC;YACT,UAAU,EAAE,CAAC;SACd;KACF;IACD,MAAM,EAAE;QACN;YACE,OAAO,EAAE,CAAC;SACX;QACD;YACE,OAAO,EAAE,CAAC;SACX;QACD;YACE,OAAO,EAAE,CAAC;SACX;KACF;IACD,OAAO,EAAE,aAAa;CACvB,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { RumConfiguration } from '@kubesense/kubesense-browser-rum-core';
|
|
2
|
+
import type { RumProfilerTrace } from '../types';
|
|
3
|
+
import type { ProfileEventAttributes } from './buildProfileEventAttributes';
|
|
4
|
+
export interface ProfileEvent extends ProfileEventAttributes {
|
|
5
|
+
attachments: string[];
|
|
6
|
+
start: string;
|
|
7
|
+
end: string;
|
|
8
|
+
family: 'chrome';
|
|
9
|
+
runtime: 'chrome';
|
|
10
|
+
format: 'json';
|
|
11
|
+
version: 4;
|
|
12
|
+
tags_profiler: string;
|
|
13
|
+
_kubesense: {
|
|
14
|
+
clock_drift: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface ProfileEventPayload {
|
|
18
|
+
event: ProfileEvent;
|
|
19
|
+
'wall-time.json': RumProfilerTrace;
|
|
20
|
+
}
|
|
21
|
+
export declare function assembleProfilingPayload(profilerTrace: RumProfilerTrace, configuration: RumConfiguration, sessionId: string | undefined): ProfileEventPayload;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { buildTags, currentDrift } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
import { buildProfileEventAttributes } from './buildProfileEventAttributes';
|
|
3
|
+
export function assembleProfilingPayload(profilerTrace, configuration, sessionId) {
|
|
4
|
+
const event = buildProfileEvent(profilerTrace, configuration, sessionId);
|
|
5
|
+
return {
|
|
6
|
+
event,
|
|
7
|
+
'wall-time.json': profilerTrace,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function buildProfileEvent(profilerTrace, configuration, sessionId) {
|
|
11
|
+
const tags = buildTags(configuration); // TODO: get that from the tagContext hook
|
|
12
|
+
const profileAttributes = buildProfileEventAttributes(profilerTrace, configuration.applicationId, sessionId);
|
|
13
|
+
const profileEventTags = buildProfileEventTags(tags);
|
|
14
|
+
const profileEvent = {
|
|
15
|
+
...profileAttributes,
|
|
16
|
+
attachments: ['wall-time.json'],
|
|
17
|
+
start: new Date(profilerTrace.startClocks.timeStamp).toISOString(),
|
|
18
|
+
end: new Date(profilerTrace.endClocks.timeStamp).toISOString(),
|
|
19
|
+
family: 'chrome',
|
|
20
|
+
runtime: 'chrome',
|
|
21
|
+
format: 'json',
|
|
22
|
+
version: 4, // Ingestion event version (not the version application tag)
|
|
23
|
+
tags_profiler: profileEventTags.join(','),
|
|
24
|
+
_kubesense: {
|
|
25
|
+
clock_drift: currentDrift(),
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
return profileEvent;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Builds tags for the Profile Event.
|
|
32
|
+
*
|
|
33
|
+
* @param tags - RUM tags
|
|
34
|
+
* @returns Combined tags for the Profile Event.
|
|
35
|
+
*/
|
|
36
|
+
function buildProfileEventTags(tags) {
|
|
37
|
+
// Tags already contains the common tags for all events. (service, env, version, etc.)
|
|
38
|
+
// Here we are adding some specific-to-profiling tags.
|
|
39
|
+
const profileEventTags = tags.concat(['language:javascript', 'runtime:chrome', 'family:chrome', 'host:browser']);
|
|
40
|
+
return profileEventTags;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=assembly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assembly.js","sourceRoot":"","sources":["../../../../src/domain/profiling/transport/assembly.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAG3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAsB3E,MAAM,UAAU,wBAAwB,CACtC,aAA+B,EAC/B,aAA+B,EAC/B,SAA6B;IAE7B,MAAM,KAAK,GAAG,iBAAiB,CAAC,aAAa,EAAE,aAAa,EAAE,SAAS,CAAC,CAAA;IAExE,OAAO;QACL,KAAK;QACL,gBAAgB,EAAE,aAAa;KAChC,CAAA;AACH,CAAC;AAED,SAAS,iBAAiB,CACxB,aAA+B,EAC/B,aAA+B,EAC/B,SAA6B;IAE7B,MAAM,IAAI,GAAG,SAAS,CAAC,aAAa,CAAC,CAAA,CAAC,0CAA0C;IAChF,MAAM,iBAAiB,GAAG,2BAA2B,CAAC,aAAa,EAAE,aAAa,CAAC,aAAa,EAAE,SAAS,CAAC,CAAA;IAC5G,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAA;IAEpD,MAAM,YAAY,GAAiB;QACjC,GAAG,iBAAiB;QACpB,WAAW,EAAE,CAAC,gBAAgB,CAAC;QAC/B,KAAK,EAAE,IAAI,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;QAClE,GAAG,EAAE,IAAI,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;QAC9D,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,QAAQ;QACjB,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,CAAC,EAAE,4DAA4D;QACxE,aAAa,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC;QACzC,UAAU,EAAE;YACV,WAAW,EAAE,YAAY,EAAE;SAC5B;KACF,CAAA;IAED,OAAO,YAAY,CAAA;AACrB,CAAC;AAED;;;;;GAKG;AACH,SAAS,qBAAqB,CAAC,IAAc;IAC3C,sFAAsF;IACtF,sDAAsD;IACtD,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,qBAAqB,EAAE,gBAAgB,EAAE,eAAe,EAAE,cAAc,CAAC,CAAC,CAAA;IAEhH,OAAO,gBAAgB,CAAA;AACzB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { RumProfilerTrace } from '../types';
|
|
2
|
+
export interface ProfileEventAttributes {
|
|
3
|
+
application: {
|
|
4
|
+
id: string;
|
|
5
|
+
};
|
|
6
|
+
session?: {
|
|
7
|
+
id: string;
|
|
8
|
+
};
|
|
9
|
+
view?: {
|
|
10
|
+
id: string[];
|
|
11
|
+
name: string[];
|
|
12
|
+
};
|
|
13
|
+
long_task?: {
|
|
14
|
+
id: string[];
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Builds attributes for the Profile Event.
|
|
19
|
+
*
|
|
20
|
+
* @param profilerTrace - Profiler trace
|
|
21
|
+
* @param applicationId - application id.
|
|
22
|
+
* @param sessionId - session id.
|
|
23
|
+
* @returns Additional attributes.
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildProfileEventAttributes(profilerTrace: RumProfilerTrace, applicationId: string, sessionId: string | undefined): ProfileEventAttributes;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds attributes for the Profile Event.
|
|
3
|
+
*
|
|
4
|
+
* @param profilerTrace - Profiler trace
|
|
5
|
+
* @param applicationId - application id.
|
|
6
|
+
* @param sessionId - session id.
|
|
7
|
+
* @returns Additional attributes.
|
|
8
|
+
*/
|
|
9
|
+
export function buildProfileEventAttributes(profilerTrace, applicationId, sessionId) {
|
|
10
|
+
const attributes = {
|
|
11
|
+
application: {
|
|
12
|
+
id: applicationId,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
if (sessionId) {
|
|
16
|
+
attributes.session = {
|
|
17
|
+
id: sessionId,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
// Extract view ids and names from the profiler trace and add them as attributes of the profile event.
|
|
21
|
+
// This will be used to filter the profiles by @view.id and/or @view.name.
|
|
22
|
+
const { ids, names } = extractViewIdsAndNames(profilerTrace.views);
|
|
23
|
+
if (ids.length) {
|
|
24
|
+
attributes.view = {
|
|
25
|
+
id: ids,
|
|
26
|
+
name: names,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const longTaskIds = profilerTrace.longTasks.map((longTask) => longTask.id).filter((id) => id !== undefined);
|
|
30
|
+
if (longTaskIds.length) {
|
|
31
|
+
attributes.long_task = { id: longTaskIds };
|
|
32
|
+
}
|
|
33
|
+
return attributes;
|
|
34
|
+
}
|
|
35
|
+
function extractViewIdsAndNames(views) {
|
|
36
|
+
const result = { ids: [], names: [] };
|
|
37
|
+
for (const view of views) {
|
|
38
|
+
result.ids.push(view.viewId);
|
|
39
|
+
if (view.viewName) {
|
|
40
|
+
result.names.push(view.viewName);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// Remove duplicates
|
|
44
|
+
result.names = Array.from(new Set(result.names));
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=buildProfileEventAttributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildProfileEventAttributes.js","sourceRoot":"","sources":["../../../../src/domain/profiling/transport/buildProfileEventAttributes.ts"],"names":[],"mappings":"AASA;;;;;;;GAOG;AACH,MAAM,UAAU,2BAA2B,CACzC,aAA+B,EAC/B,aAAqB,EACrB,SAA6B;IAE7B,MAAM,UAAU,GAA2B;QACzC,WAAW,EAAE;YACX,EAAE,EAAE,aAAa;SAClB;KACF,CAAA;IACD,IAAI,SAAS,EAAE,CAAC;QACd,UAAU,CAAC,OAAO,GAAG;YACnB,EAAE,EAAE,SAAS;SACd,CAAA;IACH,CAAC;IAED,sGAAsG;IACtG,0EAA0E;IAC1E,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,sBAAsB,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;IAElE,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;QACf,UAAU,CAAC,IAAI,GAAG;YAChB,EAAE,EAAE,GAAG;YACP,IAAI,EAAE,KAAK;SACZ,CAAA;IACH,CAAC;IACD,MAAM,WAAW,GAAa,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,SAAS,CAAC,CAAA;IAErH,IAAI,WAAW,CAAC,MAAM,EAAE,CAAC;QACvB,UAAU,CAAC,SAAS,GAAG,EAAE,EAAE,EAAE,WAAW,EAAE,CAAA;IAC5C,CAAC;IACD,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAqB;IACnD,MAAM,MAAM,GAAuC,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAA;IACzE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAE5B,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAClC,CAAC;IACH,CAAC;IAED,oBAAoB;IACpB,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;IAEhD,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domain/profiling/types/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export interface ProfilerFrame {
|
|
2
|
+
/** A function instance name. */
|
|
3
|
+
readonly name: string;
|
|
4
|
+
/** Index in the trace.resources array. */
|
|
5
|
+
readonly resourceId?: number;
|
|
6
|
+
/** 1-based index of the line. */
|
|
7
|
+
readonly line?: number;
|
|
8
|
+
/** 1-based index of the column. */
|
|
9
|
+
readonly column?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ProfilerStack {
|
|
12
|
+
/** Index in the trace.stacks array. */
|
|
13
|
+
readonly parentId?: number;
|
|
14
|
+
/** Index in the trace.frames array. */
|
|
15
|
+
readonly frameId: number;
|
|
16
|
+
}
|
|
17
|
+
export interface ProfilerSample {
|
|
18
|
+
/** High resolution time relative to the profiling session's time origin. */
|
|
19
|
+
readonly timestamp: number;
|
|
20
|
+
/** Index in the trace.stacks array. */
|
|
21
|
+
readonly stackId?: number;
|
|
22
|
+
}
|
|
23
|
+
export type ProfilerResource = string;
|
|
24
|
+
export interface ProfilerTrace {
|
|
25
|
+
/** An array of profiler resources. */
|
|
26
|
+
readonly resources: ProfilerResource[];
|
|
27
|
+
/** An array of profiler frames. */
|
|
28
|
+
readonly frames: ProfilerFrame[];
|
|
29
|
+
/** An array of profiler stacks. */
|
|
30
|
+
readonly stacks: ProfilerStack[];
|
|
31
|
+
/** An array of profiler samples. */
|
|
32
|
+
readonly samples: ProfilerSample[];
|
|
33
|
+
}
|
|
34
|
+
export interface ProfilerInitOptions {
|
|
35
|
+
/** Sample interval in ms. */
|
|
36
|
+
readonly sampleInterval: number;
|
|
37
|
+
/** Max buffer size in number of samples. */
|
|
38
|
+
readonly maxBufferSize: number;
|
|
39
|
+
}
|
|
40
|
+
export interface Profiler extends EventTarget {
|
|
41
|
+
/** Sample interval in ms. */
|
|
42
|
+
readonly sampleInterval: number;
|
|
43
|
+
/** True if profiler is stopped. */
|
|
44
|
+
readonly stopped: boolean;
|
|
45
|
+
new (options: ProfilerInitOptions): Profiler;
|
|
46
|
+
stop(): Promise<ProfilerTrace>;
|
|
47
|
+
addEventListener<K extends keyof ProfilerEventMap>(type: K, listener: (this: typeof globalThis, ev: ProfilerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
48
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
49
|
+
removeEventListener<K extends keyof ProfilerEventMap>(type: K, listener: (this: typeof globalThis, ev: ProfilerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
50
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
51
|
+
}
|
|
52
|
+
interface ProfilerEventMap {
|
|
53
|
+
samplebufferfull: SampleBufferFullEvent;
|
|
54
|
+
}
|
|
55
|
+
export interface SampleBufferFullEvent extends Event {
|
|
56
|
+
readonly target: Profiler;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profilerApi.types.js","sourceRoot":"","sources":["../../../../src/domain/profiling/types/profilerApi.types.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,4CAA4C"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { TimeoutId, ClocksState } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
import type { LongTaskContext } from '@kubesense/kubesense-browser-rum-core';
|
|
3
|
+
import type { ProfilerTrace, Profiler } from './profilerApi.types';
|
|
4
|
+
export interface RumViewEntry {
|
|
5
|
+
/** Detected start time of view */
|
|
6
|
+
readonly startClocks: ClocksState;
|
|
7
|
+
/** RUM view id */
|
|
8
|
+
readonly viewId: string;
|
|
9
|
+
/** RUM view name */
|
|
10
|
+
readonly viewName: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Additional data recorded during profiling session
|
|
14
|
+
*/
|
|
15
|
+
export interface RumProfilerEnrichmentData {
|
|
16
|
+
/** List of detected long tasks */
|
|
17
|
+
readonly longTasks: LongTaskContext[];
|
|
18
|
+
/** List of detected navigation entries */
|
|
19
|
+
readonly views: RumViewEntry[];
|
|
20
|
+
}
|
|
21
|
+
export interface RumProfilerTrace extends ProfilerTrace, RumProfilerEnrichmentData {
|
|
22
|
+
/** High resolution time when profiler trace started, relative to the profiling session's time origin */
|
|
23
|
+
readonly startClocks: ClocksState;
|
|
24
|
+
/** High resolution time when profiler trace ended, relative to the profiling session's time origin */
|
|
25
|
+
readonly endClocks: ClocksState;
|
|
26
|
+
/** Time origin of the profiling session */
|
|
27
|
+
readonly clocksOrigin: ClocksState;
|
|
28
|
+
/** Sample interval in milliseconds */
|
|
29
|
+
readonly sampleInterval: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Describes profiler session state when it's stopped
|
|
33
|
+
*/
|
|
34
|
+
export interface RumProfilerStoppedInstance {
|
|
35
|
+
readonly state: 'stopped';
|
|
36
|
+
readonly stateReason: 'session-expired' | 'stopped-by-user' | 'initializing';
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Describes profiler session state when it's paused
|
|
40
|
+
* (this happens when user focuses on a different tab)
|
|
41
|
+
*/
|
|
42
|
+
export interface RumProfilerPausedInstance {
|
|
43
|
+
readonly state: 'paused';
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Describes profiler session state when it's running
|
|
47
|
+
*/
|
|
48
|
+
export interface RumProfilerRunningInstance extends RumProfilerEnrichmentData {
|
|
49
|
+
readonly state: 'running';
|
|
50
|
+
/** Current profiler instance */
|
|
51
|
+
readonly profiler: Profiler;
|
|
52
|
+
/** High resolution time when profiler session started */
|
|
53
|
+
readonly startClocks: ClocksState;
|
|
54
|
+
/** Timeout id to stop current session */
|
|
55
|
+
readonly timeoutId: TimeoutId;
|
|
56
|
+
/** Clean-up tasks to execute after running the Profiler */
|
|
57
|
+
readonly cleanupTasks: Array<() => void>;
|
|
58
|
+
}
|
|
59
|
+
export type RumProfilerInstance = RumProfilerStoppedInstance | RumProfilerPausedInstance | RumProfilerRunningInstance;
|
|
60
|
+
export interface RUMProfiler {
|
|
61
|
+
start: () => void;
|
|
62
|
+
stop: () => Promise<void>;
|
|
63
|
+
isStopped: () => boolean;
|
|
64
|
+
isRunning: () => boolean;
|
|
65
|
+
isPaused: () => boolean;
|
|
66
|
+
}
|
|
67
|
+
export interface RUMProfilerConfiguration {
|
|
68
|
+
sampleIntervalMs: number;
|
|
69
|
+
collectIntervalMs: number;
|
|
70
|
+
minProfileDurationMs: number;
|
|
71
|
+
minNumberOfSamples: number;
|
|
72
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rumProfiler.types.js","sourceRoot":"","sources":["../../../../src/domain/profiling/types/rumProfiler.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getCustomOrDefaultViewName: (customViewName: string | undefined, viewPathUrl: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCustomOrDefaultViewName.js","sourceRoot":"","sources":["../../../../src/domain/profiling/utils/getCustomOrDefaultViewName.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,cAAkC,EAAE,WAAmB,EAAU,EAAE,CAC5G,cAAc,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getDefaultViewName(viewPathUrl: string): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This is the regex used to extract the path from the url (from SimpleUrlGroupingProcessor.java)
|
|
2
|
+
// It's a bit different from the one in the java code because we removed the lookbehind unsupported by Safari.
|
|
3
|
+
const PATH_MIXED_ALPHANUMERICS = /\/(?![vV]\d{1,2}\/)([^/\d?]*\d+[^/?]*)/g;
|
|
4
|
+
export function getDefaultViewName(viewPathUrl) {
|
|
5
|
+
if (!viewPathUrl) {
|
|
6
|
+
return '/';
|
|
7
|
+
}
|
|
8
|
+
// Replace all the mixed alphanumerics with a ?
|
|
9
|
+
return viewPathUrl.replace(PATH_MIXED_ALPHANUMERICS, '/?');
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=getDefaultViewName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getDefaultViewName.js","sourceRoot":"","sources":["../../../../src/domain/profiling/utils/getDefaultViewName.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,8GAA8G;AAC9G,MAAM,wBAAwB,GAAG,yCAAyC,CAAA;AAE1E,MAAM,UAAU,kBAAkB,CAAC,WAAmB;IACpD,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,+CAA+C;IAC/C,OAAO,WAAW,CAAC,OAAO,CAAC,wBAAwB,EAAE,IAAI,CAAC,CAAA;AAC5D,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ProfilerSample } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Counts number of samples when the thread was not idle (stackId is defined)
|
|
4
|
+
* @param samples Array of collected samples
|
|
5
|
+
* @returns Number of samples
|
|
6
|
+
*/
|
|
7
|
+
export declare function getNumberOfSamples(samples: ProfilerSample[]): number;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Counts number of samples when the thread was not idle (stackId is defined)
|
|
3
|
+
* @param samples Array of collected samples
|
|
4
|
+
* @returns Number of samples
|
|
5
|
+
*/
|
|
6
|
+
export function getNumberOfSamples(samples) {
|
|
7
|
+
let numberOfSamples = 0;
|
|
8
|
+
for (const sample of samples) {
|
|
9
|
+
if (sample.stackId !== undefined) {
|
|
10
|
+
numberOfSamples++;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return numberOfSamples;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=getNumberOfSamples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getNumberOfSamples.js","sourceRoot":"","sources":["../../../../src/domain/profiling/utils/getNumberOfSamples.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAyB;IAC1D,IAAI,eAAe,GAAG,CAAC,CAAA;IACvB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YACjC,eAAe,EAAE,CAAA;QACnB,CAAC;IACH,CAAC;IACD,OAAO,eAAe,CAAA;AACxB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { timeStampNow } from '@kubesense/kubesense-browser-core';
|
|
2
|
+
import { RecordType } from '../../types';
|
|
3
|
+
export function assembleIncrementalSnapshot(source, data) {
|
|
4
|
+
return {
|
|
5
|
+
data: {
|
|
6
|
+
source,
|
|
7
|
+
...data,
|
|
8
|
+
},
|
|
9
|
+
type: RecordType.IncrementalSnapshot,
|
|
10
|
+
timestamp: timeStampNow(),
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=assembly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assembly.js","sourceRoot":"","sources":["../../../src/domain/record/assembly.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAEhE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,MAAM,UAAU,2BAA2B,CACzC,MAAsB,EACtB,IAA0B;IAE1B,OAAO;QACL,IAAI,EAAE;YACJ,MAAM;YACN,GAAG,IAAI;SACA;QACT,IAAI,EAAE,UAAU,CAAC,mBAAmB;QACpC,SAAS,EAAE,YAAY,EAAE;KAC1B,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ElementsScrollPositions = ReturnType<typeof createElementsScrollPositions>;
|
|
2
|
+
export interface ScrollPositions {
|
|
3
|
+
scrollLeft: number;
|
|
4
|
+
scrollTop: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function createElementsScrollPositions(): {
|
|
7
|
+
set(element: Element | Document, scrollPositions: ScrollPositions): void;
|
|
8
|
+
get(element: Element): ScrollPositions | undefined;
|
|
9
|
+
has(element: Element): boolean;
|
|
10
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function createElementsScrollPositions() {
|
|
2
|
+
const scrollPositionsByElement = new WeakMap();
|
|
3
|
+
return {
|
|
4
|
+
set(element, scrollPositions) {
|
|
5
|
+
if (element === document && !document.scrollingElement) {
|
|
6
|
+
// cf https://drafts.csswg.org/cssom-view/#dom-document-scrollingelement,
|
|
7
|
+
// in some cases scrolling elements can not be defined, we don't support those for now
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
scrollPositionsByElement.set(element === document ? document.scrollingElement : element, scrollPositions);
|
|
11
|
+
},
|
|
12
|
+
get(element) {
|
|
13
|
+
return scrollPositionsByElement.get(element);
|
|
14
|
+
},
|
|
15
|
+
has(element) {
|
|
16
|
+
return scrollPositionsByElement.has(element);
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=elementsScrollPositions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elementsScrollPositions.js","sourceRoot":"","sources":["../../../src/domain/record/elementsScrollPositions.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,6BAA6B;IAC3C,MAAM,wBAAwB,GAAG,IAAI,OAAO,EAA4B,CAAA;IACxE,OAAO;QACL,GAAG,CAAC,OAA2B,EAAE,eAAgC;YAC/D,IAAI,OAAO,KAAK,QAAQ,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC;gBACvD,yEAAyE;gBACzE,sFAAsF;gBACtF,OAAM;YACR,CAAC;YACD,wBAAwB,CAAC,GAAG,CAC1B,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,gBAAiB,CAAC,CAAC,CAAE,OAAmB,EACxE,eAAe,CAChB,CAAA;QACH,CAAC;QACD,GAAG,CAAC,OAAgB;YAClB,OAAO,wBAAwB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAC9C,CAAC;QACD,GAAG,CAAC,OAAgB;YAClB,OAAO,wBAAwB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAC9C,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function createEventIds() {
|
|
2
|
+
const eventIds = new WeakMap();
|
|
3
|
+
let nextId = 1;
|
|
4
|
+
return {
|
|
5
|
+
getIdForEvent(event) {
|
|
6
|
+
if (!eventIds.has(event)) {
|
|
7
|
+
eventIds.set(event, nextId++);
|
|
8
|
+
}
|
|
9
|
+
return eventIds.get(event);
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=eventIds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventIds.js","sourceRoot":"","sources":["../../../src/domain/record/eventIds.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,cAAc;IAC5B,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAiB,CAAA;IAC7C,IAAI,MAAM,GAAG,CAAC,CAAA;IAEd,OAAO;QACL,aAAa,CAAC,KAAY;YACxB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzB,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAA;YAC/B,CAAC;YACD,OAAO,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAE,CAAA;QAC7B,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { isNodeShadowHost } from '@kubesense/kubesense-browser-rum-core';
|
|
2
|
+
export function isTouchEvent(event) {
|
|
3
|
+
return Boolean(event.changedTouches);
|
|
4
|
+
}
|
|
5
|
+
export function getEventTarget(event) {
|
|
6
|
+
if (event.composed === true && isNodeShadowHost(event.target)) {
|
|
7
|
+
return event.composedPath()[0];
|
|
8
|
+
}
|
|
9
|
+
return event.target;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=eventsUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventsUtils.js","sourceRoot":"","sources":["../../../src/domain/record/eventsUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAA;AAExE,MAAM,UAAU,YAAY,CAAC,KAA8B;IACzD,OAAO,OAAO,CAAE,KAAoB,CAAC,cAAc,CAAC,CAAA;AACtD,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAY;IACzC,IAAI,KAAK,CAAC,QAAQ,KAAK,IAAI,IAAI,gBAAgB,CAAC,KAAK,CAAC,MAAc,CAAC,EAAE,CAAC;QACtE,OAAO,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAS,CAAA;IACxC,CAAC;IACD,OAAO,KAAK,CAAC,MAAc,CAAA;AAC7B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { takeFullSnapshot, takeNodeSnapshot } from './internalApi';
|
|
2
|
+
export { record } from './record';
|
|
3
|
+
export type { SerializationMetric, SerializationStats } from './serialization';
|
|
4
|
+
export { createSerializationStats, aggregateSerializationStats } from './serialization';
|
|
5
|
+
export { serializeNode, serializeDocument } from './serialization';
|
|
6
|
+
export { createElementsScrollPositions } from './elementsScrollPositions';
|
|
7
|
+
export type { ShadowRootsController } from './shadowRootsController';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { takeFullSnapshot, takeNodeSnapshot } from './internalApi';
|
|
2
|
+
export { record } from './record';
|
|
3
|
+
export { createSerializationStats, aggregateSerializationStats } from './serialization';
|
|
4
|
+
export { serializeNode, serializeDocument } from './serialization';
|
|
5
|
+
export { createElementsScrollPositions } from './elementsScrollPositions';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/record/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAA;AACvF,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAClE,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { RumConfiguration } from '@kubesense/kubesense-browser-rum-core';
|
|
2
|
+
import type { BrowserRecord, SerializedNodeWithId } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Take a full snapshot of the document, generating the same records that the Kubesense browser SDK
|
|
5
|
+
* would generate.
|
|
6
|
+
*
|
|
7
|
+
* This is an internal API function. Be sure to update kubesense-internal callers if you
|
|
8
|
+
* change its signature or behavior.
|
|
9
|
+
*/
|
|
10
|
+
export declare function takeFullSnapshot({ configuration, }?: {
|
|
11
|
+
configuration?: Partial<RumConfiguration>;
|
|
12
|
+
}): BrowserRecord[];
|
|
13
|
+
/**
|
|
14
|
+
* Take a snapshot of a DOM node, generating the serialized representation that the
|
|
15
|
+
* kubesense browser SDK would generate.
|
|
16
|
+
*
|
|
17
|
+
* This is an internal API function. Be sure to update Kubesense-internal callers if you
|
|
18
|
+
* change its signature or behavior.
|
|
19
|
+
*/
|
|
20
|
+
export declare function takeNodeSnapshot(node: Node, { configuration }?: {
|
|
21
|
+
configuration?: Partial<RumConfiguration>;
|
|
22
|
+
}): SerializedNodeWithId | null;
|