@cloudcare/browser-core 1.2.3 → 1.2.5

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.
@@ -49,7 +49,8 @@ function validateAndBuildConfiguration(initConfiguration) {
49
49
  * Logs intake limit
50
50
  */
51
51
  batchMessagesLimit: 50,
52
- messageBytesLimit: 256 * _tools.ONE_KIBI_BYTE
52
+ messageBytesLimit: 256 * _tools.ONE_KIBI_BYTE,
53
+ resourceUrlLimit: 5 * _tools.ONE_KIBI_BYTE
53
54
  }, (0, _transportConfiguration.computeTransportConfiguration)(initConfiguration));
54
55
  }
55
56
 
package/cjs/dataMap.js CHANGED
@@ -96,7 +96,14 @@ var dataMap = {
96
96
  resource_ssl: 'resource.ssl',
97
97
  resource_ttfb: 'resource.ttfb',
98
98
  resource_trans: 'resource.trans',
99
- resource_first_byte: 'resource.firstbyte'
99
+ resource_redirect: 'resource.redirect',
100
+ resource_first_byte: 'resource.firstbyte',
101
+ resource_dns_time: 'resource.dns_time',
102
+ resource_download_time: 'resource.download_time',
103
+ resource_first_byte_time: 'resource.first_byte_time',
104
+ resource_connect_time: 'resource.connect_time',
105
+ resource_ssl_time: 'resource.ssl_time',
106
+ resource_redirect_time: 'resource.redirect_time'
100
107
  }
101
108
  },
102
109
  error: {
@@ -35,7 +35,8 @@ export function validateAndBuildConfiguration(initConfiguration) {
35
35
  * Logs intake limit
36
36
  */
37
37
  batchMessagesLimit: 50,
38
- messageBytesLimit: 256 * ONE_KIBI_BYTE
38
+ messageBytesLimit: 256 * ONE_KIBI_BYTE,
39
+ resourceUrlLimit: 5 * ONE_KIBI_BYTE
39
40
  }, computeTransportConfiguration(initConfiguration));
40
41
  }
41
42
  export function buildCookieOptions(initConfiguration) {
package/esm/dataMap.js CHANGED
@@ -87,7 +87,14 @@ export var dataMap = {
87
87
  resource_ssl: 'resource.ssl',
88
88
  resource_ttfb: 'resource.ttfb',
89
89
  resource_trans: 'resource.trans',
90
- resource_first_byte: 'resource.firstbyte'
90
+ resource_redirect: 'resource.redirect',
91
+ resource_first_byte: 'resource.firstbyte',
92
+ resource_dns_time: 'resource.dns_time',
93
+ resource_download_time: 'resource.download_time',
94
+ resource_first_byte_time: 'resource.first_byte_time',
95
+ resource_connect_time: 'resource.connect_time',
96
+ resource_ssl_time: 'resource.ssl_time',
97
+ resource_redirect_time: 'resource.redirect_time'
91
98
  }
92
99
  },
93
100
  error: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudcare/browser-core",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "main": "cjs/index.js",
5
5
  "module": "esm/index.js",
6
6
  "scripts": {
@@ -20,5 +20,5 @@
20
20
  "author": "dataflux",
21
21
  "license": "MIT",
22
22
  "description": "DataFlux RUM Web 端数据指标监控",
23
- "gitHead": "dc666f91dcd821cc1286ed76b5162d7ce71c7fda"
23
+ "gitHead": "9d503cbc3c9bc58eade97e8491a1c8c9713b0dbb"
24
24
  }
@@ -1,19 +1,35 @@
1
1
  import { getCurrentSite } from '../browser/cookie'
2
2
  import { catchUserErrors } from '../helper/catchUserErrors'
3
3
  import { display } from '../helper/display'
4
- import { assign, isPercentage, ONE_KIBI_BYTE, ONE_SECOND, isNullUndefinedDefaultValue } from '../helper/tools'
4
+ import {
5
+ assign,
6
+ isPercentage,
7
+ ONE_KIBI_BYTE,
8
+ ONE_SECOND,
9
+ isNullUndefinedDefaultValue
10
+ } from '../helper/tools'
5
11
  import { computeTransportConfiguration } from './transportConfiguration'
6
- export function validateAndBuildConfiguration(initConfiguration){
7
- if (initConfiguration.sampleRate !== undefined && !isPercentage(initConfiguration.sampleRate)) {
12
+ export function validateAndBuildConfiguration(initConfiguration) {
13
+ if (
14
+ initConfiguration.sampleRate !== undefined &&
15
+ !isPercentage(initConfiguration.sampleRate)
16
+ ) {
8
17
  display.error('Sample Rate should be a number between 0 and 100')
9
18
  return
10
19
  }
11
20
  return assign(
12
21
  {
13
22
  beforeSend:
14
- initConfiguration.beforeSend && catchUserErrors(initConfiguration.beforeSend, 'beforeSend threw an error:'),
23
+ initConfiguration.beforeSend &&
24
+ catchUserErrors(
25
+ initConfiguration.beforeSend,
26
+ 'beforeSend threw an error:'
27
+ ),
15
28
  cookieOptions: buildCookieOptions(initConfiguration),
16
- sampleRate: isNullUndefinedDefaultValue(initConfiguration.sampleRate, 100),
29
+ sampleRate: isNullUndefinedDefaultValue(
30
+ initConfiguration.sampleRate,
31
+ 100
32
+ ),
17
33
  service: initConfiguration.service,
18
34
  version: initConfiguration.version,
19
35
  env: initConfiguration.env,
@@ -38,6 +54,7 @@ export function validateAndBuildConfiguration(initConfiguration){
38
54
  */
39
55
  batchMessagesLimit: 50,
40
56
  messageBytesLimit: 256 * ONE_KIBI_BYTE,
57
+ resourceUrlLimit: 5 * ONE_KIBI_BYTE
41
58
  },
42
59
  computeTransportConfiguration(initConfiguration)
43
60
  )
@@ -57,5 +74,8 @@ export function buildCookieOptions(initConfiguration) {
57
74
  }
58
75
 
59
76
  function mustUseSecureCookie(initConfiguration) {
60
- return !!initConfiguration.useSecureSessionCookie || !!initConfiguration.useCrossSiteSessionCookie
77
+ return (
78
+ !!initConfiguration.useSecureSessionCookie ||
79
+ !!initConfiguration.useCrossSiteSessionCookie
80
+ )
61
81
  }
package/src/dataMap.js CHANGED
@@ -87,7 +87,14 @@ export var dataMap = {
87
87
  resource_ssl: 'resource.ssl',
88
88
  resource_ttfb: 'resource.ttfb',
89
89
  resource_trans: 'resource.trans',
90
- resource_first_byte: 'resource.firstbyte'
90
+ resource_redirect: 'resource.redirect',
91
+ resource_first_byte: 'resource.firstbyte',
92
+ resource_dns_time: 'resource.dns_time',
93
+ resource_download_time: 'resource.download_time',
94
+ resource_first_byte_time: 'resource.first_byte_time',
95
+ resource_connect_time: 'resource.connect_time',
96
+ resource_ssl_time: 'resource.ssl_time',
97
+ resource_redirect_time: 'resource.redirect_time'
91
98
  }
92
99
  },
93
100
  error: {