@cloudcare/browser-rum 3.3.12 → 3.3.13
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/bundle/dataflux-rum.js +1 -1
- package/cjs/boot/buildEnv.js +1 -1
- package/cjs/boot/recorderApi.js +22 -2
- package/cjs/boot/recorderApi.js.map +1 -1
- package/cjs/boot/startRecording.js +52 -2
- package/cjs/boot/startRecording.js.map +1 -1
- package/cjs/domain/assembly.js +15 -2
- package/cjs/domain/assembly.js.map +1 -1
- package/cjs/domain/deflate/deflateWorker.js +1 -1
- package/cjs/domain/replay/record/canvasEncodeWorker.js +1 -1
- package/cjs/domain/replay/record/mutationObserver.js +16 -6
- package/cjs/domain/replay/record/mutationObserver.js.map +1 -1
- package/cjs/domain/replay/record/record.js +85 -8
- package/cjs/domain/replay/record/record.js.map +1 -1
- package/cjs/domain/replay/segmentCollection/segmentCollection.js +45 -17
- package/cjs/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
- package/cjs/domain/replay/timeAnchor.js +27 -0
- package/cjs/domain/replay/timeAnchor.js.map +1 -0
- package/cjs/domain/rumEventsCollection/view/trackViews.js +31 -4
- package/cjs/domain/rumEventsCollection/view/trackViews.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/viewCollection.js +1 -1
- package/cjs/domain/rumEventsCollection/view/viewCollection.js.map +1 -1
- package/esm/boot/buildEnv.js +1 -1
- package/esm/boot/recorderApi.js +23 -3
- package/esm/boot/recorderApi.js.map +1 -1
- package/esm/boot/startRecording.js +52 -2
- package/esm/boot/startRecording.js.map +1 -1
- package/esm/domain/assembly.js +16 -3
- package/esm/domain/assembly.js.map +1 -1
- package/esm/domain/deflate/deflateWorker.js +1 -1
- package/esm/domain/replay/record/canvasEncodeWorker.js +1 -1
- package/esm/domain/replay/record/mutationObserver.js +16 -6
- package/esm/domain/replay/record/mutationObserver.js.map +1 -1
- package/esm/domain/replay/record/record.js +69 -9
- package/esm/domain/replay/record/record.js.map +1 -1
- package/esm/domain/replay/segmentCollection/segmentCollection.js +45 -17
- package/esm/domain/replay/segmentCollection/segmentCollection.js.map +1 -1
- package/esm/domain/replay/timeAnchor.js +20 -0
- package/esm/domain/replay/timeAnchor.js.map +1 -0
- package/esm/domain/rumEventsCollection/view/trackViews.js +31 -4
- package/esm/domain/rumEventsCollection/view/trackViews.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/viewCollection.js +1 -1
- package/esm/domain/rumEventsCollection/view/viewCollection.js.map +1 -1
- package/package.json +4 -4
- package/src/boot/recorderApi.js +25 -3
- package/src/boot/startRecording.js +53 -2
- package/src/domain/assembly.js +18 -4
- package/src/domain/replay/record/mutationObserver.js +21 -11
- package/src/domain/replay/record/record.js +120 -8
- package/src/domain/replay/segmentCollection/segmentCollection.js +83 -18
- package/src/domain/replay/timeAnchor.js +33 -0
- package/src/domain/rumEventsCollection/view/trackViews.js +52 -8
- package/src/domain/rumEventsCollection/view/viewCollection.js +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewCollection.js","names":["isEmptyObject","mapValues","toServerDuration","isNumber","RumEventType","LifeCycleEventType","extend2Lev","findByPath","discardNegativeDuration","timeStampNow","trackViews","startViewCollection","lifeCycle","configuration","location","domMutationObservable","locationChangeObservable","pageStateHistory","recorderApi","initialViewOptions","subscribe","VIEW_UPDATED","view","notify","RAW_RUM_EVENT_COLLECTED","processViewUpdate","trackViewsManually","computePerformanceViewDetails","navigationTimings","undefined","fetchStart","responseEnd","domInteractive","domContentLoaded","domComplete","loadEventEnd","loadEventStart","domContentLoadedEventEnd","details","fpt","apdexLevel","parseInt","tti","dom_ready","load","resource_load_time","dom","replayStats","getReplayStats","id","pageStates","findAll","startClocks","relative","duration","viewEvent","_gc","document_version","documentVersion","replay_stats","page_states","view_update_time","date","timeStamp","type","VIEW","action","count","eventCounts","actionCount","frustration","frustrationCount","cumulative_layout_shift","commonViewMetrics","cumulative_layout_shift_time","cumulative_layout_shift_target_selector","first_byte","initialViewMetrics","dom_complete","dom_content_loaded","dom_interactive","error","errorCount","first_contentful_paint","first_input_delay","first_input_time","first_input_target_selector","interaction_to_next_paint","interaction_to_next_paint_target_selector","is_active","isActive","name","largest_contentful_paint","largest_contentful_paint_element_selector","load_event","loading_time","loadingTime","loading_type","loadingType","navigation_type","navigationType","long_task","longTaskCount","resource","resourceCount","time_spent","display","scroll","max_depth","maxDepth","max_depth_scroll_top","maxDepthScrollTop","max_scroll_height","maxScrollHeight","max_scroll_height_time","maxScrollHeightTime","session","has_replay","sessionIsActive","privacy","replay_level","defaultPrivacyLevel","customTimings","custom_timings","rawRumEvent","startTime","domainContext"],"sources":["../../../../src/domain/rumEventsCollection/view/viewCollection.js"],"mappings":"AAAA,SACEA,aAAa,EACbC,SAAS,EACTC,gBAAgB,EAChBC,QAAQ,EACRC,YAAY,EACZC,kBAAkB,EAClBC,UAAU,EACVC,UAAU,EACVC,uBAAuB,EACvBC,YAAY,QACP,yBAAyB;AAChC,SAASC,UAAU,QAAQ,cAAc;AACzC,OAAO,SAASC,mBAAmBA,CACjCC,SAAS,EACTC,aAAa,EACbC,QAAQ,EACRC,qBAAqB,EACrBC,wBAAwB,EACxBC,gBAAgB,EAChBC,WAAW,EACXC,kBAAkB,EAClB;EACAP,SAAS,CAACQ,SAAS,CAACf,kBAAkB,CAACgB,YAAY,EAAE,UAAUC,IAAI,EAAE;IACnEV,SAAS,CAACW,MAAM,CACdlB,kBAAkB,CAACmB,uBAAuB,EAC1CC,iBAAiB,CAACH,IAAI,EAAET,aAAa,EAAEK,WAAW,EAAED,gBAAgB,CACtE,CAAC;EACH,CAAC,CAAC;EAEF,OAAOP,UAAU,CACfI,QAAQ,EACRF,SAAS,EACTG,qBAAqB,EACrBF,aAAa,EACbG,wBAAwB,EACxB,CAACH,aAAa,CAACa,kBAAkB,EACjCP,
|
|
1
|
+
{"version":3,"file":"viewCollection.js","names":["isEmptyObject","mapValues","toServerDuration","isNumber","RumEventType","LifeCycleEventType","extend2Lev","findByPath","discardNegativeDuration","timeStampNow","trackViews","startViewCollection","lifeCycle","configuration","location","domMutationObservable","locationChangeObservable","pageStateHistory","recorderApi","initialViewOptions","subscribe","VIEW_UPDATED","view","notify","RAW_RUM_EVENT_COLLECTED","processViewUpdate","trackViewsManually","computePerformanceViewDetails","navigationTimings","undefined","fetchStart","responseEnd","domInteractive","domContentLoaded","domComplete","loadEventEnd","loadEventStart","domContentLoadedEventEnd","details","fpt","apdexLevel","parseInt","tti","dom_ready","load","resource_load_time","dom","replayStats","getReplayStats","id","pageStates","findAll","startClocks","relative","duration","viewEvent","_gc","document_version","documentVersion","replay_stats","page_states","view_update_time","date","timeStamp","type","VIEW","action","count","eventCounts","actionCount","frustration","frustrationCount","cumulative_layout_shift","commonViewMetrics","cumulative_layout_shift_time","cumulative_layout_shift_target_selector","first_byte","initialViewMetrics","dom_complete","dom_content_loaded","dom_interactive","error","errorCount","first_contentful_paint","first_input_delay","first_input_time","first_input_target_selector","interaction_to_next_paint","interaction_to_next_paint_target_selector","is_active","isActive","name","largest_contentful_paint","largest_contentful_paint_element_selector","load_event","loading_time","loadingTime","loading_type","loadingType","navigation_type","navigationType","long_task","longTaskCount","resource","resourceCount","time_spent","display","scroll","max_depth","maxDepth","max_depth_scroll_top","maxDepthScrollTop","max_scroll_height","maxScrollHeight","max_scroll_height_time","maxScrollHeightTime","session","has_replay","sessionIsActive","privacy","replay_level","defaultPrivacyLevel","customTimings","custom_timings","rawRumEvent","startTime","domainContext"],"sources":["../../../../src/domain/rumEventsCollection/view/viewCollection.js"],"mappings":"AAAA,SACEA,aAAa,EACbC,SAAS,EACTC,gBAAgB,EAChBC,QAAQ,EACRC,YAAY,EACZC,kBAAkB,EAClBC,UAAU,EACVC,UAAU,EACVC,uBAAuB,EACvBC,YAAY,QACP,yBAAyB;AAChC,SAASC,UAAU,QAAQ,cAAc;AACzC,OAAO,SAASC,mBAAmBA,CACjCC,SAAS,EACTC,aAAa,EACbC,QAAQ,EACRC,qB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,CAAC;EACF,OAAO;IACLgG,WAAW,EAAErE,SAAS;IACtBsE,SAAS,EAAEvG,IAAI,CAAC8B,WAAW,CAACC,QAAQ;IACpCyE,aAAa,EAAE;MACbhH,QAAQ,EAAEQ,IAAI,CAACR;IACjB;EACF,CAAC;AACH","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcare/browser-rum",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.13",
|
|
4
4
|
"main": "cjs/index.js",
|
|
5
5
|
"module": "esm/index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@cloudcare/browser-core": "3.3.
|
|
9
|
-
"@cloudcare/browser-worker": "3.3.
|
|
8
|
+
"@cloudcare/browser-core": "3.3.13",
|
|
9
|
+
"@cloudcare/browser-worker": "3.3.13"
|
|
10
10
|
},
|
|
11
11
|
"description": "Guance Browser SDK RUM Package",
|
|
12
12
|
"browserSdkCapabilities": {
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"author": "dataflux",
|
|
42
42
|
"license": "MIT",
|
|
43
43
|
"homepage": "https://github.com/GuanceCloud/datakit-js/README.md",
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "3eb68bdba724d0e37c0d1bc361ddc89e8d9e705d"
|
|
45
45
|
}
|
package/src/boot/recorderApi.js
CHANGED
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
bridgeSupports,
|
|
7
7
|
BridgeCapability,
|
|
8
8
|
PageExitReason,
|
|
9
|
-
monitorError
|
|
9
|
+
monitorError,
|
|
10
|
+
Observable
|
|
10
11
|
} from '@cloudcare/browser-core'
|
|
11
12
|
|
|
12
13
|
import { makeRecorderApiStub } from './recorderApiStub'
|
|
@@ -45,6 +46,16 @@ export function makeRecorderApi(startRecordingImpl, createDeflateWorkerImpl) {
|
|
|
45
46
|
return makeRecorderApiStub()
|
|
46
47
|
}
|
|
47
48
|
|
|
49
|
+
var recordingStateObservable = new Observable()
|
|
50
|
+
var lastNotifiedRecordingState = false
|
|
51
|
+
function notifyRecordingState(isRecording) {
|
|
52
|
+
if (lastNotifiedRecordingState === isRecording) {
|
|
53
|
+
return
|
|
54
|
+
}
|
|
55
|
+
lastNotifiedRecordingState = isRecording
|
|
56
|
+
recordingStateObservable.notify(isRecording)
|
|
57
|
+
}
|
|
58
|
+
|
|
48
59
|
var state = {
|
|
49
60
|
$rStatus: RecorderStatus.Stopped
|
|
50
61
|
}
|
|
@@ -62,6 +73,7 @@ export function makeRecorderApi(startRecordingImpl, createDeflateWorkerImpl) {
|
|
|
62
73
|
state.$rIsStopped()
|
|
63
74
|
) {
|
|
64
75
|
state = { $rStatus: RecorderStatus.Stopped }
|
|
76
|
+
notifyRecordingState(false)
|
|
65
77
|
}
|
|
66
78
|
}
|
|
67
79
|
|
|
@@ -74,8 +86,10 @@ export function makeRecorderApi(startRecordingImpl, createDeflateWorkerImpl) {
|
|
|
74
86
|
var stopStrategy = function () {
|
|
75
87
|
unloadRecoveryGeneration += 1
|
|
76
88
|
state = { $rStatus: RecorderStatus.Stopped }
|
|
89
|
+
notifyRecordingState(false)
|
|
77
90
|
}
|
|
78
91
|
return {
|
|
92
|
+
recordingStateObservable: recordingStateObservable,
|
|
79
93
|
start: function (options) {
|
|
80
94
|
startStrategy(options)
|
|
81
95
|
},
|
|
@@ -268,6 +282,7 @@ export function makeRecorderApi(startRecordingImpl, createDeflateWorkerImpl) {
|
|
|
268
282
|
state.$rToken === recordingToken
|
|
269
283
|
) {
|
|
270
284
|
state = { $rStatus: RecorderStatus.Stopped }
|
|
285
|
+
notifyRecordingState(false)
|
|
271
286
|
}
|
|
272
287
|
}
|
|
273
288
|
)
|
|
@@ -300,6 +315,7 @@ export function makeRecorderApi(startRecordingImpl, createDeflateWorkerImpl) {
|
|
|
300
315
|
$rFlushMutations:
|
|
301
316
|
recordingImpl.flushReplayMutationsForDebug || noop
|
|
302
317
|
}
|
|
318
|
+
notifyRecordingState(true)
|
|
303
319
|
if (__BUILD_ENV__REPLAY_DEBUG_ENABLED__) {
|
|
304
320
|
state.$rDebug = [
|
|
305
321
|
recordingImpl.getLastAutoCanvasSnapshotResultForDebug ||
|
|
@@ -351,8 +367,14 @@ export function makeRecorderApi(startRecordingImpl, createDeflateWorkerImpl) {
|
|
|
351
367
|
state = {
|
|
352
368
|
$rStatus: RecorderStatus.Stopped
|
|
353
369
|
}
|
|
354
|
-
|
|
355
|
-
stopRecording
|
|
370
|
+
try {
|
|
371
|
+
if (stopRecording) {
|
|
372
|
+
stopRecording(flushReason)
|
|
373
|
+
}
|
|
374
|
+
} finally {
|
|
375
|
+
// Publish the final View only after the recorder has attempted its
|
|
376
|
+
// last mutation/canvas/time-anchor boundary.
|
|
377
|
+
notifyRecordingState(false)
|
|
356
378
|
}
|
|
357
379
|
}
|
|
358
380
|
if (state.$rStatus === RecorderStatus.IntentToStart) {
|
|
@@ -38,12 +38,33 @@ export function startRecording(
|
|
|
38
38
|
? recordOverride || record
|
|
39
39
|
: record
|
|
40
40
|
var cleanupTasks = []
|
|
41
|
+
var replayMemoryBudget = {
|
|
42
|
+
$rRecord: function () {
|
|
43
|
+
return 0
|
|
44
|
+
},
|
|
45
|
+
$rSegment: function () {
|
|
46
|
+
return 0
|
|
47
|
+
}
|
|
48
|
+
}
|
|
41
49
|
var isRecordingStopped = false
|
|
42
50
|
var isRecordingReady = false
|
|
43
51
|
var pendingStopRequested = false
|
|
44
52
|
var pendingStopReason
|
|
45
53
|
var stoppedNotificationSent = false
|
|
46
54
|
var flushRecorderBeforePageExit = function () {}
|
|
55
|
+
var emitReplayTimeAnchor = function () {}
|
|
56
|
+
var finalReplayTimeAnchorRequested = false
|
|
57
|
+
var hasSegmentCollection = false
|
|
58
|
+
function emitFinalReplayTimeAnchor() {
|
|
59
|
+
if (finalReplayTimeAnchorRequested) {
|
|
60
|
+
return true
|
|
61
|
+
}
|
|
62
|
+
var admissionResult = emitReplayTimeAnchor()
|
|
63
|
+
if (admissionResult === true) {
|
|
64
|
+
finalReplayTimeAnchorRequested = true
|
|
65
|
+
}
|
|
66
|
+
return admissionResult
|
|
67
|
+
}
|
|
47
68
|
var replayResetRequestedBeforeRecorder = false
|
|
48
69
|
var requestReplayReset = function () {
|
|
49
70
|
replayResetRequestedBeforeRecorder = true
|
|
@@ -71,6 +92,16 @@ export function startRecording(
|
|
|
71
92
|
pendingStopReason = flushReason
|
|
72
93
|
return
|
|
73
94
|
}
|
|
95
|
+
if (!hasSegmentCollection) {
|
|
96
|
+
try {
|
|
97
|
+
emitFinalReplayTimeAnchor()
|
|
98
|
+
} catch (error) {
|
|
99
|
+
addTelemetryDebug('Session Replay final time anchor failed.', {
|
|
100
|
+
reason: flushReason,
|
|
101
|
+
error: String(error)
|
|
102
|
+
})
|
|
103
|
+
}
|
|
104
|
+
}
|
|
74
105
|
isRecordingStopped = true
|
|
75
106
|
var firstCleanupError
|
|
76
107
|
cleanupTasks
|
|
@@ -129,10 +160,12 @@ export function startRecording(
|
|
|
129
160
|
var beginMandatoryFullSnapshotRecovery = function () {}
|
|
130
161
|
var discardMandatoryFullSnapshotRecovery = function () {}
|
|
131
162
|
var wasLastEmitBackpressured = function () {}
|
|
163
|
+
var replayTimeAnchorsEnabled = true
|
|
132
164
|
if (!canUseEventBridge()) {
|
|
133
165
|
const session = sessionManager.findTrackedSession()
|
|
134
166
|
let isRecordErrorSessionReplay =
|
|
135
167
|
session && session.errorSessionReplayAllowed && !session.sessionHasError
|
|
168
|
+
replayTimeAnchorsEnabled = !isRecordErrorSessionReplay
|
|
136
169
|
var segmentCollection = startSegmentCollection(
|
|
137
170
|
lifeCycle,
|
|
138
171
|
configuration,
|
|
@@ -143,7 +176,7 @@ export function startRecording(
|
|
|
143
176
|
isRecordErrorSessionReplay,
|
|
144
177
|
{
|
|
145
178
|
beforePageExitFlush: function (pageExitEvent) {
|
|
146
|
-
flushRecorderBeforePageExit(pageExitEvent)
|
|
179
|
+
return flushRecorderBeforePageExit(pageExitEvent)
|
|
147
180
|
},
|
|
148
181
|
onReplayResetNeeded: function (reason) {
|
|
149
182
|
if (__BUILD_ENV__REPLAY_DEBUG_ENABLED__) {
|
|
@@ -155,6 +188,7 @@ export function startRecording(
|
|
|
155
188
|
onReplayResetExhausted: function (reason) {
|
|
156
189
|
stopRecording(reason || 'full_snapshot_failure_limit')
|
|
157
190
|
},
|
|
191
|
+
memoryBudget: replayMemoryBudget,
|
|
158
192
|
onSegmentFlushed: __BUILD_ENV__REPLAY_DEBUG_ENABLED__
|
|
159
193
|
? function (segmentFlush) {
|
|
160
194
|
replaySegmentFlushCount += 1
|
|
@@ -176,6 +210,7 @@ export function startRecording(
|
|
|
176
210
|
: undefined
|
|
177
211
|
}
|
|
178
212
|
)
|
|
213
|
+
hasSegmentCollection = true
|
|
179
214
|
addRecord = segmentCollection.addRecord
|
|
180
215
|
addBaselineRecords = segmentCollection.$rAddBaselineRecords
|
|
181
216
|
wasLastEmitBackpressured =
|
|
@@ -203,7 +238,12 @@ export function startRecording(
|
|
|
203
238
|
({ previousState, newState }) => {
|
|
204
239
|
if (!previousState.hasError && newState.hasError) {
|
|
205
240
|
isRecordErrorSessionReplay = false
|
|
241
|
+
replayTimeAnchorsEnabled = true
|
|
206
242
|
unlockSegment()
|
|
243
|
+
// Error-only recordings do not need periodic anchor-only
|
|
244
|
+
// segments while their buffer is locked. Establish the live
|
|
245
|
+
// timeline immediately when the first error unlocks it.
|
|
246
|
+
emitReplayTimeAnchor()
|
|
207
247
|
}
|
|
208
248
|
}
|
|
209
249
|
)
|
|
@@ -248,6 +288,10 @@ export function startRecording(
|
|
|
248
288
|
beginMandatoryFullSnapshotRecovery,
|
|
249
289
|
$rOnMandatoryFullSnapshotAbandoned:
|
|
250
290
|
discardMandatoryFullSnapshotRecovery,
|
|
291
|
+
$rShouldEmitTimeAnchor: function () {
|
|
292
|
+
return replayTimeAnchorsEnabled
|
|
293
|
+
},
|
|
294
|
+
$rMemoryBudget: replayMemoryBudget,
|
|
251
295
|
onFullSnapshotFailure: stopRecording
|
|
252
296
|
})
|
|
253
297
|
} else {
|
|
@@ -262,12 +306,18 @@ export function startRecording(
|
|
|
262
306
|
beginMandatoryFullSnapshotRecovery,
|
|
263
307
|
$rOnMandatoryFullSnapshotAbandoned:
|
|
264
308
|
discardMandatoryFullSnapshotRecovery,
|
|
309
|
+
$rShouldEmitTimeAnchor: function () {
|
|
310
|
+
return replayTimeAnchorsEnabled
|
|
311
|
+
},
|
|
312
|
+
$rMemoryBudget: replayMemoryBudget,
|
|
265
313
|
onFullSnapshotFailure: stopRecording
|
|
266
314
|
})
|
|
267
315
|
}
|
|
268
316
|
if (!_record || typeof _record.stop !== 'function') {
|
|
269
317
|
throw new Error('Session Replay recorder failed to initialize.')
|
|
270
318
|
}
|
|
319
|
+
emitReplayTimeAnchor =
|
|
320
|
+
_record.$rEmitTimeAnchor || emitReplayTimeAnchor
|
|
271
321
|
var stopRecorder = _record.stop
|
|
272
322
|
if (stopSegmentCollection) {
|
|
273
323
|
// Remove the provisional entry and restore the intended successful-stop
|
|
@@ -311,7 +361,7 @@ export function startRecording(
|
|
|
311
361
|
// mutations are never attached to the stale pre-overflow snapshot.
|
|
312
362
|
_record.flushMutations()
|
|
313
363
|
flushCanvasCommands()
|
|
314
|
-
return
|
|
364
|
+
return emitReplayTimeAnchor()
|
|
315
365
|
}
|
|
316
366
|
if (!flushScheduledFullSnapshot()) {
|
|
317
367
|
// The segment is still writable in this hook. Give a paged raw/shadow
|
|
@@ -324,6 +374,7 @@ export function startRecording(
|
|
|
324
374
|
// still writable here, including the second unload pass after synchronous
|
|
325
375
|
// encoder backpressure is released.
|
|
326
376
|
flushCanvasCommands()
|
|
377
|
+
return emitFinalReplayTimeAnchor()
|
|
327
378
|
}
|
|
328
379
|
requestReplayReset = createReplayResetScheduler(
|
|
329
380
|
takeSubsequentFullSnapshot,
|
package/src/domain/assembly.js
CHANGED
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
isEmptyObject,
|
|
6
6
|
LifeCycleEventType,
|
|
7
7
|
RumEventType,
|
|
8
|
-
|
|
8
|
+
createBoundedBuffer,
|
|
9
|
+
getDeviceInfoWithHighEntropyValues,
|
|
9
10
|
currentDrift,
|
|
10
11
|
createEventRateLimiter,
|
|
11
12
|
limitModification,
|
|
@@ -41,7 +42,8 @@ export function startRumAssembly(
|
|
|
41
42
|
actionContexts,
|
|
42
43
|
displayContext,
|
|
43
44
|
getCommonContext,
|
|
44
|
-
reportError
|
|
45
|
+
reportError,
|
|
46
|
+
getDeviceInfoImp = getDeviceInfoWithHighEntropyValues
|
|
45
47
|
) {
|
|
46
48
|
modifiableFieldPathsByEvent[RumEventType.VIEW] = assign(
|
|
47
49
|
{},
|
|
@@ -90,9 +92,21 @@ export function startRumAssembly(
|
|
|
90
92
|
configuration.eventRateLimiterThreshold,
|
|
91
93
|
reportError
|
|
92
94
|
)
|
|
95
|
+
var pendingRawEvents = createBoundedBuffer()
|
|
96
|
+
var resolvedDeviceInfo
|
|
97
|
+
getDeviceInfoImp(function (deviceInfo) {
|
|
98
|
+
resolvedDeviceInfo = deviceInfo
|
|
99
|
+
pendingRawEvents.drain()
|
|
100
|
+
})
|
|
93
101
|
lifeCycle.subscribe(
|
|
94
102
|
LifeCycleEventType.RAW_RUM_EVENT_COLLECTED,
|
|
95
|
-
function (data) {
|
|
103
|
+
function assemble(data) {
|
|
104
|
+
if (!resolvedDeviceInfo) {
|
|
105
|
+
pendingRawEvents.add(function () {
|
|
106
|
+
assemble(data)
|
|
107
|
+
})
|
|
108
|
+
return
|
|
109
|
+
}
|
|
96
110
|
var startTime = data.startTime
|
|
97
111
|
var rawRumEvent = data.rawRumEvent
|
|
98
112
|
var savedCommonContext = data.savedCommonContext
|
|
@@ -133,7 +147,7 @@ export function startRumAssembly(
|
|
|
133
147
|
application: {
|
|
134
148
|
id: configuration.applicationId
|
|
135
149
|
},
|
|
136
|
-
device:
|
|
150
|
+
device: resolvedDeviceInfo,
|
|
137
151
|
env: configuration.env || '',
|
|
138
152
|
service: viewContext.service || configuration.service || 'browser',
|
|
139
153
|
version: viewContext.version || configuration.version || '',
|
|
@@ -1405,7 +1405,8 @@ function processChildListMutations(
|
|
|
1405
1405
|
parent
|
|
1406
1406
|
)
|
|
1407
1407
|
if (pendingRootTask) {
|
|
1408
|
-
|
|
1408
|
+
var pendingRootNodeWasPublished = isNodePublished(node)
|
|
1409
|
+
if (pendingRootNodeWasPublished) {
|
|
1409
1410
|
mutationTasksController.markPendingRootTaskPublishedDependency(
|
|
1410
1411
|
pendingRootTask
|
|
1411
1412
|
)
|
|
@@ -1417,18 +1418,27 @@ function processChildListMutations(
|
|
|
1417
1418
|
// Several descendants can be removed in one batch. Rebuild the
|
|
1418
1419
|
// unpublished root once after normalization instead of once per node.
|
|
1419
1420
|
pendingRootTasksToRefresh.add(pendingRootTask)
|
|
1421
|
+
if (!pendingRootNodeWasPublished) {
|
|
1422
|
+
continue
|
|
1423
|
+
}
|
|
1424
|
+
// A published descendant can also be serialized under a newly added
|
|
1425
|
+
// ancestor in its current destination. It still needs a remove for
|
|
1426
|
+
// the old replay-tree parent; otherwise the player builds a duplicate
|
|
1427
|
+
// same-id node and later Canvas mutations have an ambiguous target.
|
|
1428
|
+
// Refresh the destination add above, then fall through and emit the
|
|
1429
|
+
// paired published removal below.
|
|
1430
|
+
} else {
|
|
1431
|
+
pendingRootTasksToRefresh.delete(pendingRootTask)
|
|
1432
|
+
if (
|
|
1433
|
+
!mutationTasksController.handlePendingRootRemoval(
|
|
1434
|
+
pendingRootTask,
|
|
1435
|
+
node
|
|
1436
|
+
)
|
|
1437
|
+
) {
|
|
1438
|
+
pendingRootRemovalOverflowed = true
|
|
1439
|
+
}
|
|
1420
1440
|
continue
|
|
1421
1441
|
}
|
|
1422
|
-
pendingRootTasksToRefresh.delete(pendingRootTask)
|
|
1423
|
-
if (
|
|
1424
|
-
!mutationTasksController.handlePendingRootRemoval(
|
|
1425
|
-
pendingRootTask,
|
|
1426
|
-
node
|
|
1427
|
-
)
|
|
1428
|
-
) {
|
|
1429
|
-
pendingRootRemovalOverflowed = true
|
|
1430
|
-
}
|
|
1431
|
-
continue
|
|
1432
1442
|
}
|
|
1433
1443
|
if (hasSerializedNode(node) && isNodePublished(node)) {
|
|
1434
1444
|
var removeMutation = {
|
|
@@ -4,9 +4,22 @@ import {
|
|
|
4
4
|
getScrollY,
|
|
5
5
|
assign,
|
|
6
6
|
addTelemetryDebug,
|
|
7
|
-
getParentNode
|
|
7
|
+
getParentNode,
|
|
8
|
+
setInterval,
|
|
9
|
+
clearInterval
|
|
8
10
|
} from '@cloudcare/browser-core'
|
|
9
11
|
import { getViewportDimension } from '../../initViewportObservable'
|
|
12
|
+
import {
|
|
13
|
+
SESSION_REPLAY_TIME_ANCHOR_INTERVAL,
|
|
14
|
+
SESSION_REPLAY_TIME_ANCHOR_RECORD_TYPE,
|
|
15
|
+
SESSION_REPLAY_TIME_ANCHOR_TAG
|
|
16
|
+
} from '../timeAnchor'
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
SESSION_REPLAY_TIME_ANCHOR_INTERVAL,
|
|
20
|
+
SESSION_REPLAY_TIME_ANCHOR_RECORD_TYPE,
|
|
21
|
+
SESSION_REPLAY_TIME_ANCHOR_TAG
|
|
22
|
+
} from '../timeAnchor'
|
|
10
23
|
|
|
11
24
|
import { RecordType, IncrementalSource } from '../../../types'
|
|
12
25
|
import { NodePrivacyLevel } from '../../../constants'
|
|
@@ -78,6 +91,8 @@ var FULL_SNAPSHOT_MAX_RESTART_COUNT = 3
|
|
|
78
91
|
var FULL_SNAPSHOT_MAX_TOTAL_DURATION_MS = 1000
|
|
79
92
|
var FULL_SNAPSHOT_MAX_WALL_DURATION_MS = 30000
|
|
80
93
|
var FULL_SNAPSHOT_MUTATION_QUIET_DELAY_MS = 250
|
|
94
|
+
var REPLAY_MEMORY_BUDGET_BYTES = 48 * 1024 * 1024
|
|
95
|
+
var REPLAY_MEMORY_HIGH_WATERMARK_BYTES = 32 * 1024 * 1024
|
|
81
96
|
export var MAX_FULL_SNAPSHOT_CANVAS_BASELINE_COUNT = 64
|
|
82
97
|
var FULL_SNAPSHOT_CANVAS_BASELINE_TOTAL_TIMEOUT_MS = 2000
|
|
83
98
|
var FULL_SNAPSHOT_CANVAS_BASELINE_ITEM_TIMEOUT_MS = 1000
|
|
@@ -508,6 +523,65 @@ export function record(options) {
|
|
|
508
523
|
var pendingFullSnapshotBaselineRecords
|
|
509
524
|
var pendingFullSnapshotBaselineMutationVersion
|
|
510
525
|
var fullSnapshotWasPublished = false
|
|
526
|
+
var replayMemoryBudget = options.$rMemoryBudget
|
|
527
|
+
if (replayMemoryBudget) {
|
|
528
|
+
replayMemoryBudget.$rRecord = function () {
|
|
529
|
+
return pendingMutationAdmissionApproxBytes
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
var lastReplayTimeAnchorTimestamp
|
|
534
|
+
function emitReplayTimeAnchor() {
|
|
535
|
+
if (
|
|
536
|
+
!fullSnapshotWasPublished ||
|
|
537
|
+
recordStopping ||
|
|
538
|
+
recordStopped ||
|
|
539
|
+
(options.$rShouldEmitTimeAnchor &&
|
|
540
|
+
!options.$rShouldEmitTimeAnchor())
|
|
541
|
+
) {
|
|
542
|
+
return
|
|
543
|
+
}
|
|
544
|
+
// A time anchor carries no replay state and is safe to drop. Do not put it
|
|
545
|
+
// on the shared deferred queue: `true` must mean that the segment layer
|
|
546
|
+
// actually admitted it, especially for the final stop boundary.
|
|
547
|
+
if (
|
|
548
|
+
suppressRecordsUntilFullSnapshot ||
|
|
549
|
+
mutationPublicationBarrier ||
|
|
550
|
+
deferredRecords.length ||
|
|
551
|
+
deferredRecordAdmissionTimeout !== undefined ||
|
|
552
|
+
pendingMutationPayload ||
|
|
553
|
+
pendingMutationAdmissionQueue.length ||
|
|
554
|
+
mutationAdmissionEmitInProgress ||
|
|
555
|
+
mutationSourceFlushInProgress
|
|
556
|
+
) {
|
|
557
|
+
return false
|
|
558
|
+
}
|
|
559
|
+
var timestamp = timeStampNow()
|
|
560
|
+
if (timestamp === lastReplayTimeAnchorTimestamp) {
|
|
561
|
+
return true
|
|
562
|
+
}
|
|
563
|
+
lastEmitWasLocallyBackpressured = false
|
|
564
|
+
var accepted = rawEmit({
|
|
565
|
+
type: SESSION_REPLAY_TIME_ANCHOR_RECORD_TYPE,
|
|
566
|
+
timestamp: timestamp,
|
|
567
|
+
data: {
|
|
568
|
+
tag: SESSION_REPLAY_TIME_ANCHOR_TAG,
|
|
569
|
+
payload: {}
|
|
570
|
+
}
|
|
571
|
+
})
|
|
572
|
+
if (accepted === false) {
|
|
573
|
+
return false
|
|
574
|
+
}
|
|
575
|
+
lastReplayTimeAnchorTimestamp = timestamp
|
|
576
|
+
return true
|
|
577
|
+
}
|
|
578
|
+
var replayTimeAnchorIntervalId = setInterval(
|
|
579
|
+
emitReplayTimeAnchor,
|
|
580
|
+
SESSION_REPLAY_TIME_ANCHOR_INTERVAL
|
|
581
|
+
)
|
|
582
|
+
registerInitializationCleanup(function () {
|
|
583
|
+
clearInterval(replayTimeAnchorIntervalId)
|
|
584
|
+
})
|
|
511
585
|
var domMutationVersion = 0
|
|
512
586
|
var mutationActivityTargets = new Set()
|
|
513
587
|
var mutationActivityFlushScheduled = false
|
|
@@ -650,9 +724,14 @@ export function record(options) {
|
|
|
650
724
|
) {
|
|
651
725
|
return true
|
|
652
726
|
}
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
727
|
+
// Serializing a newly added ancestor can stage an already-published
|
|
728
|
+
// descendant before the paired remove is normalized. This is the
|
|
729
|
+
// common DOM shape used by Cocos Creator when it inserts a wrapper and
|
|
730
|
+
// moves its existing GameCanvas into it. Until the destination add is
|
|
731
|
+
// queued, the node still belongs to the previously published replay
|
|
732
|
+
// tree and must remain eligible for the atomic remove + add transition.
|
|
733
|
+
// A genuinely new node has no previous publication token and therefore
|
|
734
|
+
// still falls through to false below.
|
|
656
735
|
}
|
|
657
736
|
var publicationToken = publicationTokenByNode.get(node)
|
|
658
737
|
return Boolean(
|
|
@@ -1125,7 +1204,10 @@ export function record(options) {
|
|
|
1125
1204
|
)
|
|
1126
1205
|
}
|
|
1127
1206
|
|
|
1128
|
-
function tryMergePendingPureAddMutationAdmission(
|
|
1207
|
+
function tryMergePendingPureAddMutationAdmission(
|
|
1208
|
+
entry,
|
|
1209
|
+
admissionBytesLimit
|
|
1210
|
+
) {
|
|
1129
1211
|
var previousEntry =
|
|
1130
1212
|
pendingMutationAdmissionQueue[
|
|
1131
1213
|
pendingMutationAdmissionQueue.length - 1
|
|
@@ -1139,7 +1221,7 @@ export function record(options) {
|
|
|
1139
1221
|
!isPureAddMutationPayload(mutationPayload) ||
|
|
1140
1222
|
previousEntry[1] + entry[1] > MAX_MUTATION_EMIT_APPROX_BYTES ||
|
|
1141
1223
|
pendingMutationAdmissionApproxBytes + entry[1] >
|
|
1142
|
-
|
|
1224
|
+
admissionBytesLimit
|
|
1143
1225
|
) {
|
|
1144
1226
|
return false
|
|
1145
1227
|
}
|
|
@@ -1171,16 +1253,27 @@ export function record(options) {
|
|
|
1171
1253
|
})
|
|
1172
1254
|
return
|
|
1173
1255
|
}
|
|
1256
|
+
var admissionBytesLimit = replayMemoryBudget
|
|
1257
|
+
? Math.min(
|
|
1258
|
+
MAX_PENDING_MUTATION_ADMISSION_APPROX_BYTES,
|
|
1259
|
+
REPLAY_MEMORY_BUDGET_BYTES - replayMemoryBudget.$rSegment()
|
|
1260
|
+
)
|
|
1261
|
+
: MAX_PENDING_MUTATION_ADMISSION_APPROX_BYTES
|
|
1174
1262
|
for (var entryIndex = 0; entryIndex < mutationEntries.length; entryIndex += 1) {
|
|
1175
1263
|
var entry = mutationEntries[entryIndex]
|
|
1176
|
-
if (
|
|
1264
|
+
if (
|
|
1265
|
+
tryMergePendingPureAddMutationAdmission(
|
|
1266
|
+
entry,
|
|
1267
|
+
admissionBytesLimit
|
|
1268
|
+
)
|
|
1269
|
+
) {
|
|
1177
1270
|
continue
|
|
1178
1271
|
}
|
|
1179
1272
|
if (
|
|
1180
1273
|
pendingMutationAdmissionQueue.length + 1 >
|
|
1181
1274
|
MAX_PENDING_MUTATION_ADMISSION_PAYLOADS ||
|
|
1182
1275
|
pendingMutationAdmissionApproxBytes + entry[1] >
|
|
1183
|
-
|
|
1276
|
+
admissionBytesLimit
|
|
1184
1277
|
) {
|
|
1185
1278
|
var rejectedTail = mutationEntries.slice(entryIndex)
|
|
1186
1279
|
rejectedTail.forEach(function (rejectedEntry) {
|
|
@@ -1743,6 +1836,20 @@ export function record(options) {
|
|
|
1743
1836
|
}
|
|
1744
1837
|
|
|
1745
1838
|
function snapshotCanvasIfActive(canvas, snapshotOptions) {
|
|
1839
|
+
if (
|
|
1840
|
+
replayMemoryBudget &&
|
|
1841
|
+
pendingMutationAdmissionApproxBytes +
|
|
1842
|
+
replayMemoryBudget.$rSegment() >=
|
|
1843
|
+
REPLAY_MEMORY_HIGH_WATERMARK_BYTES &&
|
|
1844
|
+
snapshotOptions &&
|
|
1845
|
+
(snapshotOptions.scheduler === 'continuous_snapshot' ||
|
|
1846
|
+
snapshotOptions.scheduler === 'webgl_snapshot')
|
|
1847
|
+
) {
|
|
1848
|
+
return Promise.resolve({
|
|
1849
|
+
ok: false,
|
|
1850
|
+
reason: 'memory_pressure'
|
|
1851
|
+
})
|
|
1852
|
+
}
|
|
1746
1853
|
if (isNodeIgnored(canvas)) {
|
|
1747
1854
|
return Promise.resolve({
|
|
1748
1855
|
ok: false,
|
|
@@ -3523,6 +3630,9 @@ export function record(options) {
|
|
|
3523
3630
|
}
|
|
3524
3631
|
recordStopped = true
|
|
3525
3632
|
;[
|
|
3633
|
+
function () {
|
|
3634
|
+
clearInterval(replayTimeAnchorIntervalId)
|
|
3635
|
+
},
|
|
3526
3636
|
discardPendingMutationAdmissions,
|
|
3527
3637
|
cancelMutationSourceFlushContinuation,
|
|
3528
3638
|
cancelScheduledFullSnapshot,
|
|
@@ -3563,6 +3673,7 @@ export function record(options) {
|
|
|
3563
3673
|
|
|
3564
3674
|
var recorder = {
|
|
3565
3675
|
stop: stopRecording,
|
|
3676
|
+
$rEmitTimeAnchor: emitReplayTimeAnchor,
|
|
3566
3677
|
$rFlushCanvasCommands: function () {
|
|
3567
3678
|
// A previous boundary pass may have preserved the exact Canvas record
|
|
3568
3679
|
// after transient segment/encoder backpressure. Retry that object before
|
|
@@ -3629,6 +3740,7 @@ function createInactiveRecorder() {
|
|
|
3629
3740
|
var noop = function () {}
|
|
3630
3741
|
var recorder = {
|
|
3631
3742
|
stop: noop,
|
|
3743
|
+
$rEmitTimeAnchor: noop,
|
|
3632
3744
|
$rFlushCanvasCommands: noop,
|
|
3633
3745
|
snapshotCanvas: noop,
|
|
3634
3746
|
getSerializedNodeIdForDebug: noop,
|