@newrelic/browser-agent 1.301.0-rc.2 → 1.301.0-rc.4
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/dist/cjs/common/constants/env.cdn.js +1 -1
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/features/ajax/aggregate/index.js +5 -1
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/features/ajax/aggregate/index.js +5 -1
- package/dist/types/features/ajax/aggregate/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/features/ajax/aggregate/index.js +7 -1
|
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.RRWEB_PACKAGE_NAME = exports.D
|
|
|
17
17
|
/**
|
|
18
18
|
* Exposes the version of the agent
|
|
19
19
|
*/
|
|
20
|
-
const VERSION = exports.VERSION = "1.301.0-rc.
|
|
20
|
+
const VERSION = exports.VERSION = "1.301.0-rc.4";
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Exposes the build type of the agent
|
|
@@ -17,7 +17,7 @@ exports.VERSION = exports.RRWEB_VERSION = exports.RRWEB_PACKAGE_NAME = exports.D
|
|
|
17
17
|
/**
|
|
18
18
|
* Exposes the version of the agent
|
|
19
19
|
*/
|
|
20
|
-
const VERSION = exports.VERSION = "1.301.0-rc.
|
|
20
|
+
const VERSION = exports.VERSION = "1.301.0-rc.4";
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Exposes the build type of the agent
|
|
@@ -131,9 +131,13 @@ class Aggregate extends _aggregateBase.AggregateBase {
|
|
|
131
131
|
if (!eventBuffer.length) return;
|
|
132
132
|
const addString = (0, _belSerializer.getAddStringContext)(this.agentRef.runtime.obfuscator);
|
|
133
133
|
let payload = 'bel.7;';
|
|
134
|
+
let firstTimestamp = 0;
|
|
134
135
|
for (let i = 0; i < eventBuffer.length; i++) {
|
|
135
136
|
const event = eventBuffer[i];
|
|
136
|
-
|
|
137
|
+
// ajax nodes are relative to the first node (or page origin if no previous node), so we need to calculate the relative start time
|
|
138
|
+
const relativeStartTime = event.startTime - firstTimestamp;
|
|
139
|
+
if (i === 0) firstTimestamp = event.startTime;
|
|
140
|
+
const fields = [(0, _belSerializer.numeric)(relativeStartTime), (0, _belSerializer.numeric)(event.endTime - event.startTime), (0, _belSerializer.numeric)(0),
|
|
137
141
|
// callbackEnd
|
|
138
142
|
(0, _belSerializer.numeric)(0),
|
|
139
143
|
// no callbackDuration for non-SPA events
|
|
@@ -124,9 +124,13 @@ export class Aggregate extends AggregateBase {
|
|
|
124
124
|
if (!eventBuffer.length) return;
|
|
125
125
|
const addString = getAddStringContext(this.agentRef.runtime.obfuscator);
|
|
126
126
|
let payload = 'bel.7;';
|
|
127
|
+
let firstTimestamp = 0;
|
|
127
128
|
for (let i = 0; i < eventBuffer.length; i++) {
|
|
128
129
|
const event = eventBuffer[i];
|
|
129
|
-
|
|
130
|
+
// ajax nodes are relative to the first node (or page origin if no previous node), so we need to calculate the relative start time
|
|
131
|
+
const relativeStartTime = event.startTime - firstTimestamp;
|
|
132
|
+
if (i === 0) firstTimestamp = event.startTime;
|
|
133
|
+
const fields = [numeric(relativeStartTime), numeric(event.endTime - event.startTime), numeric(0),
|
|
130
134
|
// callbackEnd
|
|
131
135
|
numeric(0),
|
|
132
136
|
// no callbackDuration for non-SPA events
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/ajax/aggregate/index.js"],"names":[],"mappings":"AAeA;IACE,2BAAiC;IAEjC,2BAsCC;IAnCC,mBAAwB;IAqC1B,6FA0EC;IAED,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/ajax/aggregate/index.js"],"names":[],"mappings":"AAeA;IACE,2BAAiC;IAEjC,2BAsCC;IAnCC,mBAAwB;IAqC1B,6FA0EC;IAED,iDAmDC;CACF;8BAhL6B,4BAA4B"}
|
package/package.json
CHANGED
|
@@ -137,10 +137,16 @@ export class Aggregate extends AggregateBase {
|
|
|
137
137
|
const addString = getAddStringContext(this.agentRef.runtime.obfuscator)
|
|
138
138
|
let payload = 'bel.7;'
|
|
139
139
|
|
|
140
|
+
let firstTimestamp = 0
|
|
141
|
+
|
|
140
142
|
for (let i = 0; i < eventBuffer.length; i++) {
|
|
141
143
|
const event = eventBuffer[i]
|
|
144
|
+
// ajax nodes are relative to the first node (or page origin if no previous node), so we need to calculate the relative start time
|
|
145
|
+
const relativeStartTime = event.startTime - firstTimestamp
|
|
146
|
+
if (i === 0) firstTimestamp = event.startTime
|
|
147
|
+
|
|
142
148
|
const fields = [
|
|
143
|
-
numeric(
|
|
149
|
+
numeric(relativeStartTime),
|
|
144
150
|
numeric(event.endTime - event.startTime),
|
|
145
151
|
numeric(0), // callbackEnd
|
|
146
152
|
numeric(0), // no callbackDuration for non-SPA events
|