@newrelic/browser-agent 1.301.0-rc.3 → 1.301.0-rc.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.
@@ -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.3";
20
+ const VERSION = exports.VERSION = "1.301.0-rc.5";
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.3";
20
+ const VERSION = exports.VERSION = "1.301.0-rc.5";
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
- const fields = [(0, _belSerializer.numeric)(event.startTime), (0, _belSerializer.numeric)(event.endTime - event.startTime), (0, _belSerializer.numeric)(0),
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
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.301.0-rc.3";
14
+ export const VERSION = "1.301.0-rc.5";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -11,7 +11,7 @@
11
11
  /**
12
12
  * Exposes the version of the agent
13
13
  */
14
- export const VERSION = "1.301.0-rc.3";
14
+ export const VERSION = "1.301.0-rc.5";
15
15
 
16
16
  /**
17
17
  * Exposes the build type of the agent
@@ -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
- const fields = [numeric(event.startTime), numeric(event.endTime - event.startTime), numeric(0),
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,iDA6CC;CACF;8BA1K6B,4BAA4B"}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newrelic/browser-agent",
3
- "version": "1.301.0-rc.3",
3
+ "version": "1.301.0-rc.5",
4
4
  "private": false,
5
5
  "author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
6
6
  "description": "New Relic Browser Agent",
@@ -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(event.startTime),
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