@cloudcare/browser-rum 3.2.27 → 3.2.29
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/domain/deflate/deflateEncoder.js +16 -0
- package/cjs/domain/deflate/deflateEncoder.js.map +1 -1
- package/cjs/domain/deflate/deflateWorker.js +1 -1
- package/cjs/domain/rumEventsCollection/actions/computeFrustration.js +5 -1
- package/cjs/domain/rumEventsCollection/actions/computeFrustration.js.map +1 -1
- package/cjs/domain/rumEventsCollection/actions/getSelectorsFromElement.js +0 -1
- package/cjs/domain/rumEventsCollection/actions/getSelectorsFromElement.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/matchRequestResourceEntry.js +0 -1
- package/cjs/domain/rumEventsCollection/resource/matchRequestResourceEntry.js.map +1 -1
- package/cjs/domain/rumEventsCollection/resource/resourceUtils.js +0 -64
- package/cjs/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -1
- package/cjs/domain/rumEventsCollection/view/viewCollection.js +3 -2
- package/cjs/domain/rumEventsCollection/view/viewCollection.js.map +1 -1
- package/cjs/domain/tracing/ddtraceTracer.js +1 -1
- package/cjs/domain/tracing/ddtraceTracer.js.map +1 -1
- package/cjs/domain/tracing/jaegerTracer.js +1 -1
- package/cjs/domain/tracing/jaegerTracer.js.map +1 -1
- package/cjs/domain/tracing/skywalkingTracer.js +2 -2
- package/cjs/domain/tracing/skywalkingTracer.js.map +1 -1
- package/cjs/domain/tracing/tracer.js +0 -1
- package/cjs/domain/tracing/tracer.js.map +1 -1
- package/cjs/domain/tracing/w3cTraceParentTracer.js +1 -3
- package/cjs/domain/tracing/w3cTraceParentTracer.js.map +1 -1
- package/cjs/domain/tracing/zipkinMultiTracer.js +1 -1
- package/cjs/domain/tracing/zipkinMultiTracer.js.map +1 -1
- package/cjs/domain/tracing/zipkinSingleTracer.js +1 -1
- package/cjs/domain/tracing/zipkinSingleTracer.js.map +1 -1
- package/cjs/domain/usr/index.js +1 -1
- package/cjs/domain/usr/index.js.map +1 -1
- package/esm/boot/buildEnv.js +1 -1
- package/esm/domain/deflate/deflateEncoder.js +16 -0
- package/esm/domain/deflate/deflateEncoder.js.map +1 -1
- package/esm/domain/deflate/deflateWorker.js +1 -1
- package/esm/domain/rumEventsCollection/actions/computeFrustration.js +5 -1
- package/esm/domain/rumEventsCollection/actions/computeFrustration.js.map +1 -1
- package/esm/domain/rumEventsCollection/actions/getSelectorsFromElement.js +0 -1
- package/esm/domain/rumEventsCollection/actions/getSelectorsFromElement.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/matchRequestResourceEntry.js +0 -1
- package/esm/domain/rumEventsCollection/resource/matchRequestResourceEntry.js.map +1 -1
- package/esm/domain/rumEventsCollection/resource/resourceUtils.js +0 -64
- package/esm/domain/rumEventsCollection/resource/resourceUtils.js.map +1 -1
- package/esm/domain/rumEventsCollection/view/viewCollection.js +4 -3
- package/esm/domain/rumEventsCollection/view/viewCollection.js.map +1 -1
- package/esm/domain/tracing/ddtraceTracer.js +1 -1
- package/esm/domain/tracing/ddtraceTracer.js.map +1 -1
- package/esm/domain/tracing/jaegerTracer.js +1 -1
- package/esm/domain/tracing/jaegerTracer.js.map +1 -1
- package/esm/domain/tracing/skywalkingTracer.js +2 -2
- package/esm/domain/tracing/skywalkingTracer.js.map +1 -1
- package/esm/domain/tracing/tracer.js +0 -1
- package/esm/domain/tracing/tracer.js.map +1 -1
- package/esm/domain/tracing/w3cTraceParentTracer.js +1 -3
- package/esm/domain/tracing/w3cTraceParentTracer.js.map +1 -1
- package/esm/domain/tracing/zipkinMultiTracer.js +1 -1
- package/esm/domain/tracing/zipkinMultiTracer.js.map +1 -1
- package/esm/domain/tracing/zipkinSingleTracer.js +1 -1
- package/esm/domain/tracing/zipkinSingleTracer.js.map +1 -1
- package/esm/domain/usr/index.js +2 -2
- package/esm/domain/usr/index.js.map +1 -1
- package/package.json +35 -35
- package/src/domain/deflate/deflateEncoder.js +13 -0
- package/src/domain/rumEventsCollection/actions/computeFrustration.js +7 -1
- package/src/domain/rumEventsCollection/actions/getSelectorsFromElement.js +0 -1
- package/src/domain/rumEventsCollection/resource/matchRequestResourceEntry.js +0 -1
- package/src/domain/rumEventsCollection/resource/resourceUtils.js +0 -63
- package/src/domain/rumEventsCollection/view/viewCollection.js +5 -3
- package/src/domain/tracing/ddtraceTracer.js +1 -1
- package/src/domain/tracing/jaegerTracer.js +1 -1
- package/src/domain/tracing/skywalkingTracer.js +2 -2
- package/src/domain/tracing/tracer.js +0 -1
- package/src/domain/tracing/w3cTraceParentTracer.js +1 -3
- package/src/domain/tracing/zipkinMultiTracer.js +1 -1
- package/src/domain/tracing/zipkinSingleTracer.js +1 -1
- package/src/domain/usr/index.js +10 -2
|
@@ -171,70 +171,7 @@ export function isCacheHit(entry) {
|
|
|
171
171
|
// fall back to duration checking (non-RT2 or cross-origin)
|
|
172
172
|
return entry.duration < 30
|
|
173
173
|
}
|
|
174
|
-
// interface PerformanceResourceDetails {
|
|
175
|
-
// redirect?: PerformanceResourceDetailsElement
|
|
176
|
-
// dns?: PerformanceResourceDetailsElement
|
|
177
|
-
// connect?: PerformanceResourceDetailsElement
|
|
178
|
-
// ssl?: PerformanceResourceDetailsElement
|
|
179
|
-
// firstByte: PerformanceResourceDetailsElement
|
|
180
|
-
// download: PerformanceResourceDetailsElement
|
|
181
|
-
// fmp:
|
|
182
|
-
// }
|
|
183
|
-
// page_fmp float 首屏时间(用于衡量用户什么时候看到页面的主要内容),跟FCP的时长非常接近,这里我们就用FCP的时间作为首屏时间 firstPaintContentEnd - firstPaintContentStart
|
|
184
|
-
// page_fpt float 首次渲染时间,即白屏时间(从请求开始到浏览器开始解析第一批HTML文档字节的时间差。) responseEnd - fetchStart
|
|
185
|
-
// page_tti float 首次可交互时间(浏览器完成所有HTML解析并且完成DOM构建,此时浏览器开始加载资源。) domInteractive - fetchStart
|
|
186
|
-
// page_firstbyte float 首包时间 responseStart - domainLookupStart
|
|
187
|
-
// page_dom_ready float DOM Ready时间(如果页面有同步执行的JS,则同步JS执行时间=ready-tti。) domContentLoadEventEnd - fetchStart
|
|
188
|
-
// page_load float 页面完全加载时间(load=首次渲染时间+DOM解析耗时+同步JS执行+资源加载耗时。) loadEventStart - fetchStart
|
|
189
|
-
// page_dns float dns解析时间 domainLookupEnd - domainLookupStart
|
|
190
|
-
// page_tcp float tcp连接时间 connectEnd - connectStart
|
|
191
|
-
// page_ssl float ssl安全连接时间(仅适用于https) connectEnd - secureConnectionStart
|
|
192
|
-
// page_ttfb float 请求响应耗时 responseStart - requestStart
|
|
193
|
-
// page_trans float 内容传输时间 responseEnd - responseStart
|
|
194
|
-
// page_dom float DOM解析耗时 domInteractive - responseEnd
|
|
195
|
-
// page_resource_load_time float 资源加载时间 loadEventStart - domContentLoadedEventEnd
|
|
196
174
|
|
|
197
|
-
// navigationStart:当前浏览器窗口的前一个网页关闭,发生unload事件时的Unix毫秒时间戳。如果没有前一个网页,则等于fetchStart属性。
|
|
198
|
-
|
|
199
|
-
// · unloadEventStart:如果前一个网页与当前网页属于同一个域名,则返回前一个网页的unload事件发生时的Unix毫秒时间戳。如果没有前一个网页,或者之前的网页跳转不是在同一个域名内,则返回值为0。
|
|
200
|
-
|
|
201
|
-
// · unloadEventEnd:如果前一个网页与当前网页属于同一个域名,则返回前一个网页unload事件的回调函数结束时的Unix毫秒时间戳。如果没有前一个网页,或者之前的网页跳转不是在同一个域名内,则返回值为0。
|
|
202
|
-
|
|
203
|
-
// · redirectStart:返回第一个HTTP跳转开始时的Unix毫秒时间戳。如果没有跳转,或者不是同一个域名内部的跳转,则返回值为0。
|
|
204
|
-
|
|
205
|
-
// · redirectEnd:返回最后一个HTTP跳转结束时(即跳转回应的最后一个字节接受完成时)的Unix毫秒时间戳。如果没有跳转,或者不是同一个域名内部的跳转,则返回值为0。
|
|
206
|
-
|
|
207
|
-
// · fetchStart:返回浏览器准备使用HTTP请求读取文档时的Unix毫秒时间戳。该事件在网页查询本地缓存之前发生。
|
|
208
|
-
|
|
209
|
-
// · domainLookupStart:返回域名查询开始时的Unix毫秒时间戳。如果使用持久连接,或者信息是从本地缓存获取的,则返回值等同于fetchStart属性的值。
|
|
210
|
-
|
|
211
|
-
// · domainLookupEnd:返回域名查询结束时的Unix毫秒时间戳。如果使用持久连接,或者信息是从本地缓存获取的,则返回值等同于fetchStart属性的值。
|
|
212
|
-
|
|
213
|
-
// · connectStart:返回HTTP请求开始向服务器发送时的Unix毫秒时间戳。如果使用持久连接(persistent connection),则返回值等同于fetchStart属性的值。
|
|
214
|
-
|
|
215
|
-
// · connectEnd:返回浏览器与服务器之间的连接建立时的Unix毫秒时间戳。如果建立的是持久连接,则返回值等同于fetchStart属性的值。连接建立指的是所有握手和认证过程全部结束。
|
|
216
|
-
|
|
217
|
-
// · secureConnectionStart:返回浏览器与服务器开始安全链接的握手时的Unix毫秒时间戳。如果当前网页不要求安全连接,则返回0。
|
|
218
|
-
|
|
219
|
-
// · requestStart:返回浏览器向服务器发出HTTP请求时(或开始读取本地缓存时)的Unix毫秒时间戳。
|
|
220
|
-
|
|
221
|
-
// · responseStart:返回浏览器从服务器收到(或从本地缓存读取)第一个字节时的Unix毫秒时间戳。
|
|
222
|
-
|
|
223
|
-
// · responseEnd:返回浏览器从服务器收到(或从本地缓存读取)最后一个字节时(如果在此之前HTTP连接已经关闭,则返回关闭时)的Unix毫秒时间戳。
|
|
224
|
-
|
|
225
|
-
// · domLoading:返回当前网页DOM结构开始解析时(即Document.readyState属性变为“loading”、相应的readystatechange事件触发时)的Unix毫秒时间戳。
|
|
226
|
-
|
|
227
|
-
// · domInteractive:返回当前网页DOM结构结束解析、开始加载内嵌资源时(即Document.readyState属性变为“interactive”、相应的readystatechange事件触发时)的Unix毫秒时间戳。
|
|
228
|
-
|
|
229
|
-
// · domContentLoadedEventStart:返回当前网页DOMContentLoaded事件发生时(即DOM结构解析完毕、所有脚本开始运行时)的Unix毫秒时间戳。
|
|
230
|
-
|
|
231
|
-
// · domContentLoadedEventEnd:返回当前网页所有需要执行的脚本执行完成时的Unix毫秒时间戳。
|
|
232
|
-
|
|
233
|
-
// · domComplete:返回当前网页DOM结构生成时(即Document.readyState属性变为“complete”,以及相应的readystatechange事件发生时)的Unix毫秒时间戳。
|
|
234
|
-
|
|
235
|
-
// · loadEventStart:返回当前网页load事件的回调函数开始时的Unix毫秒时间戳。如果该事件还没有发生,返回0。
|
|
236
|
-
|
|
237
|
-
// · loadEventEnd:返回当前网页load事件的回调函数运行结束时的Unix毫秒时间戳。如果该事件还没有发生,返回0
|
|
238
175
|
export function computePerformanceResourceDetails(entry) {
|
|
239
176
|
if (!hasValidResourceEntryTimings(entry)) {
|
|
240
177
|
return undefined
|
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
LifeCycleEventType,
|
|
8
8
|
extend2Lev,
|
|
9
9
|
findByPath,
|
|
10
|
-
discardNegativeDuration
|
|
10
|
+
discardNegativeDuration,
|
|
11
|
+
timeStampNow
|
|
11
12
|
} from '@cloudcare/browser-core'
|
|
12
13
|
import { trackViews } from './trackViews'
|
|
13
14
|
export function startViewCollection(
|
|
@@ -57,7 +58,7 @@ function computePerformanceViewDetails(navigationTimings) {
|
|
|
57
58
|
responseEnd > fetchStart
|
|
58
59
|
) {
|
|
59
60
|
details.fpt = toServerDuration(responseEnd - fetchStart)
|
|
60
|
-
var apdexLevel = parseInt((responseEnd - fetchStart) / 1000)
|
|
61
|
+
var apdexLevel = parseInt((responseEnd - fetchStart) / 1000)
|
|
61
62
|
details.apdexLevel = apdexLevel > 9 ? 9 : apdexLevel
|
|
62
63
|
}
|
|
63
64
|
if (
|
|
@@ -116,7 +117,8 @@ function processViewUpdate(view, configuration, recorderApi, pageStateHistory) {
|
|
|
116
117
|
_gc: {
|
|
117
118
|
document_version: view.documentVersion,
|
|
118
119
|
replay_stats: replayStats,
|
|
119
|
-
page_states: pageStates
|
|
120
|
+
page_states: pageStates,
|
|
121
|
+
view_update_time: view.documentVersion
|
|
120
122
|
},
|
|
121
123
|
date: view.startClocks.timeStamp,
|
|
122
124
|
type: RumEventType.VIEW,
|
|
@@ -2,7 +2,7 @@ import { TraceIdentifier, getCrypto } from './traceIdentifier'
|
|
|
2
2
|
import { getType } from '@cloudcare/browser-core'
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
5
|
-
* @param {*} configuration
|
|
5
|
+
* @param {*} configuration
|
|
6
6
|
*/
|
|
7
7
|
export function DDtraceTracer(configuration, traceSampled) {
|
|
8
8
|
this._spanId = new TraceIdentifier()
|
|
@@ -2,7 +2,7 @@ import { TraceIdentifier, getCrypto } from './traceIdentifier'
|
|
|
2
2
|
import { getType } from '@cloudcare/browser-core'
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
5
|
-
* @param {*} configuration
|
|
5
|
+
* @param {*} configuration
|
|
6
6
|
*/
|
|
7
7
|
export function JaegerTracer(configuration, traceSampled) {
|
|
8
8
|
this._traceId = new TraceIdentifier()
|
|
@@ -57,8 +57,8 @@ function getSkyWalkingSw8(
|
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
*
|
|
60
|
-
* @param {*} configuration
|
|
61
|
-
* @param {*} requestUrl
|
|
60
|
+
* @param {*} configuration
|
|
61
|
+
* @param {*} requestUrl
|
|
62
62
|
*/
|
|
63
63
|
export function SkyWalkingTracer(configuration, requestUrl, traceSampled) {
|
|
64
64
|
this._spanId = uuid()
|
|
@@ -14,7 +14,7 @@ function randomTraceId() {
|
|
|
14
14
|
/**
|
|
15
15
|
*
|
|
16
16
|
* @param {*} traceSampled
|
|
17
|
-
* @param {*} isHexTraceId
|
|
17
|
+
* @param {*} isHexTraceId
|
|
18
18
|
*/
|
|
19
19
|
export function W3cTraceParentTracer(
|
|
20
20
|
configuration,
|
|
@@ -49,7 +49,6 @@ W3cTraceParentTracer.prototype = {
|
|
|
49
49
|
return this.customTraceId
|
|
50
50
|
}
|
|
51
51
|
if (this.isHexTraceId) {
|
|
52
|
-
// 转化为二进制之后上报
|
|
53
52
|
return this._traceId.toDecimalString()
|
|
54
53
|
} else {
|
|
55
54
|
return (
|
|
@@ -61,7 +60,6 @@ W3cTraceParentTracer.prototype = {
|
|
|
61
60
|
getTraceParent: function () {
|
|
62
61
|
// '{version}-{traceId}-{spanId}-{sampleDecision}'
|
|
63
62
|
if (this.isHexTraceId) {
|
|
64
|
-
// 短64位,前面补0
|
|
65
63
|
return (
|
|
66
64
|
'00-0000000000000000' +
|
|
67
65
|
this._traceId.toPaddedHexadecimalString() +
|
|
@@ -2,7 +2,7 @@ import { TraceIdentifier, getCrypto } from './traceIdentifier'
|
|
|
2
2
|
import { getType } from '@cloudcare/browser-core'
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
5
|
-
* @param {*} configuration
|
|
5
|
+
* @param {*} configuration
|
|
6
6
|
*/
|
|
7
7
|
export function ZipkinMultiTracer(configuration, traceSampled) {
|
|
8
8
|
this._traceId = new TraceIdentifier()
|
|
@@ -2,7 +2,7 @@ import { TraceIdentifier, getCrypto } from './traceIdentifier'
|
|
|
2
2
|
import { getType } from '@cloudcare/browser-core'
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
5
|
-
* @param {*} configuration
|
|
5
|
+
* @param {*} configuration
|
|
6
6
|
*/
|
|
7
7
|
export function ZipkinSingleTracer(configuration, traceSampled) {
|
|
8
8
|
this._traceId = new TraceIdentifier()
|
package/src/domain/usr/index.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
getCookie,
|
|
3
|
+
setCookie,
|
|
4
|
+
UUID,
|
|
5
|
+
ONE_HOUR,
|
|
6
|
+
SessionPersistence
|
|
7
|
+
} from '@cloudcare/browser-core'
|
|
2
8
|
export var USR_ID_COOKIE_NAME = '_gc_usr_id'
|
|
3
9
|
export var ANONYMOUS_ID_EXPIRATION = 60 * 24 * ONE_HOUR
|
|
4
10
|
|
|
@@ -26,7 +32,9 @@ function initUsrLocalStorage() {
|
|
|
26
32
|
export var startCacheUsrCache = function (configuration) {
|
|
27
33
|
if (!configuration.sessionStoreStrategyType) return
|
|
28
34
|
let usrCacheId
|
|
29
|
-
if (
|
|
35
|
+
if (
|
|
36
|
+
configuration.sessionStoreStrategyType.type === SessionPersistence.COOKIE
|
|
37
|
+
) {
|
|
30
38
|
usrCacheId = initUsrCookie(
|
|
31
39
|
configuration.sessionStoreStrategyType.cookieOptions
|
|
32
40
|
)
|