@kubesense/kubesense-browser-rum 1.7.0 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +23 -0
- package/bundle/chunks/kubesenseProfiler-4b8cfd8f889074788478-kubesense-rum.js +1 -0
- package/bundle/chunks/kubesenseRecorder-db948e96649585a2b3e9-kubesense-rum.js +1 -0
- package/bundle/kubesense-rum.js +1 -1
- package/cjs/boot/kubesenseRecorder.d.ts +6 -0
- package/cjs/boot/kubesenseRecorder.js +75 -0
- package/cjs/boot/kubesenseRecorder.js.map +1 -0
- package/cjs/boot/lazyLoadProfiler.d.ts +3 -4
- package/cjs/boot/lazyLoadProfiler.js +18 -50
- package/cjs/boot/lazyLoadProfiler.js.map +1 -1
- package/cjs/boot/lazyLoadRecorder.d.ts +3 -4
- package/cjs/boot/lazyLoadRecorder.js +18 -50
- package/cjs/boot/lazyLoadRecorder.js.map +1 -1
- package/cjs/boot/postStartStrategy.d.ts +4 -4
- package/cjs/boot/postStartStrategy.js +89 -110
- package/cjs/boot/postStartStrategy.js.map +1 -1
- package/cjs/boot/preStartStrategy.js +21 -21
- package/cjs/boot/preStartStrategy.js.map +1 -1
- package/cjs/boot/profilerApi.js +44 -50
- package/cjs/boot/profilerApi.js.map +1 -1
- package/cjs/boot/recorderApi.d.ts +1 -3
- package/cjs/boot/recorderApi.js +41 -71
- package/cjs/boot/recorderApi.js.map +1 -1
- package/cjs/domain/deflate/deflateEncoder.d.ts +1 -2
- package/cjs/domain/deflate/deflateEncoder.js +94 -108
- package/cjs/domain/deflate/deflateEncoder.js.map +1 -1
- package/cjs/domain/deflate/deflateWorker.d.ts +3 -4
- package/cjs/domain/deflate/deflateWorker.js +79 -90
- package/cjs/domain/deflate/deflateWorker.js.map +1 -1
- package/cjs/domain/deflate/index.d.ts +1 -1
- package/cjs/domain/deflate/index.js +5 -10
- package/cjs/domain/getSessionReplayLink.d.ts +3 -2
- package/cjs/domain/getSessionReplayLink.js +17 -31
- package/cjs/domain/getSessionReplayLink.js.map +1 -1
- package/cjs/domain/profiling/actionHistory.d.ts +10 -0
- package/cjs/domain/profiling/actionHistory.js +37 -0
- package/cjs/domain/profiling/actionHistory.js.map +1 -0
- package/cjs/domain/profiling/kubesenseProfiler.d.ts +6 -0
- package/cjs/domain/profiling/kubesenseProfiler.js +243 -0
- package/cjs/domain/profiling/kubesenseProfiler.js.map +1 -0
- package/cjs/domain/profiling/longTaskHistory.d.ts +11 -0
- package/cjs/domain/profiling/longTaskHistory.js +22 -0
- package/cjs/domain/profiling/longTaskHistory.js.map +1 -0
- package/cjs/domain/profiling/profilerDebugIds.d.ts +2 -0
- package/cjs/domain/profiling/profilerDebugIds.js +18 -0
- package/cjs/domain/profiling/profilerDebugIds.js.map +1 -0
- package/cjs/domain/profiling/profilingContext.js +20 -25
- package/cjs/domain/profiling/profilingContext.js.map +1 -1
- package/cjs/domain/profiling/profilingSupported.js +6 -8
- package/cjs/domain/profiling/profilingSupported.js.map +1 -1
- package/cjs/domain/profiling/quotaCheck.d.ts +9 -0
- package/cjs/domain/profiling/quotaCheck.js +66 -0
- package/cjs/domain/profiling/quotaCheck.js.map +1 -0
- package/cjs/domain/profiling/test-utils/mockedTrace.d.ts +1 -1
- package/cjs/domain/profiling/transport/buildProfileEvent.d.ts +38 -0
- package/cjs/domain/profiling/transport/buildProfileEvent.js +91 -0
- package/cjs/domain/profiling/transport/buildProfileEvent.js.map +1 -0
- package/cjs/domain/profiling/transport/formDataEmitter.d.ts +5 -0
- package/cjs/domain/profiling/transport/formDataEmitter.js +17 -0
- package/cjs/domain/profiling/transport/formDataEmitter.js.map +1 -0
- package/cjs/domain/profiling/transport/profilingBridge.d.ts +2 -0
- package/cjs/domain/profiling/transport/profilingBridge.js +12 -0
- package/cjs/domain/profiling/transport/profilingBridge.js.map +1 -0
- package/cjs/domain/profiling/{types/rumProfiler.types.d.ts → types.d.ts} +13 -24
- package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.js +5 -5
- package/cjs/domain/profiling/utils/getCustomOrDefaultViewName.js.map +1 -1
- package/cjs/domain/profiling/utils/getDefaultViewName.js +6 -10
- package/cjs/domain/profiling/utils/getDefaultViewName.js.map +1 -1
- package/cjs/domain/profiling/vitalHistory.d.ts +13 -0
- package/cjs/domain/profiling/vitalHistory.js +56 -0
- package/cjs/domain/profiling/vitalHistory.js.map +1 -0
- package/cjs/domain/record/assembly.d.ts +2 -1
- package/cjs/domain/record/assembly.js +15 -14
- package/cjs/domain/record/assembly.js.map +1 -1
- package/cjs/domain/record/canvas/canvasHash.d.ts +2 -0
- package/cjs/domain/record/canvas/canvasHash.js +33 -0
- package/cjs/domain/record/canvas/canvasHash.js.map +1 -0
- package/cjs/domain/record/canvas/canvasManager.d.ts +42 -0
- package/cjs/domain/record/canvas/canvasManager.js +99 -0
- package/cjs/domain/record/canvas/canvasManager.js.map +1 -0
- package/cjs/domain/record/canvas/canvasSnapshot.d.ts +8 -0
- package/cjs/domain/record/canvas/canvasSnapshot.js +40 -0
- package/cjs/domain/record/canvas/canvasSnapshot.js.map +1 -0
- package/cjs/domain/record/canvas/canvasUtils.d.ts +2 -0
- package/cjs/domain/record/canvas/canvasUtils.js +14 -0
- package/cjs/domain/record/canvas/canvasUtils.js.map +1 -0
- package/cjs/domain/record/elementsScrollPositions.js +17 -20
- package/cjs/domain/record/elementsScrollPositions.js.map +1 -1
- package/cjs/domain/record/encoding/changeDecoder.d.ts +39 -0
- package/cjs/domain/record/encoding/changeDecoder.js +152 -0
- package/cjs/domain/record/encoding/changeDecoder.js.map +1 -0
- package/cjs/domain/record/encoding/changeEncoder.d.ts +39 -0
- package/cjs/domain/record/encoding/changeEncoder.js +146 -0
- package/cjs/domain/record/encoding/changeEncoder.js.map +1 -0
- package/cjs/domain/record/encoding/index.d.ts +10 -0
- package/cjs/domain/record/encoding/itemIds.d.ts +32 -0
- package/cjs/domain/record/encoding/itemIds.js +49 -0
- package/cjs/domain/record/encoding/itemIds.js.map +1 -0
- package/cjs/domain/record/encoding/roles.d.ts +52 -0
- package/cjs/domain/record/encoding/roles.js +66 -0
- package/cjs/domain/record/encoding/roles.js.map +1 -0
- package/cjs/domain/record/encoding/stringIds.d.ts +15 -0
- package/cjs/domain/record/encoding/stringIds.js +47 -0
- package/cjs/domain/record/encoding/stringIds.js.map +1 -0
- package/cjs/domain/record/encoding/stringTable.d.ts +15 -0
- package/cjs/domain/record/encoding/stringTable.js +38 -0
- package/cjs/domain/record/encoding/stringTable.js.map +1 -0
- package/cjs/domain/record/eventsUtils.js +9 -10
- package/cjs/domain/record/eventsUtils.js.map +1 -1
- package/cjs/domain/record/index.d.ts +5 -2
- package/cjs/domain/record/index.js +13 -17
- package/cjs/domain/record/internalApi.d.ts +6 -6
- package/cjs/domain/record/internalApi.js +55 -49
- package/cjs/domain/record/internalApi.js.map +1 -1
- package/cjs/domain/record/mutationBatch.d.ts +1 -0
- package/cjs/domain/record/mutationBatch.js +38 -39
- package/cjs/domain/record/mutationBatch.js.map +1 -1
- package/cjs/domain/record/record.d.ts +7 -1
- package/cjs/domain/record/record.js +76 -87
- package/cjs/domain/record/record.js.map +1 -1
- package/cjs/domain/record/record.types.d.ts +1 -0
- package/cjs/domain/record/recordingScope.d.ts +7 -3
- package/cjs/domain/record/recordingScope.js +25 -11
- package/cjs/domain/record/recordingScope.js.map +1 -1
- package/cjs/domain/record/serialization/index.d.ts +4 -2
- package/cjs/domain/record/serialization/index.js +16 -18
- package/cjs/domain/record/serialization/insertionCursor.d.ts +57 -0
- package/cjs/domain/record/serialization/insertionCursor.js +55 -0
- package/cjs/domain/record/serialization/insertionCursor.js.map +1 -0
- package/cjs/domain/record/serialization/serialization.types.d.ts +0 -6
- package/cjs/domain/record/serialization/serializationStats.js +26 -25
- package/cjs/domain/record/serialization/serializationStats.js.map +1 -1
- package/cjs/domain/record/serialization/serializationTransaction.d.ts +44 -22
- package/cjs/domain/record/serialization/serializationTransaction.js +90 -36
- package/cjs/domain/record/serialization/serializationTransaction.js.map +1 -1
- package/cjs/domain/record/serialization/serializationUtils.d.ts +0 -1
- package/cjs/domain/record/serialization/serializationUtils.js +46 -75
- package/cjs/domain/record/serialization/serializationUtils.js.map +1 -1
- package/cjs/domain/record/serialization/serializeAttribute.js +24 -39
- package/cjs/domain/record/serialization/serializeAttribute.js.map +1 -1
- package/cjs/domain/record/serialization/serializeAttributes.d.ts +2 -2
- package/cjs/domain/record/serialization/serializeAttributes.js +100 -152
- package/cjs/domain/record/serialization/serializeAttributes.js.map +1 -1
- package/cjs/domain/record/serialization/serializeFullSnapshot.d.ts +5 -0
- package/cjs/domain/record/serialization/serializeFullSnapshot.js +14 -0
- package/cjs/domain/record/serialization/serializeFullSnapshot.js.map +1 -0
- package/cjs/domain/record/serialization/serializeMutations.d.ts +5 -0
- package/cjs/domain/record/serialization/serializeMutations.js +152 -0
- package/cjs/domain/record/serialization/serializeMutations.js.map +1 -0
- package/cjs/domain/record/serialization/serializeNode.d.ts +3 -6
- package/cjs/domain/record/serialization/serializeNode.js +116 -144
- package/cjs/domain/record/serialization/serializeNode.js.map +1 -1
- package/cjs/domain/record/shadowRootsController.d.ts +2 -2
- package/cjs/domain/record/shadowRootsController.js +37 -42
- package/cjs/domain/record/shadowRootsController.js.map +1 -1
- package/cjs/domain/record/startFullSnapshots.d.ts +1 -1
- package/cjs/domain/record/startFullSnapshots.js +38 -54
- package/cjs/domain/record/startFullSnapshots.js.map +1 -1
- package/cjs/domain/record/trackers/index.d.ts +2 -1
- package/cjs/domain/record/trackers/index.js +25 -27
- package/cjs/domain/record/trackers/trackCanvasCapture.d.ts +3 -0
- package/cjs/domain/record/trackers/trackCanvasCapture.js +102 -0
- package/cjs/domain/record/trackers/trackCanvasCapture.js.map +1 -0
- package/cjs/domain/record/trackers/trackCanvasContent.d.ts +3 -0
- package/cjs/domain/record/trackers/trackCanvasContent.js +31 -0
- package/cjs/domain/record/trackers/trackCanvasContent.js.map +1 -0
- package/cjs/domain/record/trackers/trackFocus.d.ts +1 -2
- package/cjs/domain/record/trackers/trackFocus.js +15 -13
- package/cjs/domain/record/trackers/trackFocus.js.map +1 -1
- package/cjs/domain/record/trackers/trackInput.d.ts +2 -2
- package/cjs/domain/record/trackers/trackInput.js +129 -102
- package/cjs/domain/record/trackers/trackInput.js.map +1 -1
- package/cjs/domain/record/trackers/trackMediaInteraction.js +22 -26
- package/cjs/domain/record/trackers/trackMediaInteraction.js.map +1 -1
- package/cjs/domain/record/trackers/trackMouseInteraction.js +47 -54
- package/cjs/domain/record/trackers/trackMouseInteraction.js.map +1 -1
- package/cjs/domain/record/trackers/trackMove.js +43 -49
- package/cjs/domain/record/trackers/trackMove.js.map +1 -1
- package/cjs/domain/record/trackers/trackMutation.d.ts +3 -3
- package/cjs/domain/record/trackers/trackMutation.js +42 -267
- package/cjs/domain/record/trackers/trackMutation.js.map +1 -1
- package/cjs/domain/record/trackers/trackScroll.js +36 -44
- package/cjs/domain/record/trackers/trackScroll.js.map +1 -1
- package/cjs/domain/record/trackers/trackStyleSheet.js +75 -84
- package/cjs/domain/record/trackers/trackStyleSheet.js.map +1 -1
- package/cjs/domain/record/trackers/trackViewEnd.js +17 -17
- package/cjs/domain/record/trackers/trackViewEnd.js.map +1 -1
- package/cjs/domain/record/trackers/trackViewportResize.d.ts +2 -3
- package/cjs/domain/record/trackers/trackViewportResize.js +36 -42
- package/cjs/domain/record/trackers/trackViewportResize.js.map +1 -1
- package/cjs/domain/record/viewports.js +32 -50
- package/cjs/domain/record/viewports.js.map +1 -1
- package/cjs/domain/replayStats.d.ts +1 -0
- package/cjs/domain/replayStats.js +36 -44
- package/cjs/domain/replayStats.js.map +1 -1
- package/cjs/domain/scriptLoadingError.js +15 -22
- package/cjs/domain/scriptLoadingError.js.map +1 -1
- package/cjs/domain/segmentCollection/buildReplayPayload.js +22 -23
- package/cjs/domain/segmentCollection/buildReplayPayload.js.map +1 -1
- package/cjs/domain/segmentCollection/buildResourcePayload.d.ts +5 -0
- package/cjs/domain/segmentCollection/buildResourcePayload.js +19 -0
- package/cjs/domain/segmentCollection/buildResourcePayload.js.map +1 -0
- package/cjs/domain/segmentCollection/index.d.ts +3 -0
- package/cjs/domain/segmentCollection/index.js +14 -11
- package/cjs/domain/segmentCollection/replayResourceCollection.d.ts +10 -0
- package/cjs/domain/segmentCollection/replayResourceCollection.js +52 -0
- package/cjs/domain/segmentCollection/replayResourceCollection.js.map +1 -0
- package/cjs/domain/segmentCollection/segment.js +50 -80
- package/cjs/domain/segmentCollection/segment.js.map +1 -1
- package/cjs/domain/segmentCollection/segmentCollection.d.ts +4 -4
- package/cjs/domain/segmentCollection/segmentCollection.js +87 -105
- package/cjs/domain/segmentCollection/segmentCollection.js.map +1 -1
- package/cjs/domain/segmentCollection/startDroppedSegmentRecovery.d.ts +16 -0
- package/cjs/domain/segmentCollection/startDroppedSegmentRecovery.js +29 -0
- package/cjs/domain/segmentCollection/startDroppedSegmentRecovery.js.map +1 -0
- package/cjs/domain/segmentCollection/startSegmentTelemetry.js +40 -42
- package/cjs/domain/segmentCollection/startSegmentTelemetry.js.map +1 -1
- package/cjs/domain/startRecordBridge.js +10 -14
- package/cjs/domain/startRecordBridge.js.map +1 -1
- package/cjs/domain/startRecorderInitTelemetry.js +42 -50
- package/cjs/domain/startRecorderInitTelemetry.js.map +1 -1
- package/cjs/entries/internal.d.ts +11 -2
- package/cjs/entries/internal.js +47 -28
- package/cjs/entries/internalSynthetics.js +26 -24
- package/cjs/entries/internalSynthetics.js.map +1 -1
- package/cjs/entries/main.d.ts +5 -3
- package/cjs/entries/main.js +50 -31
- package/cjs/entries/main.js.map +1 -1
- package/cjs/types/index.d.ts +1 -0
- package/cjs/types/profiling.d.ts +313 -0
- package/cjs/types/sessionReplay.d.ts +381 -3
- package/cjs/types/sessionReplayConstants.d.ts +57 -0
- package/cjs/types/sessionReplayConstants.js +104 -47
- package/cjs/types/sessionReplayConstants.js.map +1 -1
- package/esm/boot/kubesenseRecorder.mjs +75 -0
- package/esm/boot/kubesenseRecorder.mjs.map +1 -0
- package/esm/boot/lazyLoadProfiler.mjs +24 -0
- package/esm/boot/lazyLoadProfiler.mjs.map +1 -0
- package/esm/boot/lazyLoadRecorder.mjs +24 -0
- package/esm/boot/lazyLoadRecorder.mjs.map +1 -0
- package/esm/boot/postStartStrategy.mjs +97 -0
- package/esm/boot/postStartStrategy.mjs.map +1 -0
- package/esm/boot/preStartStrategy.mjs +24 -0
- package/esm/boot/preStartStrategy.mjs.map +1 -0
- package/esm/boot/profilerApi.mjs +47 -0
- package/esm/boot/profilerApi.mjs.map +1 -0
- package/esm/boot/recorderApi.mjs +43 -0
- package/esm/boot/recorderApi.mjs.map +1 -0
- package/esm/domain/deflate/deflateEncoder.mjs +96 -0
- package/esm/domain/deflate/deflateEncoder.mjs.map +1 -0
- package/esm/domain/deflate/deflateWorker.mjs +90 -0
- package/esm/domain/deflate/deflateWorker.mjs.map +1 -0
- package/esm/domain/deflate/index.mjs +3 -0
- package/esm/domain/getSessionReplayLink.mjs +21 -0
- package/esm/domain/getSessionReplayLink.mjs.map +1 -0
- package/esm/domain/profiling/actionHistory.mjs +36 -0
- package/esm/domain/profiling/actionHistory.mjs.map +1 -0
- package/esm/domain/profiling/kubesenseProfiler.mjs +242 -0
- package/esm/domain/profiling/kubesenseProfiler.mjs.map +1 -0
- package/esm/domain/profiling/longTaskHistory.mjs +21 -0
- package/esm/domain/profiling/longTaskHistory.mjs.map +1 -0
- package/esm/domain/profiling/profilerDebugIds.mjs +18 -0
- package/esm/domain/profiling/profilerDebugIds.mjs.map +1 -0
- package/esm/domain/profiling/profilingContext.mjs +23 -0
- package/esm/domain/profiling/profilingContext.mjs.map +1 -0
- package/esm/domain/profiling/profilingSupported.mjs +9 -0
- package/esm/domain/profiling/profilingSupported.mjs.map +1 -0
- package/esm/domain/profiling/quotaCheck.mjs +66 -0
- package/esm/domain/profiling/quotaCheck.mjs.map +1 -0
- package/esm/domain/profiling/transport/buildProfileEvent.mjs +90 -0
- package/esm/domain/profiling/transport/buildProfileEvent.mjs.map +1 -0
- package/esm/domain/profiling/transport/formDataEmitter.mjs +17 -0
- package/esm/domain/profiling/transport/formDataEmitter.mjs.map +1 -0
- package/esm/domain/profiling/transport/profilingBridge.mjs +12 -0
- package/esm/domain/profiling/transport/profilingBridge.mjs.map +1 -0
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.mjs +7 -0
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.mjs.map +1 -0
- package/esm/domain/profiling/utils/getDefaultViewName.mjs +10 -0
- package/esm/domain/profiling/utils/getDefaultViewName.mjs.map +1 -0
- package/esm/domain/profiling/vitalHistory.mjs +55 -0
- package/esm/domain/profiling/vitalHistory.mjs.map +1 -0
- package/esm/domain/record/assembly.mjs +17 -0
- package/esm/domain/record/assembly.mjs.map +1 -0
- package/esm/domain/record/canvas/canvasHash.mjs +33 -0
- package/esm/domain/record/canvas/canvasHash.mjs.map +1 -0
- package/esm/domain/record/canvas/canvasManager.mjs +99 -0
- package/esm/domain/record/canvas/canvasManager.mjs.map +1 -0
- package/esm/domain/record/canvas/canvasSnapshot.mjs +38 -0
- package/esm/domain/record/canvas/canvasSnapshot.mjs.map +1 -0
- package/esm/domain/record/canvas/canvasUtils.mjs +13 -0
- package/esm/domain/record/canvas/canvasUtils.mjs.map +1 -0
- package/esm/domain/record/elementsScrollPositions.mjs +20 -0
- package/esm/domain/record/elementsScrollPositions.mjs.map +1 -0
- package/esm/domain/record/encoding/changeDecoder.mjs +152 -0
- package/esm/domain/record/encoding/changeDecoder.mjs.map +1 -0
- package/esm/domain/record/encoding/changeEncoder.mjs +146 -0
- package/esm/domain/record/encoding/changeEncoder.mjs.map +1 -0
- package/esm/domain/record/encoding/itemIds.mjs +47 -0
- package/esm/domain/record/encoding/itemIds.mjs.map +1 -0
- package/esm/domain/record/encoding/roles.mjs +64 -0
- package/esm/domain/record/encoding/roles.mjs.map +1 -0
- package/esm/domain/record/encoding/stringIds.mjs +47 -0
- package/esm/domain/record/encoding/stringIds.mjs.map +1 -0
- package/esm/domain/record/encoding/stringTable.mjs +38 -0
- package/esm/domain/record/encoding/stringTable.mjs.map +1 -0
- package/esm/domain/record/eventsUtils.mjs +13 -0
- package/esm/domain/record/eventsUtils.mjs.map +1 -0
- package/esm/domain/record/index.mjs +8 -0
- package/esm/domain/record/internalApi.mjs +62 -0
- package/esm/domain/record/internalApi.mjs.map +1 -0
- package/esm/domain/record/mutationBatch.mjs +43 -0
- package/esm/domain/record/mutationBatch.mjs.map +1 -0
- package/esm/domain/record/record.mjs +79 -0
- package/esm/domain/record/record.mjs.map +1 -0
- package/esm/domain/record/recordingScope.mjs +27 -0
- package/esm/domain/record/recordingScope.mjs.map +1 -0
- package/esm/domain/record/serialization/index.mjs +9 -0
- package/esm/domain/record/serialization/insertionCursor.mjs +54 -0
- package/esm/domain/record/serialization/insertionCursor.mjs.map +1 -0
- package/esm/domain/record/serialization/serializationStats.mjs +31 -0
- package/esm/domain/record/serialization/serializationStats.mjs.map +1 -0
- package/esm/domain/record/serialization/serializationTransaction.mjs +92 -0
- package/esm/domain/record/serialization/serializationTransaction.mjs.map +1 -0
- package/esm/domain/record/serialization/serializationUtils.mjs +53 -0
- package/esm/domain/record/serialization/serializationUtils.mjs.map +1 -0
- package/esm/domain/record/serialization/serializeAttribute.mjs +26 -0
- package/esm/domain/record/serialization/serializeAttribute.mjs.map +1 -0
- package/esm/domain/record/serialization/serializeAttributes.mjs +113 -0
- package/esm/domain/record/serialization/serializeAttributes.mjs.map +1 -0
- package/esm/domain/record/serialization/serializeFullSnapshot.mjs +14 -0
- package/esm/domain/record/serialization/serializeFullSnapshot.mjs.map +1 -0
- package/esm/domain/record/serialization/serializeMutations.mjs +152 -0
- package/esm/domain/record/serialization/serializeMutations.mjs.map +1 -0
- package/esm/domain/record/serialization/serializeNode.mjs +126 -0
- package/esm/domain/record/serialization/serializeNode.mjs.map +1 -0
- package/esm/domain/record/shadowRootsController.mjs +40 -0
- package/esm/domain/record/shadowRootsController.mjs.map +1 -0
- package/esm/domain/record/startFullSnapshots.mjs +42 -0
- package/esm/domain/record/startFullSnapshots.mjs.map +1 -0
- package/esm/domain/record/trackers/index.mjs +13 -0
- package/esm/domain/record/trackers/trackCanvasCapture.mjs +102 -0
- package/esm/domain/record/trackers/trackCanvasCapture.mjs.map +1 -0
- package/esm/domain/record/trackers/trackCanvasContent.mjs +31 -0
- package/esm/domain/record/trackers/trackCanvasContent.mjs.map +1 -0
- package/esm/domain/record/trackers/trackFocus.mjs +17 -0
- package/esm/domain/record/trackers/trackFocus.mjs.map +1 -0
- package/esm/domain/record/trackers/trackInput.mjs +131 -0
- package/esm/domain/record/trackers/trackInput.mjs.map +1 -0
- package/esm/domain/record/trackers/trackMediaInteraction.mjs +25 -0
- package/esm/domain/record/trackers/trackMediaInteraction.mjs.map +1 -0
- package/esm/domain/record/trackers/trackMouseInteraction.mjs +52 -0
- package/esm/domain/record/trackers/trackMouseInteraction.mjs.map +1 -0
- package/esm/domain/record/trackers/trackMove.mjs +48 -0
- package/esm/domain/record/trackers/trackMove.mjs.map +1 -0
- package/esm/domain/record/trackers/trackMutation.mjs +45 -0
- package/esm/domain/record/trackers/trackMutation.mjs.map +1 -0
- package/esm/domain/record/trackers/trackScroll.mjs +40 -0
- package/esm/domain/record/trackers/trackScroll.mjs.map +1 -0
- package/esm/domain/record/trackers/trackStyleSheet.mjs +79 -0
- package/esm/domain/record/trackers/trackStyleSheet.mjs.map +1 -0
- package/esm/domain/record/trackers/trackViewEnd.mjs +20 -0
- package/esm/domain/record/trackers/trackViewEnd.mjs.map +1 -0
- package/esm/domain/record/trackers/trackViewportResize.mjs +39 -0
- package/esm/domain/record/trackers/trackViewportResize.mjs.map +1 -0
- package/esm/domain/record/viewports.mjs +41 -0
- package/esm/domain/record/viewports.mjs.map +1 -0
- package/esm/domain/replayStats.mjs +46 -0
- package/esm/domain/replayStats.mjs.map +1 -0
- package/esm/domain/scriptLoadingError.mjs +19 -0
- package/esm/domain/scriptLoadingError.mjs.map +1 -0
- package/esm/domain/segmentCollection/buildReplayPayload.mjs +25 -0
- package/esm/domain/segmentCollection/buildReplayPayload.mjs.map +1 -0
- package/esm/domain/segmentCollection/buildResourcePayload.mjs +19 -0
- package/esm/domain/segmentCollection/buildResourcePayload.mjs.map +1 -0
- package/esm/domain/segmentCollection/index.mjs +5 -0
- package/esm/domain/segmentCollection/replayResourceCollection.mjs +52 -0
- package/esm/domain/segmentCollection/replayResourceCollection.mjs.map +1 -0
- package/esm/domain/segmentCollection/segment.mjs +52 -0
- package/esm/domain/segmentCollection/segment.mjs.map +1 -0
- package/esm/domain/segmentCollection/segmentCollection.mjs +87 -0
- package/esm/domain/segmentCollection/segmentCollection.mjs.map +1 -0
- package/esm/domain/segmentCollection/startDroppedSegmentRecovery.mjs +28 -0
- package/esm/domain/segmentCollection/startDroppedSegmentRecovery.mjs.map +1 -0
- package/esm/domain/segmentCollection/startSegmentTelemetry.mjs +45 -0
- package/esm/domain/segmentCollection/startSegmentTelemetry.mjs.map +1 -0
- package/esm/domain/startRecordBridge.mjs +13 -0
- package/esm/domain/startRecordBridge.mjs.map +1 -0
- package/esm/domain/startRecorderInitTelemetry.mjs +47 -0
- package/esm/domain/startRecorderInitTelemetry.mjs.map +1 -0
- package/esm/entries/internal.mjs +8 -0
- package/esm/entries/internalSynthetics.mjs +22 -0
- package/esm/entries/internalSynthetics.mjs.map +1 -0
- package/esm/entries/main.mjs +35 -0
- package/esm/entries/main.mjs.map +1 -0
- package/esm/types/sessionReplayConstants.mjs +97 -0
- package/esm/types/sessionReplayConstants.mjs.map +1 -0
- package/internal/package.json +1 -1
- package/internal-synthetics/package.json +1 -1
- package/package.json +26 -15
- package/src/boot/kubesenseRecorder.ts +134 -0
- package/src/boot/lazyLoadProfiler.ts +6 -7
- package/src/boot/lazyLoadRecorder.ts +6 -7
- package/src/boot/postStartStrategy.ts +18 -16
- package/src/boot/profilerApi.ts +29 -19
- package/src/boot/recorderApi.ts +6 -21
- package/src/domain/deflate/deflateEncoder.ts +3 -8
- package/src/domain/deflate/deflateWorker.ts +8 -13
- package/src/domain/deflate/index.ts +1 -0
- package/src/domain/getSessionReplayLink.ts +15 -11
- package/src/domain/profiling/actionHistory.ts +66 -0
- package/src/domain/profiling/{profiler.ts → kubesenseProfiler.ts} +166 -79
- package/src/domain/profiling/longTaskHistory.ts +45 -0
- package/src/domain/profiling/profilerDebugIds.ts +17 -0
- package/src/domain/profiling/profilingContext.ts +8 -3
- package/src/domain/profiling/profilingSupported.ts +2 -7
- package/src/domain/profiling/quotaCheck.ts +89 -0
- package/src/domain/profiling/test-utils/mockedTrace.ts +1 -2
- package/src/domain/profiling/transport/buildProfileEvent.ts +143 -0
- package/src/domain/profiling/transport/formDataEmitter.ts +17 -0
- package/src/domain/profiling/transport/profilingBridge.ts +9 -0
- package/src/domain/profiling/{types/rumProfiler.types.ts → types.ts} +14 -26
- package/src/domain/profiling/vitalHistory.ts +106 -0
- package/src/domain/record/assembly.ts +5 -3
- package/src/domain/record/canvas/canvasHash.ts +54 -0
- package/src/domain/record/canvas/canvasManager.ts +175 -0
- package/src/domain/record/canvas/canvasSnapshot.ts +52 -0
- package/src/domain/record/canvas/canvasUtils.ts +11 -0
- package/src/domain/record/encoding/changeDecoder.ts +287 -0
- package/src/domain/record/encoding/changeEncoder.ts +327 -0
- package/src/domain/record/encoding/index.ts +19 -0
- package/src/domain/record/encoding/itemIds.ts +84 -0
- package/src/domain/record/encoding/roles.ts +136 -0
- package/src/domain/record/encoding/stringIds.ts +70 -0
- package/src/domain/record/encoding/stringTable.ts +68 -0
- package/src/domain/record/index.ts +5 -2
- package/src/domain/record/internalApi.ts +21 -18
- package/src/domain/record/mutationBatch.ts +14 -3
- package/src/domain/record/record.ts +35 -16
- package/src/domain/record/record.types.ts +1 -0
- package/src/domain/record/recordingScope.ts +28 -5
- package/src/domain/record/serialization/index.ts +4 -2
- package/src/domain/record/serialization/insertionCursor.ts +131 -0
- package/src/domain/record/serialization/serialization.types.ts +0 -16
- package/src/domain/record/serialization/serializationTransaction.ts +191 -37
- package/src/domain/record/serialization/serializationUtils.ts +1 -15
- package/src/domain/record/serialization/serializeAttributes.ts +36 -32
- package/src/domain/record/serialization/serializeFullSnapshot.ts +26 -0
- package/src/domain/record/serialization/serializeMutations.ts +357 -0
- package/src/domain/record/serialization/serializeNode.ts +200 -164
- package/src/domain/record/shadowRootsController.ts +4 -3
- package/src/domain/record/startFullSnapshots.ts +28 -41
- package/src/domain/record/trackers/index.ts +2 -1
- package/src/domain/record/trackers/trackCanvasCapture.ts +137 -0
- package/src/domain/record/trackers/trackCanvasContent.ts +46 -0
- package/src/domain/record/trackers/trackFocus.ts +4 -4
- package/src/domain/record/trackers/trackInput.ts +146 -41
- package/src/domain/record/trackers/trackMediaInteraction.ts +0 -1
- package/src/domain/record/trackers/trackMouseInteraction.ts +1 -2
- package/src/domain/record/trackers/trackMove.ts +0 -1
- package/src/domain/record/trackers/trackMutation.ts +17 -355
- package/src/domain/record/trackers/trackScroll.ts +1 -1
- package/src/domain/record/trackers/trackStyleSheet.ts +1 -1
- package/src/domain/record/trackers/trackViewEnd.ts +1 -1
- package/src/domain/record/trackers/trackViewportResize.ts +7 -16
- package/src/domain/record/trackers/tracker.types.ts +1 -1
- package/src/domain/replayStats.ts +5 -0
- package/src/domain/scriptLoadingError.ts +2 -1
- package/src/domain/segmentCollection/buildResourcePayload.ts +20 -0
- package/src/domain/segmentCollection/index.ts +3 -0
- package/src/domain/segmentCollection/replayResourceCollection.ts +79 -0
- package/src/domain/segmentCollection/segment.ts +2 -1
- package/src/domain/segmentCollection/segmentCollection.ts +14 -13
- package/src/domain/segmentCollection/startDroppedSegmentRecovery.ts +37 -0
- package/src/domain/segmentCollection/startSegmentTelemetry.ts +16 -2
- package/src/domain/startRecorderInitTelemetry.ts +5 -3
- package/src/entries/internal.ts +13 -2
- package/src/entries/internalSynthetics.ts +3 -4
- package/src/entries/main.ts +23 -14
- package/src/types/index.ts +1 -0
- package/src/types/profiling.ts +315 -0
- package/src/types/sessionReplay.ts +395 -3
- package/src/types/sessionReplayConstants.ts +109 -0
- package/bundle/chunks/profiler-6f621c66a29d9f39a9bd-kubesense-rum.js +0 -1
- package/bundle/chunks/recorder-c73b8d42b98d4a01f120-kubesense-rum.js +0 -1
- package/cjs/boot/isBrowserSupported.d.ts +0 -4
- package/cjs/boot/isBrowserSupported.js +0 -17
- package/cjs/boot/isBrowserSupported.js.map +0 -1
- package/cjs/boot/startRecording.d.ts +0 -6
- package/cjs/boot/startRecording.js +0 -45
- package/cjs/boot/startRecording.js.map +0 -1
- package/cjs/domain/deflate/index.js.map +0 -1
- package/cjs/domain/profiling/profiler.d.ts +0 -7
- package/cjs/domain/profiling/profiler.js +0 -244
- package/cjs/domain/profiling/profiler.js.map +0 -1
- package/cjs/domain/profiling/test-utils/mockedTrace.js +0 -57
- package/cjs/domain/profiling/test-utils/mockedTrace.js.map +0 -1
- package/cjs/domain/profiling/transport/assembly.d.ts +0 -21
- package/cjs/domain/profiling/transport/assembly.js +0 -45
- package/cjs/domain/profiling/transport/assembly.js.map +0 -1
- package/cjs/domain/profiling/transport/buildProfileEventAttributes.d.ts +0 -25
- package/cjs/domain/profiling/transport/buildProfileEventAttributes.js +0 -50
- package/cjs/domain/profiling/transport/buildProfileEventAttributes.js.map +0 -1
- package/cjs/domain/profiling/types/index.d.ts +0 -2
- package/cjs/domain/profiling/types/index.js +0 -3
- package/cjs/domain/profiling/types/index.js.map +0 -1
- package/cjs/domain/profiling/types/profilerApi.types.d.ts +0 -58
- package/cjs/domain/profiling/types/profilerApi.types.js +0 -5
- package/cjs/domain/profiling/types/profilerApi.types.js.map +0 -1
- package/cjs/domain/profiling/types/rumProfiler.types.js +0 -3
- package/cjs/domain/profiling/types/rumProfiler.types.js.map +0 -1
- package/cjs/domain/profiling/utils/getNumberOfSamples.d.ts +0 -7
- package/cjs/domain/profiling/utils/getNumberOfSamples.js +0 -18
- package/cjs/domain/profiling/utils/getNumberOfSamples.js.map +0 -1
- package/cjs/domain/record/eventIds.d.ts +0 -4
- package/cjs/domain/record/eventIds.js +0 -16
- package/cjs/domain/record/eventIds.js.map +0 -1
- package/cjs/domain/record/index.js.map +0 -1
- package/cjs/domain/record/nodeIds.d.ts +0 -15
- package/cjs/domain/record/nodeIds.js +0 -32
- package/cjs/domain/record/nodeIds.js.map +0 -1
- package/cjs/domain/record/record.types.js +0 -3
- package/cjs/domain/record/record.types.js.map +0 -1
- package/cjs/domain/record/serialization/index.js.map +0 -1
- package/cjs/domain/record/serialization/serialization.types.js +0 -3
- package/cjs/domain/record/serialization/serialization.types.js.map +0 -1
- package/cjs/domain/record/serialization/serializeDocument.d.ts +0 -3
- package/cjs/domain/record/serialization/serializeDocument.js +0 -11
- package/cjs/domain/record/serialization/serializeDocument.js.map +0 -1
- package/cjs/domain/record/serialization/serializeStyleSheets.d.ts +0 -2
- package/cjs/domain/record/serialization/serializeStyleSheets.js +0 -19
- package/cjs/domain/record/serialization/serializeStyleSheets.js.map +0 -1
- package/cjs/domain/record/trackers/index.js.map +0 -1
- package/cjs/domain/record/trackers/trackFrustration.d.ts +0 -7
- package/cjs/domain/record/trackers/trackFrustration.js +0 -31
- package/cjs/domain/record/trackers/trackFrustration.js.map +0 -1
- package/cjs/domain/record/trackers/tracker.types.js +0 -3
- package/cjs/domain/record/trackers/tracker.types.js.map +0 -1
- package/cjs/domain/segmentCollection/index.js.map +0 -1
- package/cjs/entries/internal.js.map +0 -1
- package/cjs/types/index.js +0 -18
- package/cjs/types/index.js.map +0 -1
- package/cjs/types/sessionReplay.js +0 -7
- package/cjs/types/sessionReplay.js.map +0 -1
- package/esm/boot/isBrowserSupported.d.ts +0 -4
- package/esm/boot/isBrowserSupported.js +0 -14
- package/esm/boot/isBrowserSupported.js.map +0 -1
- package/esm/boot/lazyLoadProfiler.d.ts +0 -4
- package/esm/boot/lazyLoadProfiler.js +0 -18
- package/esm/boot/lazyLoadProfiler.js.map +0 -1
- package/esm/boot/lazyLoadRecorder.d.ts +0 -4
- package/esm/boot/lazyLoadRecorder.js +0 -18
- package/esm/boot/lazyLoadRecorder.js.map +0 -1
- package/esm/boot/postStartStrategy.d.ts +0 -33
- package/esm/boot/postStartStrategy.js +0 -115
- package/esm/boot/postStartStrategy.js.map +0 -1
- package/esm/boot/preStartStrategy.d.ts +0 -6
- package/esm/boot/preStartStrategy.js +0 -21
- package/esm/boot/preStartStrategy.js.map +0 -1
- package/esm/boot/profilerApi.d.ts +0 -2
- package/esm/boot/profilerApi.js +0 -50
- package/esm/boot/profilerApi.js.map +0 -1
- package/esm/boot/recorderApi.d.ts +0 -4
- package/esm/boot/recorderApi.js +0 -70
- package/esm/boot/recorderApi.js.map +0 -1
- package/esm/boot/startRecording.d.ts +0 -6
- package/esm/boot/startRecording.js +0 -42
- package/esm/boot/startRecording.js.map +0 -1
- package/esm/domain/deflate/deflateEncoder.d.ts +0 -3
- package/esm/domain/deflate/deflateEncoder.js +0 -107
- package/esm/domain/deflate/deflateEncoder.js.map +0 -1
- package/esm/domain/deflate/deflateWorker.d.ts +0 -30
- package/esm/domain/deflate/deflateWorker.js +0 -97
- package/esm/domain/deflate/deflateWorker.js.map +0 -1
- package/esm/domain/deflate/index.d.ts +0 -3
- package/esm/domain/deflate/index.js +0 -3
- package/esm/domain/deflate/index.js.map +0 -1
- package/esm/domain/getSessionReplayLink.d.ts +0 -2
- package/esm/domain/getSessionReplayLink.js +0 -32
- package/esm/domain/getSessionReplayLink.js.map +0 -1
- package/esm/domain/profiling/profiler.d.ts +0 -7
- package/esm/domain/profiling/profiler.js +0 -240
- package/esm/domain/profiling/profiler.js.map +0 -1
- package/esm/domain/profiling/profilingContext.d.ts +0 -6
- package/esm/domain/profiling/profilingContext.js +0 -25
- package/esm/domain/profiling/profilingContext.js.map +0 -1
- package/esm/domain/profiling/profilingSupported.d.ts +0 -1
- package/esm/domain/profiling/profilingSupported.js +0 -8
- package/esm/domain/profiling/profilingSupported.js.map +0 -1
- package/esm/domain/profiling/test-utils/mockedTrace.d.ts +0 -3
- package/esm/domain/profiling/test-utils/mockedTrace.js +0 -54
- package/esm/domain/profiling/test-utils/mockedTrace.js.map +0 -1
- package/esm/domain/profiling/transport/assembly.d.ts +0 -21
- package/esm/domain/profiling/transport/assembly.js +0 -42
- package/esm/domain/profiling/transport/assembly.js.map +0 -1
- package/esm/domain/profiling/transport/buildProfileEventAttributes.d.ts +0 -25
- package/esm/domain/profiling/transport/buildProfileEventAttributes.js +0 -47
- package/esm/domain/profiling/transport/buildProfileEventAttributes.js.map +0 -1
- package/esm/domain/profiling/types/index.d.ts +0 -2
- package/esm/domain/profiling/types/index.js +0 -2
- package/esm/domain/profiling/types/index.js.map +0 -1
- package/esm/domain/profiling/types/profilerApi.types.d.ts +0 -58
- package/esm/domain/profiling/types/profilerApi.types.js +0 -4
- package/esm/domain/profiling/types/profilerApi.types.js.map +0 -1
- package/esm/domain/profiling/types/rumProfiler.types.d.ts +0 -72
- package/esm/domain/profiling/types/rumProfiler.types.js +0 -2
- package/esm/domain/profiling/types/rumProfiler.types.js.map +0 -1
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.d.ts +0 -1
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.js +0 -3
- package/esm/domain/profiling/utils/getCustomOrDefaultViewName.js.map +0 -1
- package/esm/domain/profiling/utils/getDefaultViewName.d.ts +0 -1
- package/esm/domain/profiling/utils/getDefaultViewName.js +0 -11
- package/esm/domain/profiling/utils/getDefaultViewName.js.map +0 -1
- package/esm/domain/profiling/utils/getNumberOfSamples.d.ts +0 -7
- package/esm/domain/profiling/utils/getNumberOfSamples.js +0 -15
- package/esm/domain/profiling/utils/getNumberOfSamples.js.map +0 -1
- package/esm/domain/record/assembly.d.ts +0 -2
- package/esm/domain/record/assembly.js +0 -13
- package/esm/domain/record/assembly.js.map +0 -1
- package/esm/domain/record/elementsScrollPositions.d.ts +0 -10
- package/esm/domain/record/elementsScrollPositions.js +0 -20
- package/esm/domain/record/elementsScrollPositions.js.map +0 -1
- package/esm/domain/record/eventIds.d.ts +0 -4
- package/esm/domain/record/eventIds.js +0 -13
- package/esm/domain/record/eventIds.js.map +0 -1
- package/esm/domain/record/eventsUtils.d.ts +0 -2
- package/esm/domain/record/eventsUtils.js +0 -11
- package/esm/domain/record/eventsUtils.js.map +0 -1
- package/esm/domain/record/index.d.ts +0 -7
- package/esm/domain/record/index.js +0 -6
- package/esm/domain/record/index.js.map +0 -1
- package/esm/domain/record/internalApi.d.ts +0 -22
- package/esm/domain/record/internalApi.js +0 -53
- package/esm/domain/record/internalApi.js.map +0 -1
- package/esm/domain/record/mutationBatch.d.ts +0 -12
- package/esm/domain/record/mutationBatch.js +0 -40
- package/esm/domain/record/mutationBatch.js.map +0 -1
- package/esm/domain/record/nodeIds.d.ts +0 -15
- package/esm/domain/record/nodeIds.js +0 -29
- package/esm/domain/record/nodeIds.js.map +0 -1
- package/esm/domain/record/record.d.ts +0 -16
- package/esm/domain/record/record.js +0 -54
- package/esm/domain/record/record.js.map +0 -1
- package/esm/domain/record/record.types.d.ts +0 -4
- package/esm/domain/record/record.types.js +0 -2
- package/esm/domain/record/record.types.js.map +0 -1
- package/esm/domain/record/recordingScope.d.ts +0 -19
- package/esm/domain/record/recordingScope.js +0 -10
- package/esm/domain/record/recordingScope.js.map +0 -1
- package/esm/domain/record/serialization/index.d.ts +0 -8
- package/esm/domain/record/serialization/index.js +0 -7
- package/esm/domain/record/serialization/index.js.map +0 -1
- package/esm/domain/record/serialization/serialization.types.d.ts +0 -28
- package/esm/domain/record/serialization/serialization.types.js +0 -2
- package/esm/domain/record/serialization/serialization.types.js.map +0 -1
- package/esm/domain/record/serialization/serializationStats.d.ts +0 -12
- package/esm/domain/record/serialization/serializationStats.js +0 -27
- package/esm/domain/record/serialization/serializationStats.js.map +0 -1
- package/esm/domain/record/serialization/serializationTransaction.d.ts +0 -45
- package/esm/domain/record/serialization/serializationTransaction.js +0 -35
- package/esm/domain/record/serialization/serializationTransaction.js.map +0 -1
- package/esm/domain/record/serialization/serializationUtils.d.ts +0 -18
- package/esm/domain/record/serialization/serializationUtils.js +0 -80
- package/esm/domain/record/serialization/serializationUtils.js.map +0 -1
- package/esm/domain/record/serialization/serializeAttribute.d.ts +0 -4
- package/esm/domain/record/serialization/serializeAttribute.js +0 -38
- package/esm/domain/record/serialization/serializeAttribute.js.map +0 -1
- package/esm/domain/record/serialization/serializeAttributes.d.ts +0 -7
- package/esm/domain/record/serialization/serializeAttributes.js +0 -161
- package/esm/domain/record/serialization/serializeAttributes.js.map +0 -1
- package/esm/domain/record/serialization/serializeDocument.d.ts +0 -3
- package/esm/domain/record/serialization/serializeDocument.js +0 -8
- package/esm/domain/record/serialization/serializeDocument.js.map +0 -1
- package/esm/domain/record/serialization/serializeNode.d.ts +0 -7
- package/esm/domain/record/serialization/serializeNode.js +0 -149
- package/esm/domain/record/serialization/serializeNode.js.map +0 -1
- package/esm/domain/record/serialization/serializeStyleSheets.d.ts +0 -2
- package/esm/domain/record/serialization/serializeStyleSheets.js +0 -16
- package/esm/domain/record/serialization/serializeStyleSheets.js.map +0 -1
- package/esm/domain/record/shadowRootsController.d.ts +0 -11
- package/esm/domain/record/shadowRootsController.js +0 -41
- package/esm/domain/record/shadowRootsController.js.map +0 -1
- package/esm/domain/record/startFullSnapshots.d.ts +0 -9
- package/esm/domain/record/startFullSnapshots.js +0 -55
- package/esm/domain/record/startFullSnapshots.js.map +0 -1
- package/esm/domain/record/trackers/index.d.ts +0 -12
- package/esm/domain/record/trackers/index.js +0 -12
- package/esm/domain/record/trackers/index.js.map +0 -1
- package/esm/domain/record/trackers/trackFocus.d.ts +0 -5
- package/esm/domain/record/trackers/trackFocus.js +0 -12
- package/esm/domain/record/trackers/trackFocus.js.map +0 -1
- package/esm/domain/record/trackers/trackFrustration.d.ts +0 -7
- package/esm/domain/record/trackers/trackFrustration.js +0 -28
- package/esm/domain/record/trackers/trackFrustration.js.map +0 -1
- package/esm/domain/record/trackers/trackInput.d.ts +0 -4
- package/esm/domain/record/trackers/trackInput.js +0 -101
- package/esm/domain/record/trackers/trackInput.js.map +0 -1
- package/esm/domain/record/trackers/trackMediaInteraction.d.ts +0 -5
- package/esm/domain/record/trackers/trackMediaInteraction.js +0 -26
- package/esm/domain/record/trackers/trackMediaInteraction.js.map +0 -1
- package/esm/domain/record/trackers/trackMouseInteraction.d.ts +0 -5
- package/esm/domain/record/trackers/trackMouseInteraction.js +0 -56
- package/esm/domain/record/trackers/trackMouseInteraction.js.map +0 -1
- package/esm/domain/record/trackers/trackMove.d.ts +0 -9
- package/esm/domain/record/trackers/trackMove.js +0 -51
- package/esm/domain/record/trackers/trackMove.js.map +0 -1
- package/esm/domain/record/trackers/trackMutation.d.ts +0 -11
- package/esm/domain/record/trackers/trackMutation.js +0 -266
- package/esm/domain/record/trackers/trackMutation.js.map +0 -1
- package/esm/domain/record/trackers/trackScroll.d.ts +0 -5
- package/esm/domain/record/trackers/trackScroll.js +0 -45
- package/esm/domain/record/trackers/trackScroll.js.map +0 -1
- package/esm/domain/record/trackers/trackStyleSheet.d.ts +0 -6
- package/esm/domain/record/trackers/trackStyleSheet.js +0 -85
- package/esm/domain/record/trackers/trackStyleSheet.js.map +0 -1
- package/esm/domain/record/trackers/trackViewEnd.d.ts +0 -5
- package/esm/domain/record/trackers/trackViewEnd.js +0 -17
- package/esm/domain/record/trackers/trackViewEnd.js.map +0 -1
- package/esm/domain/record/trackers/trackViewportResize.d.ts +0 -6
- package/esm/domain/record/trackers/trackViewportResize.js +0 -42
- package/esm/domain/record/trackers/trackViewportResize.js.map +0 -1
- package/esm/domain/record/trackers/tracker.types.d.ts +0 -3
- package/esm/domain/record/trackers/tracker.types.js +0 -2
- package/esm/domain/record/trackers/tracker.types.js.map +0 -1
- package/esm/domain/record/viewports.d.ts +0 -20
- package/esm/domain/record/viewports.js +0 -55
- package/esm/domain/record/viewports.js.map +0 -1
- package/esm/domain/replayStats.d.ts +0 -8
- package/esm/domain/replayStats.js +0 -51
- package/esm/domain/replayStats.js.map +0 -1
- package/esm/domain/scriptLoadingError.d.ts +0 -6
- package/esm/domain/scriptLoadingError.js +0 -23
- package/esm/domain/scriptLoadingError.js.map +0 -1
- package/esm/domain/segmentCollection/buildReplayPayload.d.ts +0 -15
- package/esm/domain/segmentCollection/buildReplayPayload.js +0 -23
- package/esm/domain/segmentCollection/buildReplayPayload.js.map +0 -1
- package/esm/domain/segmentCollection/index.d.ts +0 -4
- package/esm/domain/segmentCollection/index.js +0 -4
- package/esm/domain/segmentCollection/index.js.map +0 -1
- package/esm/domain/segmentCollection/segment.d.ts +0 -16
- package/esm/domain/segmentCollection/segment.js +0 -46
- package/esm/domain/segmentCollection/segment.js.map +0 -1
- package/esm/domain/segmentCollection/segmentCollection.d.ts +0 -31
- package/esm/domain/segmentCollection/segmentCollection.js +0 -106
- package/esm/domain/segmentCollection/segmentCollection.js.map +0 -1
- package/esm/domain/segmentCollection/startSegmentTelemetry.d.ts +0 -6
- package/esm/domain/segmentCollection/startSegmentTelemetry.js +0 -44
- package/esm/domain/segmentCollection/startSegmentTelemetry.js.map +0 -1
- package/esm/domain/startRecordBridge.d.ts +0 -5
- package/esm/domain/startRecordBridge.js +0 -14
- package/esm/domain/startRecordBridge.js.map +0 -1
- package/esm/domain/startRecorderInitTelemetry.d.ts +0 -15
- package/esm/domain/startRecorderInitTelemetry.js +0 -52
- package/esm/domain/startRecorderInitTelemetry.js.map +0 -1
- package/esm/entries/internal.d.ts +0 -11
- package/esm/entries/internal.js +0 -4
- package/esm/entries/internal.js.map +0 -1
- package/esm/entries/internalSynthetics.d.ts +0 -2
- package/esm/entries/internalSynthetics.js +0 -23
- package/esm/entries/internalSynthetics.js.map +0 -1
- package/esm/entries/main.d.ts +0 -23
- package/esm/entries/main.js +0 -31
- package/esm/entries/main.js.map +0 -1
- package/esm/types/index.d.ts +0 -2
- package/esm/types/index.js +0 -2
- package/esm/types/index.js.map +0 -1
- package/esm/types/sessionReplay.d.ts +0 -703
- package/esm/types/sessionReplay.js +0 -6
- package/esm/types/sessionReplay.js.map +0 -1
- package/esm/types/sessionReplayConstants.d.ts +0 -49
- package/esm/types/sessionReplayConstants.js +0 -46
- package/esm/types/sessionReplayConstants.js.map +0 -1
- package/src/boot/isBrowserSupported.ts +0 -14
- package/src/boot/startRecording.ts +0 -70
- package/src/domain/profiling/transport/assembly.ts +0 -78
- package/src/domain/profiling/transport/buildProfileEventAttributes.ts +0 -66
- package/src/domain/profiling/types/index.ts +0 -2
- package/src/domain/profiling/types/profilerApi.types.ts +0 -87
- package/src/domain/profiling/utils/getNumberOfSamples.ts +0 -16
- package/src/domain/record/eventIds.ts +0 -17
- package/src/domain/record/nodeIds.ts +0 -46
- package/src/domain/record/serialization/serializeDocument.ts +0 -13
- package/src/domain/record/serialization/serializeStyleSheets.ts +0 -18
- package/src/domain/record/trackers/trackFrustration.ts +0 -41
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.startRecording = startRecording;
|
|
4
|
-
const kubesense_browser_core_1 = require("@kubesense/kubesense-browser-core");
|
|
5
|
-
const record_1 = require("../domain/record");
|
|
6
|
-
const segmentCollection_1 = require("../domain/segmentCollection");
|
|
7
|
-
const startRecordBridge_1 = require("../domain/startRecordBridge");
|
|
8
|
-
function startRecording(lifeCycle, configuration, sessionManager, viewHistory, encoder, telemetry, httpRequest) {
|
|
9
|
-
const cleanupTasks = [];
|
|
10
|
-
const reportError = (error) => {
|
|
11
|
-
lifeCycle.notify(14 /* LifeCycleEventType.RAW_ERROR_COLLECTED */, { error });
|
|
12
|
-
// monitor-until: forever, to keep an eye on the errors reported to customers
|
|
13
|
-
(0, kubesense_browser_core_1.addTelemetryDebug)('Error reported to customer', { 'error.message': error.message });
|
|
14
|
-
};
|
|
15
|
-
const replayRequest = httpRequest || (0, kubesense_browser_core_1.createHttpRequest)([configuration.sessionReplayEndpointBuilder], reportError, segmentCollection_1.SEGMENT_BYTES_LIMIT);
|
|
16
|
-
let addRecord;
|
|
17
|
-
let addStats;
|
|
18
|
-
if (!(0, kubesense_browser_core_1.canUseEventBridge)()) {
|
|
19
|
-
const segmentCollection = (0, segmentCollection_1.startSegmentCollection)(lifeCycle, configuration, sessionManager, viewHistory, replayRequest, encoder);
|
|
20
|
-
addRecord = segmentCollection.addRecord;
|
|
21
|
-
addStats = segmentCollection.addStats;
|
|
22
|
-
cleanupTasks.push(segmentCollection.stop);
|
|
23
|
-
const segmentTelemetry = (0, segmentCollection_1.startSegmentTelemetry)(telemetry, replayRequest.observable);
|
|
24
|
-
cleanupTasks.push(segmentTelemetry.stop);
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
;
|
|
28
|
-
({ addRecord } = (0, startRecordBridge_1.startRecordBridge)(viewHistory));
|
|
29
|
-
addStats = kubesense_browser_core_1.noop;
|
|
30
|
-
}
|
|
31
|
-
const { stop: stopRecording } = (0, record_1.record)({
|
|
32
|
-
emitRecord: addRecord,
|
|
33
|
-
emitStats: addStats,
|
|
34
|
-
configuration,
|
|
35
|
-
lifeCycle,
|
|
36
|
-
viewHistory,
|
|
37
|
-
});
|
|
38
|
-
cleanupTasks.push(stopRecording);
|
|
39
|
-
return {
|
|
40
|
-
stop: () => {
|
|
41
|
-
cleanupTasks.forEach((task) => task());
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=startRecording.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"startRecording.js","sourceRoot":"","sources":["../../src/boot/startRecording.ts"],"names":[],"mappings":";;AAYA,wCAyDC;AApED,8EAAiH;AAIjH,6CAAyC;AAGzC,mEAAgH;AAEhH,mEAA+D;AAE/D,SAAgB,cAAc,CAC5B,SAAoB,EACpB,aAA+B,EAC/B,cAAiC,EACjC,WAAwB,EACxB,OAAuB,EACvB,SAAoB,EACpB,WAAwC;IAExC,MAAM,YAAY,GAAsB,EAAE,CAAA;IAE1C,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IAAI,CAAC,aAAa,CAAC,CAAA;IAEhC,OAAO;QACL,IAAI,EAAE,GAAG,EAAE;YACT,YAAY,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAAA;QACxC,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/domain/deflate/index.ts"],"names":[],"mappings":";;;AAAA,mDAAuD;AAA9C,sHAAA,oBAAoB,OAAA;AAE7B,iDAKwB;AAJtB,mHAAA,kBAAkB,OAAA;AAElB,uHAAA,sBAAsB,OAAA;AACtB,wHAAA,uBAAuB,OAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Encoder } from '@kubesense/kubesense-browser-core';
|
|
2
|
-
import { DeflateEncoderStreamId } from '@kubesense/kubesense-browser-core';
|
|
3
|
-
import type { LifeCycle, LongTaskContexts, RumConfiguration, RumSessionManager, ViewHistory } from '@kubesense/kubesense-browser-rum-core';
|
|
4
|
-
import type { RUMProfiler, RUMProfilerConfiguration } from './types';
|
|
5
|
-
import type { ProfilingContextManager } from './profilingContext';
|
|
6
|
-
export declare const DEFAULT_RUM_PROFILER_CONFIGURATION: RUMProfilerConfiguration;
|
|
7
|
-
export declare function createRumProfiler(configuration: RumConfiguration, lifeCycle: LifeCycle, session: RumSessionManager, profilingContextManager: ProfilingContextManager, longTaskContexts: LongTaskContexts, createEncoder: (streamId: DeflateEncoderStreamId) => Encoder, viewHistory: ViewHistory, profilerConfiguration?: RUMProfilerConfiguration): RUMProfiler;
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_RUM_PROFILER_CONFIGURATION = void 0;
|
|
4
|
-
exports.createRumProfiler = createRumProfiler;
|
|
5
|
-
const kubesense_browser_core_1 = require("@kubesense/kubesense-browser-core");
|
|
6
|
-
const kubesense_browser_rum_core_1 = require("@kubesense/kubesense-browser-rum-core");
|
|
7
|
-
const getNumberOfSamples_1 = require("./utils/getNumberOfSamples");
|
|
8
|
-
const getCustomOrDefaultViewName_1 = require("./utils/getCustomOrDefaultViewName");
|
|
9
|
-
const assembly_1 = require("./transport/assembly");
|
|
10
|
-
exports.DEFAULT_RUM_PROFILER_CONFIGURATION = {
|
|
11
|
-
sampleIntervalMs: 10, // Sample stack trace every 10ms
|
|
12
|
-
collectIntervalMs: 60000, // Collect data every minute
|
|
13
|
-
minProfileDurationMs: 5000, // Require at least 5 seconds of profile data to reduce noise and cost
|
|
14
|
-
minNumberOfSamples: 50, // Require at least 50 samples (~500 ms) to report a profile to reduce noise and cost
|
|
15
|
-
};
|
|
16
|
-
function createRumProfiler(configuration, lifeCycle, session, profilingContextManager, longTaskContexts, createEncoder, viewHistory, profilerConfiguration = exports.DEFAULT_RUM_PROFILER_CONFIGURATION) {
|
|
17
|
-
const transport = (0, kubesense_browser_rum_core_1.createFormDataTransport)(configuration, lifeCycle, createEncoder, 6 /* DeflateEncoderStreamId.PROFILING */);
|
|
18
|
-
let lastViewEntry;
|
|
19
|
-
// Global clean-up tasks for listeners that are not specific to a profiler instance (eg. visibility change, before unload)
|
|
20
|
-
const globalCleanupTasks = [];
|
|
21
|
-
let instance = { state: 'stopped', stateReason: 'initializing' };
|
|
22
|
-
// Stops the profiler when session expires
|
|
23
|
-
lifeCycle.subscribe(9 /* LifeCycleEventType.SESSION_EXPIRED */, () => {
|
|
24
|
-
stopProfiling('session-expired').catch(kubesense_browser_core_1.monitorError);
|
|
25
|
-
});
|
|
26
|
-
// Start the profiler again when session is renewed
|
|
27
|
-
lifeCycle.subscribe(10 /* LifeCycleEventType.SESSION_RENEWED */, () => {
|
|
28
|
-
if (instance.state === 'stopped' && instance.stateReason === 'session-expired') {
|
|
29
|
-
start(); // Only restart the profiler if it was stopped due to session expiration. Avoid restarting the profiler if it was stopped manually by the user.
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
// Public API to start the profiler.
|
|
33
|
-
function start() {
|
|
34
|
-
if (instance.state === 'running') {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
const viewEntry = viewHistory.findView();
|
|
38
|
-
// Add initial view
|
|
39
|
-
// Note: `viewEntry.name` is only filled when users use manual view creation via `startView` method.
|
|
40
|
-
lastViewEntry = viewEntry
|
|
41
|
-
? {
|
|
42
|
-
startClocks: viewEntry.startClocks,
|
|
43
|
-
viewId: viewEntry.id,
|
|
44
|
-
viewName: (0, getCustomOrDefaultViewName_1.getCustomOrDefaultViewName)(viewEntry.name, document.location.pathname),
|
|
45
|
-
}
|
|
46
|
-
: undefined;
|
|
47
|
-
// Add global clean-up tasks for listeners that are not specific to a profiler instance (eg. visibility change, before unload)
|
|
48
|
-
globalCleanupTasks.push((0, kubesense_browser_core_1.addEventListener)(configuration, window, "visibilitychange" /* DOM_EVENT.VISIBILITY_CHANGE */, handleVisibilityChange).stop, (0, kubesense_browser_core_1.addEventListener)(configuration, window, "beforeunload" /* DOM_EVENT.BEFORE_UNLOAD */, handleBeforeUnload).stop);
|
|
49
|
-
// Start profiler instance
|
|
50
|
-
startNextProfilerInstance();
|
|
51
|
-
}
|
|
52
|
-
// Public API to manually stop the profiler.
|
|
53
|
-
async function stop() {
|
|
54
|
-
await stopProfiling('stopped-by-user');
|
|
55
|
-
}
|
|
56
|
-
async function stopProfiling(reason) {
|
|
57
|
-
// Stop current profiler instance
|
|
58
|
-
await stopProfilerInstance(reason);
|
|
59
|
-
// Cleanup global listeners
|
|
60
|
-
globalCleanupTasks.forEach((task) => task());
|
|
61
|
-
// Update Profiling status once the Profiler has been stopped.
|
|
62
|
-
profilingContextManager.set({ status: 'stopped', error_reason: undefined });
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Whenever a new Profiler instance is started, we need to add event listeners to surroundings (RUM Events, Long Tasks, etc) to enrich the Profiler data.
|
|
66
|
-
* If the instance is already running, we can keep the same event listeners.
|
|
67
|
-
*/
|
|
68
|
-
function addEventListeners(existingInstance) {
|
|
69
|
-
if (existingInstance.state === 'running') {
|
|
70
|
-
// Instance is already running, so we can keep same event listeners.
|
|
71
|
-
return {
|
|
72
|
-
cleanupTasks: existingInstance.cleanupTasks,
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
// Store clean-up tasks for this instance (tasks to be executed when the Profiler is stopped or paused.)
|
|
76
|
-
const cleanupTasks = [];
|
|
77
|
-
// Whenever the View is updated, we add a views entry to the profiler instance.
|
|
78
|
-
const viewUpdatedSubscription = lifeCycle.subscribe(2 /* LifeCycleEventType.VIEW_CREATED */, (view) => {
|
|
79
|
-
const viewEntry = {
|
|
80
|
-
viewId: view.id,
|
|
81
|
-
// Note: `viewName` is only filled when users use manual view creation via `startView` method.
|
|
82
|
-
viewName: (0, getCustomOrDefaultViewName_1.getCustomOrDefaultViewName)(view.name, document.location.pathname),
|
|
83
|
-
startClocks: view.startClocks,
|
|
84
|
-
};
|
|
85
|
-
collectViewEntry(viewEntry);
|
|
86
|
-
// Update last view entry
|
|
87
|
-
lastViewEntry = viewEntry;
|
|
88
|
-
});
|
|
89
|
-
cleanupTasks.push(viewUpdatedSubscription.unsubscribe);
|
|
90
|
-
return {
|
|
91
|
-
cleanupTasks,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
function startNextProfilerInstance() {
|
|
95
|
-
// These APIs might be unavailable in some browsers
|
|
96
|
-
const globalThisProfiler = (0, kubesense_browser_core_1.getGlobalObject)().Profiler;
|
|
97
|
-
if (!globalThisProfiler) {
|
|
98
|
-
profilingContextManager.set({ status: 'error', error_reason: 'not-supported-by-browser' });
|
|
99
|
-
throw new Error('RUM Profiler is not supported in this browser.');
|
|
100
|
-
}
|
|
101
|
-
// Don't wait for data collection to start next instance
|
|
102
|
-
collectProfilerInstance(instance).catch(kubesense_browser_core_1.monitorError);
|
|
103
|
-
const { cleanupTasks } = addEventListeners(instance);
|
|
104
|
-
let profiler;
|
|
105
|
-
try {
|
|
106
|
-
// We have to create new Profiler each time we start a new instance
|
|
107
|
-
profiler = new globalThisProfiler({
|
|
108
|
-
sampleInterval: profilerConfiguration.sampleIntervalMs,
|
|
109
|
-
// Keep buffer size at 1.5 times of minimum required to collect data for a profiling instance
|
|
110
|
-
maxBufferSize: Math.round((profilerConfiguration.collectIntervalMs * 1.5) / profilerConfiguration.sampleIntervalMs),
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
catch (e) {
|
|
114
|
-
if (e instanceof Error && e.message.includes('disabled by Document Policy')) {
|
|
115
|
-
// Missing Response Header (`js-profiling`) that is required to enable the profiler.
|
|
116
|
-
// We should suggest the user to enable the Response Header in their server configuration.
|
|
117
|
-
kubesense_browser_core_1.display.warn('[KUBESENSE_SDK] Profiler startup failed. Ensure your server includes the `Document-Policy: js-profiling` response header when serving HTML pages.', e);
|
|
118
|
-
profilingContextManager.set({ status: 'error', error_reason: 'missing-document-policy-header' });
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
profilingContextManager.set({ status: 'error', error_reason: 'unexpected-exception' });
|
|
122
|
-
}
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
profilingContextManager.set({ status: 'running', error_reason: undefined });
|
|
126
|
-
// Kick-off the new instance
|
|
127
|
-
instance = {
|
|
128
|
-
state: 'running',
|
|
129
|
-
startClocks: (0, kubesense_browser_core_1.clocksNow)(),
|
|
130
|
-
profiler,
|
|
131
|
-
timeoutId: (0, kubesense_browser_core_1.setTimeout)(startNextProfilerInstance, profilerConfiguration.collectIntervalMs),
|
|
132
|
-
views: [],
|
|
133
|
-
cleanupTasks,
|
|
134
|
-
longTasks: [],
|
|
135
|
-
};
|
|
136
|
-
// Add last view entry
|
|
137
|
-
collectViewEntry(lastViewEntry);
|
|
138
|
-
// Add event handler case we overflow the buffer
|
|
139
|
-
profiler.addEventListener('samplebufferfull', handleSampleBufferFull);
|
|
140
|
-
}
|
|
141
|
-
async function collectProfilerInstance(lastInstance) {
|
|
142
|
-
if (lastInstance.state !== 'running') {
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
// Cleanup instance
|
|
146
|
-
(0, kubesense_browser_core_1.clearTimeout)(lastInstance.timeoutId);
|
|
147
|
-
lastInstance.profiler.removeEventListener('samplebufferfull', handleSampleBufferFull);
|
|
148
|
-
// Store instance data snapshot in local variables to use in async callback
|
|
149
|
-
const { startClocks, views } = lastInstance;
|
|
150
|
-
// Stop current profiler to get trace
|
|
151
|
-
await lastInstance.profiler
|
|
152
|
-
.stop()
|
|
153
|
-
.then((trace) => {
|
|
154
|
-
const endClocks = (0, kubesense_browser_core_1.clocksNow)();
|
|
155
|
-
const longTasks = longTaskContexts.findLongTasks(startClocks.relative);
|
|
156
|
-
const isBelowDurationThreshold = (0, kubesense_browser_core_1.elapsed)(startClocks.timeStamp, endClocks.timeStamp) < profilerConfiguration.minProfileDurationMs;
|
|
157
|
-
const isBelowSampleThreshold = (0, getNumberOfSamples_1.getNumberOfSamples)(trace.samples) < profilerConfiguration.minNumberOfSamples;
|
|
158
|
-
if (longTasks.length === 0 && (isBelowDurationThreshold || isBelowSampleThreshold)) {
|
|
159
|
-
// Skip very short profiles to reduce noise and cost, but keep them if they contain long tasks.
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
handleProfilerTrace(
|
|
163
|
-
// Enrich trace with time and instance data
|
|
164
|
-
Object.assign(trace, {
|
|
165
|
-
startClocks,
|
|
166
|
-
endClocks,
|
|
167
|
-
clocksOrigin: (0, kubesense_browser_core_1.clocksOrigin)(),
|
|
168
|
-
longTasks,
|
|
169
|
-
views,
|
|
170
|
-
sampleInterval: profilerConfiguration.sampleIntervalMs,
|
|
171
|
-
}));
|
|
172
|
-
})
|
|
173
|
-
.catch(kubesense_browser_core_1.monitorError);
|
|
174
|
-
}
|
|
175
|
-
async function stopProfilerInstance(stateReason) {
|
|
176
|
-
if (instance.state !== 'running') {
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
await onPauseOrStopProfilerInstance();
|
|
180
|
-
instance = { state: 'stopped', stateReason };
|
|
181
|
-
}
|
|
182
|
-
async function pauseProfilerInstance() {
|
|
183
|
-
if (instance.state !== 'running') {
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
await onPauseOrStopProfilerInstance();
|
|
187
|
-
instance = { state: 'paused' };
|
|
188
|
-
}
|
|
189
|
-
async function onPauseOrStopProfilerInstance() {
|
|
190
|
-
if (instance.state !== 'running') {
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
// Cleanup tasks
|
|
194
|
-
instance.cleanupTasks.forEach((cleanupTask) => cleanupTask());
|
|
195
|
-
await collectProfilerInstance(instance);
|
|
196
|
-
}
|
|
197
|
-
function collectViewEntry(viewEntry) {
|
|
198
|
-
if (instance.state !== 'running' || !viewEntry) {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
// Add entry to views
|
|
202
|
-
instance.views.push(viewEntry);
|
|
203
|
-
}
|
|
204
|
-
function handleProfilerTrace(trace) {
|
|
205
|
-
var _a;
|
|
206
|
-
// Find current session to assign it to the Profile.
|
|
207
|
-
const sessionId = (_a = session.findTrackedSession()) === null || _a === void 0 ? void 0 : _a.id;
|
|
208
|
-
const payload = (0, assembly_1.assembleProfilingPayload)(trace, configuration, sessionId);
|
|
209
|
-
void transport.send(payload);
|
|
210
|
-
}
|
|
211
|
-
function handleSampleBufferFull() {
|
|
212
|
-
startNextProfilerInstance();
|
|
213
|
-
}
|
|
214
|
-
function handleVisibilityChange() {
|
|
215
|
-
if (document.visibilityState === 'hidden' && instance.state === 'running') {
|
|
216
|
-
// Pause when tab is hidden. We use paused state to distinguish between
|
|
217
|
-
// paused by visibility change and stopped by user.
|
|
218
|
-
// If profiler is paused by the visibility change, we should resume when
|
|
219
|
-
// tab becomes visible again. That's not the case when user stops the profiler.
|
|
220
|
-
pauseProfilerInstance().catch(kubesense_browser_core_1.monitorError);
|
|
221
|
-
}
|
|
222
|
-
else if (document.visibilityState === 'visible' && instance.state === 'paused') {
|
|
223
|
-
// Resume when tab becomes visible again
|
|
224
|
-
startNextProfilerInstance();
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
function handleBeforeUnload() {
|
|
228
|
-
// `unload` can in some cases be triggered while the page is still active (link to a different protocol like mailto:).
|
|
229
|
-
// We can immediately flush (by starting a new profiler instance) to make sure we receive the data, and at the same time keep the profiler active.
|
|
230
|
-
// In case of the regular unload, the profiler will be shut down anyway.
|
|
231
|
-
startNextProfilerInstance();
|
|
232
|
-
}
|
|
233
|
-
function isStopped() {
|
|
234
|
-
return instance.state === 'stopped';
|
|
235
|
-
}
|
|
236
|
-
function isRunning() {
|
|
237
|
-
return instance.state === 'running';
|
|
238
|
-
}
|
|
239
|
-
function isPaused() {
|
|
240
|
-
return instance.state === 'paused';
|
|
241
|
-
}
|
|
242
|
-
return { start, stop, isStopped, isRunning, isPaused };
|
|
243
|
-
}
|
|
244
|
-
//# sourceMappingURL=profiler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profiler.js","sourceRoot":"","sources":["../../../src/domain/profiling/profiler.ts"],"names":[],"mappings":";;;AA6CA,8CAoSC;AAhVD,8EAY0C;AAU1C,sFAAmG;AAUnG,mEAA+D;AAE/D,mFAA+E;AAC/E,mDAA+D;AAElD,QAAA,kCAAkC,GAA6B;IAC1E,gBAAgB,EAAE,EAAE,EAAE,gCAAgC;IACtD,iBAAiB,EAAE,KAAK,EAAE,4BAA4B;IACtD,oBAAoB,EAAE,IAAI,EAAE,sEAAsE;IAClG,kBAAkB,EAAE,EAAE,EAAE,qFAAqF;CAC9G,CAAA;AAED,SAAgB,iBAAiB,CAC/B,aAA+B,EAC/B,SAAoB,EACpB,OAA0B,EAC1B,uBAAgD,EAChD,gBAAkC,EAClC,aAA4D,EAC5D,WAAwB,EACxB,wBAAkD,0CAAkC;IAEpF,MAAM,SAAS,GAAG,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C,CAAC;IAED,SAAS,SAAS;QAChB,OAAO,QAAQ,CAAC,KAAK,KAAK,SAAS,CAAA;IACrC,CAAC;IAED,SAAS,QAAQ;QACf,OAAO,QAAQ,CAAC,KAAK,KAAK,QAAQ,CAAA;IACpC,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAA;AACxD,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mockedTrace = exports.mockedEmptyTrace = void 0;
|
|
4
|
-
const generateFiftyRandomSamples = () => {
|
|
5
|
-
const samples = [];
|
|
6
|
-
for (let i = 0; i < 50; i++) {
|
|
7
|
-
samples.push({
|
|
8
|
-
timestamp: i,
|
|
9
|
-
stackId: i % 3,
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
return samples;
|
|
13
|
-
};
|
|
14
|
-
// eslint-disable-next-line local-rules/disallow-side-effects
|
|
15
|
-
const randomSamples = generateFiftyRandomSamples();
|
|
16
|
-
exports.mockedEmptyTrace = {
|
|
17
|
-
resources: [],
|
|
18
|
-
frames: [],
|
|
19
|
-
stacks: [],
|
|
20
|
-
samples: [],
|
|
21
|
-
};
|
|
22
|
-
exports.mockedTrace = {
|
|
23
|
-
resources: ['resource1', 'resource2', 'resource3'],
|
|
24
|
-
frames: [
|
|
25
|
-
{
|
|
26
|
-
name: 'frame-0',
|
|
27
|
-
line: 1,
|
|
28
|
-
column: 1,
|
|
29
|
-
resourceId: 0,
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
name: 'frame-1',
|
|
33
|
-
line: 2,
|
|
34
|
-
column: 2,
|
|
35
|
-
resourceId: 1,
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: 'frame-2',
|
|
39
|
-
line: 3,
|
|
40
|
-
column: 3,
|
|
41
|
-
resourceId: 2,
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
stacks: [
|
|
45
|
-
{
|
|
46
|
-
frameId: 0,
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
frameId: 1,
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
frameId: 2,
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
samples: randomSamples,
|
|
56
|
-
};
|
|
57
|
-
//# sourceMappingURL=mockedTrace.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAErC,QAAA,gBAAgB,GAAkB;IAC7C,SAAS,EAAE,EAAE;IACb,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,EAAE;CACZ,CAAA;AAEY,QAAA,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"}
|
|
@@ -1,21 +0,0 @@
|
|
|
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;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assembleProfilingPayload = assembleProfilingPayload;
|
|
4
|
-
const kubesense_browser_core_1 = require("@kubesense/kubesense-browser-core");
|
|
5
|
-
const buildProfileEventAttributes_1 = require("./buildProfileEventAttributes");
|
|
6
|
-
function assembleProfilingPayload(profilerTrace, configuration, sessionId) {
|
|
7
|
-
const event = buildProfileEvent(profilerTrace, configuration, sessionId);
|
|
8
|
-
return {
|
|
9
|
-
event,
|
|
10
|
-
'wall-time.json': profilerTrace,
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
function buildProfileEvent(profilerTrace, configuration, sessionId) {
|
|
14
|
-
const tags = (0, kubesense_browser_core_1.buildTags)(configuration); // TODO: get that from the tagContext hook
|
|
15
|
-
const profileAttributes = (0, buildProfileEventAttributes_1.buildProfileEventAttributes)(profilerTrace, configuration.applicationId, sessionId);
|
|
16
|
-
const profileEventTags = buildProfileEventTags(tags);
|
|
17
|
-
const profileEvent = {
|
|
18
|
-
...profileAttributes,
|
|
19
|
-
attachments: ['wall-time.json'],
|
|
20
|
-
start: new Date(profilerTrace.startClocks.timeStamp).toISOString(),
|
|
21
|
-
end: new Date(profilerTrace.endClocks.timeStamp).toISOString(),
|
|
22
|
-
family: 'chrome',
|
|
23
|
-
runtime: 'chrome',
|
|
24
|
-
format: 'json',
|
|
25
|
-
version: 4, // Ingestion event version (not the version application tag)
|
|
26
|
-
tags_profiler: profileEventTags.join(','),
|
|
27
|
-
_kubesense: {
|
|
28
|
-
clock_drift: (0, kubesense_browser_core_1.currentDrift)(),
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
return profileEvent;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Builds tags for the Profile Event.
|
|
35
|
-
*
|
|
36
|
-
* @param tags - RUM tags
|
|
37
|
-
* @returns Combined tags for the Profile Event.
|
|
38
|
-
*/
|
|
39
|
-
function buildProfileEventTags(tags) {
|
|
40
|
-
// Tags already contains the common tags for all events. (service, env, version, etc.)
|
|
41
|
-
// Here we are adding some specific-to-profiling tags.
|
|
42
|
-
const profileEventTags = tags.concat(['language:javascript', 'runtime:chrome', 'family:chrome', 'host:browser']);
|
|
43
|
-
return profileEventTags;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=assembly.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"assembly.js","sourceRoot":"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;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"}
|
|
@@ -1,25 +0,0 @@
|
|
|
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;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildProfileEventAttributes = buildProfileEventAttributes;
|
|
4
|
-
/**
|
|
5
|
-
* Builds attributes for the Profile Event.
|
|
6
|
-
*
|
|
7
|
-
* @param profilerTrace - Profiler trace
|
|
8
|
-
* @param applicationId - application id.
|
|
9
|
-
* @param sessionId - session id.
|
|
10
|
-
* @returns Additional attributes.
|
|
11
|
-
*/
|
|
12
|
-
function buildProfileEventAttributes(profilerTrace, applicationId, sessionId) {
|
|
13
|
-
const attributes = {
|
|
14
|
-
application: {
|
|
15
|
-
id: applicationId,
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
if (sessionId) {
|
|
19
|
-
attributes.session = {
|
|
20
|
-
id: sessionId,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
// Extract view ids and names from the profiler trace and add them as attributes of the profile event.
|
|
24
|
-
// This will be used to filter the profiles by @view.id and/or @view.name.
|
|
25
|
-
const { ids, names } = extractViewIdsAndNames(profilerTrace.views);
|
|
26
|
-
if (ids.length) {
|
|
27
|
-
attributes.view = {
|
|
28
|
-
id: ids,
|
|
29
|
-
name: names,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const longTaskIds = profilerTrace.longTasks.map((longTask) => longTask.id).filter((id) => id !== undefined);
|
|
33
|
-
if (longTaskIds.length) {
|
|
34
|
-
attributes.long_task = { id: longTaskIds };
|
|
35
|
-
}
|
|
36
|
-
return attributes;
|
|
37
|
-
}
|
|
38
|
-
function extractViewIdsAndNames(views) {
|
|
39
|
-
const result = { ids: [], names: [] };
|
|
40
|
-
for (const view of views) {
|
|
41
|
-
result.ids.push(view.viewId);
|
|
42
|
-
if (view.viewName) {
|
|
43
|
-
result.names.push(view.viewName);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
// Remove duplicates
|
|
47
|
-
result.names = Array.from(new Set(result.names));
|
|
48
|
-
return result;
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=buildProfileEventAttributes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildProfileEventAttributes.js","sourceRoot":"","sources":["../../../../src/domain/profiling/transport/buildProfileEventAttributes.ts"],"names":[],"mappings":";;AAiBA,kEAgCC;AAxCD;;;;;;;GAOG;AACH,SAAgB,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,E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,"file":"index.js","sourceRoot":"","sources":["../../../../src/domain/profiling/types/index.ts"],"names":[],"mappings":""}
|
|
@@ -1,58 +0,0 @@
|
|
|
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 {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profilerApi.types.js","sourceRoot":"","sources":["../../../../src/domain/profiling/types/profilerApi.types.ts"],"names":[],"mappings":";AAAA,wCAAwC;AACxC,4CAA4C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rumProfiler.types.js","sourceRoot":"","sources":["../../../../src/domain/profiling/types/rumProfiler.types.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +0,0 @@
|
|
|
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;
|