@cloudcare/browser-rum 3.0.6 → 3.0.7
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 +1 -1
- package/cjs/boot/rum.js +16 -7
- package/cjs/boot/rumPublicApi.js +27 -55
- package/cjs/domain/assembly.js +2 -2
- package/cjs/domain/contexts/commonContext.js +14 -0
- package/cjs/domain/performanceCollection.js +3 -3
- package/cjs/domain/replay/record/serialize.js +7 -5
- package/cjs/domain/replay/segmentCollection/segmentCollection.js +2 -2
- package/cjs/domain/replay/segmentCollection/startDeflateWorker.js +2 -2
- package/cjs/domain/rumEventsCollection/actions/clickChain.js +3 -3
- package/cjs/domain/rumEventsCollection/view/trackInitialViewTimings.js +34 -10
- package/cjs/domain/rumEventsCollection/view/trackViewEventCounts.js +1 -1
- package/cjs/domain/rumEventsCollection/view/trackViews.js +45 -67
- package/cjs/domain/rumEventsCollection/view/viewCollection.js +2 -1
- package/cjs/domain/rumSessionManager.js +3 -1
- package/cjs/domain/waitPageActivityEnd.js +9 -9
- package/cjs/transport/startRumBatch.js +20 -6
- package/esm/boot/buildEnv.js +1 -1
- package/esm/boot/recorderApi.js +1 -1
- package/esm/boot/rum.js +15 -7
- package/esm/boot/rumPublicApi.js +25 -54
- package/esm/domain/assembly.js +2 -2
- package/esm/domain/contexts/commonContext.js +7 -0
- package/esm/domain/performanceCollection.js +2 -2
- package/esm/domain/replay/record/serialize.js +7 -5
- package/esm/domain/replay/segmentCollection/segmentCollection.js +1 -1
- package/esm/domain/replay/segmentCollection/startDeflateWorker.js +3 -3
- package/esm/domain/rumEventsCollection/actions/clickChain.js +1 -1
- package/esm/domain/rumEventsCollection/view/trackInitialViewTimings.js +33 -10
- package/esm/domain/rumEventsCollection/view/trackViewEventCounts.js +1 -1
- package/esm/domain/rumEventsCollection/view/trackViews.js +46 -68
- package/esm/domain/rumEventsCollection/view/viewCollection.js +2 -1
- package/esm/domain/rumSessionManager.js +3 -1
- package/esm/domain/waitPageActivityEnd.js +3 -3
- package/esm/transport/startRumBatch.js +21 -7
- package/package.json +31 -31
- package/src/boot/recorderApi.js +1 -0
- package/src/boot/rum.js +29 -9
- package/src/boot/rumPublicApi.js +37 -51
- package/src/domain/assembly.js +2 -2
- package/src/domain/contexts/commonContext.js +11 -0
- package/src/domain/performanceCollection.js +4 -2
- package/src/domain/replay/record/serialize.js +6 -5
- package/src/domain/replay/segmentCollection/segmentCollection.js +3 -1
- package/src/domain/replay/segmentCollection/startDeflateWorker.js +8 -3
- package/src/domain/rumEventsCollection/actions/clickChain.js +6 -1
- package/src/domain/rumEventsCollection/view/trackInitialViewTimings.js +42 -11
- package/src/domain/rumEventsCollection/view/trackViewEventCounts.js +1 -1
- package/src/domain/rumEventsCollection/view/trackViews.js +69 -77
- package/src/domain/rumEventsCollection/view/viewCollection.js +2 -1
- package/src/domain/rumSessionManager.js +3 -1
- package/src/domain/waitPageActivityEnd.js +8 -5
- package/src/transport/startRumBatch.js +35 -12
|
@@ -5,7 +5,9 @@ import {
|
|
|
5
5
|
LifeCycleEventType,
|
|
6
6
|
some,
|
|
7
7
|
matchList,
|
|
8
|
-
instrumentMethodAndCallOriginal
|
|
8
|
+
instrumentMethodAndCallOriginal,
|
|
9
|
+
setTimeout,
|
|
10
|
+
clearTimeout
|
|
9
11
|
} from '@cloudcare/browser-core'
|
|
10
12
|
|
|
11
13
|
// Delay to wait for a page activity to validate the tracking process
|
|
@@ -75,10 +77,11 @@ export function doWaitPageActivityEnd(
|
|
|
75
77
|
}, PAGE_ACTIVITY_VALIDATION_DELAY)
|
|
76
78
|
|
|
77
79
|
var maxDurationTimeoutId =
|
|
78
|
-
maxDuration
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
maxDuration !== undefined
|
|
81
|
+
? setTimeout(function () {
|
|
82
|
+
return complete({ hadActivity: true, end: timeStampNow() })
|
|
83
|
+
}, maxDuration)
|
|
84
|
+
: undefined
|
|
82
85
|
|
|
83
86
|
var pageActivitySubscription = pageActivityObservable.subscribe(function (
|
|
84
87
|
data
|
|
@@ -2,16 +2,23 @@ import {
|
|
|
2
2
|
Batch,
|
|
3
3
|
createHttpRequest,
|
|
4
4
|
LifeCycleEventType,
|
|
5
|
-
RumEventType
|
|
5
|
+
RumEventType,
|
|
6
|
+
createFlushController
|
|
6
7
|
} from '@cloudcare/browser-core'
|
|
7
8
|
|
|
8
9
|
export function startRumBatch(
|
|
9
10
|
configuration,
|
|
10
11
|
lifeCycle,
|
|
11
12
|
reportError,
|
|
12
|
-
pageExitObservable
|
|
13
|
+
pageExitObservable,
|
|
14
|
+
sessionExpireObservable
|
|
13
15
|
) {
|
|
14
|
-
var batch = makeRumBatch(
|
|
16
|
+
var batch = makeRumBatch(
|
|
17
|
+
configuration,
|
|
18
|
+
reportError,
|
|
19
|
+
pageExitObservable,
|
|
20
|
+
sessionExpireObservable
|
|
21
|
+
)
|
|
15
22
|
|
|
16
23
|
lifeCycle.subscribe(
|
|
17
24
|
LifeCycleEventType.RUM_EVENT_COLLECTED,
|
|
@@ -25,24 +32,40 @@ export function startRumBatch(
|
|
|
25
32
|
)
|
|
26
33
|
}
|
|
27
34
|
|
|
28
|
-
function makeRumBatch(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
function makeRumBatch(
|
|
36
|
+
configuration,
|
|
37
|
+
reportError,
|
|
38
|
+
pageExitObservable,
|
|
39
|
+
sessionExpireObservable
|
|
40
|
+
) {
|
|
41
|
+
var rumBatch = createRumBatch(configuration.datakitUrl)
|
|
42
|
+
var primaryBatch = rumBatch.batch
|
|
43
|
+
var primaryFlushController = rumBatch.flushController
|
|
44
|
+
function createRumBatch(endpointUrl) {
|
|
45
|
+
var flushController = createFlushController({
|
|
46
|
+
messagesLimit: configuration.batchMessagesLimit,
|
|
47
|
+
bytesLimit: configuration.batchBytesLimit,
|
|
48
|
+
durationLimit: configuration.flushTimeout,
|
|
49
|
+
pageExitObservable: pageExitObservable,
|
|
50
|
+
sessionExpireObservable: sessionExpireObservable
|
|
51
|
+
})
|
|
52
|
+
var batch = new Batch(
|
|
32
53
|
createHttpRequest(
|
|
33
54
|
endpointUrl,
|
|
34
55
|
configuration.batchBytesLimit,
|
|
35
56
|
reportError
|
|
36
57
|
),
|
|
37
|
-
|
|
38
|
-
configuration.
|
|
39
|
-
configuration.messageBytesLimit,
|
|
40
|
-
configuration.flushTimeout,
|
|
41
|
-
pageExitObservable
|
|
58
|
+
flushController,
|
|
59
|
+
configuration.messageBytesLimit
|
|
42
60
|
)
|
|
61
|
+
return {
|
|
62
|
+
batch: batch,
|
|
63
|
+
flushController: flushController
|
|
64
|
+
}
|
|
43
65
|
}
|
|
44
66
|
|
|
45
67
|
return {
|
|
68
|
+
flushObservable: primaryFlushController.flushObservable,
|
|
46
69
|
add: function (message) {
|
|
47
70
|
primaryBatch.add(message)
|
|
48
71
|
},
|