@newrelic/browser-agent 0.1.231 → 1.232.0
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/README.md +2 -2
- package/dist/cjs/common/config/state/configurable.js +27 -21
- package/dist/cjs/common/config/state/init.js +8 -0
- package/dist/cjs/common/config/state/runtime.js +24 -26
- package/dist/cjs/common/constants/env.cdn.js +1 -1
- package/dist/cjs/common/constants/env.npm.js +1 -1
- package/dist/cjs/common/context/shared-context.js +2 -1
- package/dist/cjs/common/event-emitter/contextual-ee.test.js +2 -2
- package/dist/cjs/common/event-emitter/register-handler.test.js +1 -1
- package/dist/cjs/common/event-listener/event-listener-opts.js +4 -2
- package/dist/cjs/common/harvest/harvest-scheduler.js +14 -11
- package/dist/cjs/common/harvest/harvest.js +3 -1
- package/dist/cjs/common/session/constants.js +12 -0
- package/dist/cjs/common/session/session-entity.js +278 -0
- package/dist/cjs/common/session/session-entity.test.js +436 -0
- package/dist/cjs/common/storage/first-party-cookies.js +35 -0
- package/dist/cjs/common/storage/local-memory.js +35 -0
- package/dist/cjs/common/storage/local-memory.test.js +20 -0
- package/dist/cjs/common/storage/local-storage.js +33 -0
- package/dist/cjs/common/storage/local-storage.test.js +14 -0
- package/dist/cjs/common/timer/interaction-timer.js +78 -0
- package/dist/cjs/common/timer/interaction-timer.test.js +216 -0
- package/dist/cjs/common/timer/timer.js +32 -0
- package/dist/cjs/common/timer/timer.test.js +105 -0
- package/dist/cjs/common/unload/eol.js +2 -2
- package/dist/cjs/common/util/data-size.js +6 -0
- package/dist/cjs/common/util/data-size.test.js +47 -0
- package/dist/cjs/common/util/invoke.js +73 -0
- package/dist/cjs/common/util/invoke.test.js +49 -0
- package/dist/cjs/common/util/obfuscate.js +0 -4
- package/dist/cjs/common/window/page-visibility.js +3 -1
- package/dist/cjs/common/wrap/wrap-timer.js +1 -1
- package/dist/cjs/features/ajax/aggregate/index.js +2 -2
- package/dist/cjs/features/jserrors/aggregate/index.js +3 -3
- package/dist/cjs/features/metrics/aggregate/index.js +13 -2
- package/dist/cjs/features/page_action/aggregate/index.js +2 -2
- package/dist/cjs/features/page_view_event/aggregate/index.js +6 -3
- package/dist/cjs/features/page_view_timing/aggregate/index.js +6 -6
- package/dist/cjs/features/session_trace/aggregate/index.js +2 -2
- package/dist/cjs/features/spa/aggregate/index.js +6 -5
- package/dist/cjs/features/utils/agent-session.js +73 -0
- package/dist/cjs/features/utils/feature-base.js +1 -1
- package/dist/cjs/features/utils/instrument-base.js +7 -2
- package/dist/cjs/features/utils/lazy-loader.js +1 -1
- package/dist/cjs/loaders/agent.js +1 -1
- package/dist/cjs/loaders/api/api.js +1 -4
- package/dist/cjs/loaders/api/apiAsync.js +3 -2
- package/dist/cjs/loaders/configure/configure.js +0 -6
- package/dist/esm/common/config/state/configurable.js +26 -20
- package/dist/esm/common/config/state/init.js +8 -0
- package/dist/esm/common/config/state/runtime.js +24 -26
- package/dist/esm/common/constants/env.cdn.js +1 -1
- package/dist/esm/common/constants/env.npm.js +1 -1
- package/dist/esm/common/context/shared-context.js +2 -1
- package/dist/esm/common/event-emitter/contextual-ee.test.js +2 -2
- package/dist/esm/common/event-emitter/register-handler.test.js +1 -1
- package/dist/esm/common/event-listener/event-listener-opts.js +4 -2
- package/dist/esm/common/harvest/harvest-scheduler.js +14 -11
- package/dist/esm/common/harvest/harvest.js +3 -1
- package/dist/esm/common/session/constants.js +3 -0
- package/dist/esm/common/session/session-entity.js +271 -0
- package/dist/esm/common/session/session-entity.test.js +434 -0
- package/dist/esm/common/storage/first-party-cookies.js +28 -0
- package/dist/esm/common/storage/local-memory.js +28 -0
- package/dist/esm/common/storage/local-memory.test.js +18 -0
- package/dist/esm/common/storage/local-storage.js +26 -0
- package/dist/esm/common/storage/local-storage.test.js +12 -0
- package/dist/esm/common/timer/interaction-timer.js +71 -0
- package/dist/esm/common/timer/interaction-timer.test.js +214 -0
- package/dist/esm/common/timer/timer.js +25 -0
- package/dist/esm/common/timer/timer.test.js +103 -0
- package/dist/esm/common/unload/eol.js +1 -1
- package/dist/esm/common/util/data-size.js +7 -0
- package/dist/esm/common/util/data-size.test.js +45 -0
- package/dist/esm/common/util/invoke.js +66 -0
- package/dist/esm/common/util/invoke.test.js +47 -0
- package/dist/esm/common/util/obfuscate.js +0 -4
- package/dist/esm/common/window/page-visibility.js +3 -1
- package/dist/esm/common/wrap/wrap-timer.js +1 -1
- package/dist/esm/features/ajax/aggregate/index.js +2 -2
- package/dist/esm/features/jserrors/aggregate/index.js +3 -3
- package/dist/esm/features/metrics/aggregate/index.js +14 -3
- package/dist/esm/features/page_action/aggregate/index.js +2 -2
- package/dist/esm/features/page_view_event/aggregate/index.js +6 -3
- package/dist/esm/features/page_view_timing/aggregate/index.js +6 -6
- package/dist/esm/features/session_trace/aggregate/index.js +2 -2
- package/dist/esm/features/spa/aggregate/index.js +6 -5
- package/dist/esm/features/utils/agent-session.js +67 -0
- package/dist/esm/features/utils/feature-base.js +1 -1
- package/dist/esm/features/utils/instrument-base.js +7 -2
- package/dist/esm/features/utils/lazy-loader.js +1 -1
- package/dist/esm/loaders/agent.js +1 -1
- package/dist/esm/loaders/api/api.js +2 -5
- package/dist/esm/loaders/api/apiAsync.js +2 -1
- package/dist/esm/loaders/configure/configure.js +2 -8
- package/dist/types/common/config/state/configurable.d.ts.map +1 -1
- package/dist/types/common/config/state/init.d.ts.map +1 -1
- package/dist/types/common/config/state/runtime.d.ts.map +1 -1
- package/dist/types/common/context/shared-context.d.ts.map +1 -1
- package/dist/types/common/event-listener/event-listener-opts.d.ts +2 -2
- package/dist/types/common/event-listener/event-listener-opts.d.ts.map +1 -1
- package/dist/types/common/harvest/harvest-scheduler.d.ts +1 -0
- package/dist/types/common/harvest/harvest-scheduler.d.ts.map +1 -1
- package/dist/types/common/harvest/harvest.d.ts.map +1 -1
- package/dist/types/common/session/constants.d.ts +4 -0
- package/dist/types/common/session/constants.d.ts.map +1 -0
- package/dist/types/common/session/session-entity.d.ts +72 -0
- package/dist/types/common/session/session-entity.d.ts.map +1 -0
- package/dist/types/common/storage/first-party-cookies.d.ts +8 -0
- package/dist/types/common/storage/first-party-cookies.d.ts.map +1 -0
- package/dist/types/common/storage/local-memory.d.ts +8 -0
- package/dist/types/common/storage/local-memory.d.ts.map +1 -0
- package/dist/types/common/storage/local-storage.d.ts +6 -0
- package/dist/types/common/storage/local-storage.d.ts.map +1 -0
- package/dist/types/common/timer/interaction-timer.d.ts +11 -0
- package/dist/types/common/timer/interaction-timer.d.ts.map +1 -0
- package/dist/types/common/timer/timer.d.ts +12 -0
- package/dist/types/common/timer/timer.d.ts.map +1 -0
- package/dist/types/common/util/data-size.d.ts +7 -1
- package/dist/types/common/util/data-size.d.ts.map +1 -1
- package/dist/types/common/util/invoke.d.ts +35 -0
- package/dist/types/common/util/invoke.d.ts.map +1 -0
- package/dist/types/common/util/obfuscate.d.ts.map +1 -1
- package/dist/types/common/window/page-visibility.d.ts +1 -1
- package/dist/types/common/window/page-visibility.d.ts.map +1 -1
- package/dist/types/features/ajax/aggregate/index.d.ts +2 -2
- package/dist/types/features/ajax/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/jserrors/aggregate/index.d.ts +2 -2
- package/dist/types/features/jserrors/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/metrics/aggregate/index.d.ts +2 -2
- package/dist/types/features/metrics/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/page_action/aggregate/index.d.ts +2 -2
- package/dist/types/features/page_action/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/page_view_event/aggregate/index.d.ts +2 -2
- package/dist/types/features/page_view_event/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/page_view_timing/aggregate/index.d.ts +2 -2
- package/dist/types/features/page_view_timing/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/session_trace/aggregate/index.d.ts +2 -2
- package/dist/types/features/session_trace/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/spa/aggregate/index.d.ts +2 -2
- package/dist/types/features/spa/aggregate/index.d.ts.map +1 -1
- package/dist/types/features/utils/agent-session.d.ts +2 -0
- package/dist/types/features/utils/agent-session.d.ts.map +1 -0
- package/dist/types/features/utils/instrument-base.d.ts.map +1 -1
- package/dist/types/features/utils/lazy-loader.d.ts +2 -2
- package/dist/types/features/utils/lazy-loader.d.ts.map +1 -1
- package/dist/types/loaders/api/api.d.ts.map +1 -1
- package/dist/types/loaders/api/apiAsync.d.ts.map +1 -1
- package/dist/types/loaders/configure/configure.d.ts.map +1 -1
- package/package.json +6 -5
- package/src/common/config/state/configurable.js +26 -19
- package/src/common/config/state/init.js +7 -0
- package/src/common/config/state/runtime.js +22 -27
- package/src/common/context/shared-context.js +2 -1
- package/src/common/event-emitter/contextual-ee.test.js +2 -2
- package/src/common/event-emitter/register-handler.test.js +1 -1
- package/src/common/event-listener/event-listener-opts.js +4 -4
- package/src/common/harvest/harvest-scheduler.js +12 -8
- package/src/common/harvest/harvest.js +3 -1
- package/src/common/session/constants.js +3 -0
- package/src/common/session/session-entity.js +271 -0
- package/src/common/session/session-entity.test.js +317 -0
- package/src/common/storage/first-party-cookies.js +31 -0
- package/src/common/storage/local-memory.js +30 -0
- package/src/common/storage/local-memory.test.js +19 -0
- package/src/common/storage/local-storage.js +28 -0
- package/src/common/storage/local-storage.test.js +17 -0
- package/src/common/timer/interaction-timer.js +75 -0
- package/src/common/timer/interaction-timer.test.js +167 -0
- package/src/common/timer/timer.js +31 -0
- package/src/common/timer/timer.test.js +100 -0
- package/src/common/unload/eol.js +1 -1
- package/src/common/util/data-size.js +6 -0
- package/src/common/util/data-size.test.js +50 -0
- package/src/common/util/invoke.js +55 -0
- package/src/common/util/invoke.test.js +65 -0
- package/src/common/util/obfuscate.js +0 -4
- package/src/common/window/page-visibility.js +2 -2
- package/src/common/wrap/wrap-timer.js +1 -1
- package/src/features/ajax/aggregate/index.js +2 -2
- package/src/features/jserrors/aggregate/index.js +3 -3
- package/src/features/metrics/aggregate/index.js +18 -3
- package/src/features/page_action/aggregate/index.js +2 -2
- package/src/features/page_view_event/aggregate/index.js +6 -3
- package/src/features/page_view_timing/aggregate/index.js +6 -6
- package/src/features/session_trace/aggregate/index.js +2 -2
- package/src/features/spa/aggregate/index.js +5 -5
- package/src/features/utils/agent-session.js +68 -0
- package/src/features/utils/feature-base.js +1 -1
- package/src/features/utils/instrument-base.js +5 -2
- package/src/features/utils/lazy-loader.js +1 -1
- package/src/loaders/agent.js +1 -1
- package/src/loaders/api/api.js +2 -5
- package/src/loaders/api/apiAsync.js +2 -1
- package/src/loaders/configure/configure.js +2 -7
- package/dist/cjs/common/util/single.js +0 -23
- package/dist/cjs/common/window/session-storage.js +0 -87
- package/dist/cjs/features/utils/aggregate-base.js +0 -13
- package/dist/esm/common/util/single.js +0 -16
- package/dist/esm/common/window/session-storage.js +0 -77
- package/dist/esm/features/utils/aggregate-base.js +0 -6
- package/dist/types/common/util/single.d.ts +0 -2
- package/dist/types/common/util/single.d.ts.map +0 -1
- package/dist/types/common/window/session-storage.d.ts +0 -18
- package/dist/types/common/window/session-storage.d.ts.map +0 -1
- package/dist/types/features/utils/aggregate-base.d.ts +0 -4
- package/dist/types/features/utils/aggregate-base.d.ts.map +0 -1
- package/src/common/util/single.js +0 -18
- package/src/common/window/session-storage.js +0 -75
- package/src/features/utils/aggregate-base.js +0 -7
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* @param {boolean} [toHiddenOnly=false] - only execute the 'cb' when the vis is changing to the hidden state; no arg is passed to 'cb' if used
|
|
4
4
|
* @returns void
|
|
5
5
|
*/
|
|
6
|
-
export function subscribeToVisibilityChange(cb: Function, toHiddenOnly?: boolean | undefined): void;
|
|
6
|
+
export function subscribeToVisibilityChange(cb: Function, toHiddenOnly?: boolean | undefined, capture: any, abortSignal: any): void;
|
|
7
7
|
//# sourceMappingURL=page-visibility.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-visibility.d.ts","sourceRoot":"","sources":["../../../../src/common/window/page-visibility.js"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"page-visibility.d.ts","sourceRoot":"","sources":["../../../../src/common/window/page-visibility.js"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,oIAWC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class Aggregate extends
|
|
1
|
+
export class Aggregate extends FeatureBase {
|
|
2
2
|
static featureName: string;
|
|
3
3
|
constructor(agentIdentifier: any, aggregator: any);
|
|
4
4
|
storeXhr: (params: any, metrics: any, startTime: any, endTime: any, type: any) => void;
|
|
@@ -12,5 +12,5 @@ export class Aggregate extends AggregateBase {
|
|
|
12
12
|
spaAjaxEvents: {};
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
import {
|
|
15
|
+
import { FeatureBase } from '../../utils/feature-base';
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/ajax/aggregate/index.js"],"names":[],"mappings":"AAiBA;IACE,2BAAiC;IACjC,mDAmOC;IAtNC,uFAAwB;IACxB;;;;eAAoC;IACpC;;;MAA2E;CAqN9E;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/ajax/aggregate/index.js"],"names":[],"mappings":"AAiBA;IACE,2BAAiC;IACjC,mDAmOC;IAtNC,uFAAwB;IACxB;;;;eAAoC;IACpC;;;MAA2E;CAqN9E;4BAxO2B,0BAA0B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class Aggregate extends
|
|
1
|
+
export class Aggregate extends FeatureBase {
|
|
2
2
|
static featureName: string;
|
|
3
3
|
constructor(agentIdentifier: any, aggregator: any);
|
|
4
4
|
stackReported: {};
|
|
@@ -20,5 +20,5 @@ export class Aggregate extends AggregateBase {
|
|
|
20
20
|
onInteractionSaved(interaction: any): void;
|
|
21
21
|
onInteractionDiscarded(interaction: any): void;
|
|
22
22
|
}
|
|
23
|
-
import {
|
|
23
|
+
import { FeatureBase } from '../../utils/feature-base';
|
|
24
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/jserrors/aggregate/index.js"],"names":[],"mappings":"AAyBA;IACE,2BAAiC;IACjC,mDAmCC;IAhCC,kBAAuB;IACvB,qBAA0B;IAC1B,eAAoB;IAEpB,qBAAwB;IA8B1B;;;MAoBC;IAfG,iBAAuB;IAiB3B,qCAWC;IAED,8BAEC;IAED,sDAEC;IAED,mDASC;IAED,sEAcC;IASD,2CAgBC;IAED,4EAsFC;IAED,2CAgCC;IAED,+CA2BC;CACF;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/jserrors/aggregate/index.js"],"names":[],"mappings":"AAyBA;IACE,2BAAiC;IACjC,mDAmCC;IAhCC,kBAAuB;IACvB,qBAA0B;IAC1B,eAAoB;IAEpB,qBAAwB;IA8B1B;;;MAoBC;IAfG,iBAAuB;IAiB3B,qCAWC;IAED,8BAEC;IAED,sDAEC;IAED,mDASC;IAED,sEAcC;IASD,2CAgBC;IAED,4EAsFC;IAED,2CAgCC;IAED,+CA2BC;CACF;4BA9R2B,0BAA0B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class Aggregate extends
|
|
1
|
+
export class Aggregate extends FeatureBase {
|
|
2
2
|
static featureName: string;
|
|
3
3
|
constructor(agentIdentifier: any, aggregator: any);
|
|
4
4
|
storeSupportabilityMetrics(name: any, value: any): void;
|
|
@@ -8,5 +8,5 @@ export class Aggregate extends AggregateBase {
|
|
|
8
8
|
unload(): void;
|
|
9
9
|
resourcesSent: boolean | undefined;
|
|
10
10
|
}
|
|
11
|
-
import {
|
|
11
|
+
import { FeatureBase } from '../../utils/feature-base';
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/metrics/aggregate/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/metrics/aggregate/index.js"],"names":[],"mappings":"AAeA;IACE,2BAAiC;IACjC,mDAsBC;IAED,wDAKC;IAED,iDAKC;IAED,qBA2BC;IAED,0BAQC;IAED,eAoDC;IA5CG,mCAAyB;CA6C9B;4BAvI2B,0BAA0B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class Aggregate extends
|
|
1
|
+
export class Aggregate extends FeatureBase {
|
|
2
2
|
static featureName: string;
|
|
3
3
|
constructor(agentIdentifier: any, aggregator: any);
|
|
4
4
|
eventsPerMinute: number;
|
|
@@ -20,5 +20,5 @@ export class Aggregate extends AggregateBase {
|
|
|
20
20
|
onHarvestFinished(result: any): void;
|
|
21
21
|
addPageAction(t: any, name: any, attributes: any): void;
|
|
22
22
|
}
|
|
23
|
-
import {
|
|
23
|
+
import { FeatureBase } from '../../utils/feature-base';
|
|
24
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_action/aggregate/index.js"],"names":[],"mappings":"AAgBA;IACE,2BAAiC;IACjC,mDA2BC;IAzBC,wBAA0B;IAC1B,wBAAsL;IACtL,yBAA2E;IAI3E,cAAgB;IAEhB,SAAqD;IAEZ,iBAA8C;IAiBzF;;;;;;;;MAkBC;IALG,wCAAgC;IAOpC,qCAKC;IAGD,wDAoCC;CACF;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_action/aggregate/index.js"],"names":[],"mappings":"AAgBA;IACE,2BAAiC;IACjC,mDA2BC;IAzBC,wBAA0B;IAC1B,wBAAsL;IACtL,yBAA2E;IAI3E,cAAgB;IAEhB,SAAqD;IAEZ,iBAA8C;IAiBzF;;;;;;;;MAkBC;IALG,wCAAgC;IAOpC,qCAKC;IAGD,wDAoCC;CACF;4BAlG2B,0BAA0B"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export class Aggregate extends
|
|
1
|
+
export class Aggregate extends FeatureBase {
|
|
2
2
|
static featureName: string;
|
|
3
3
|
constructor(agentIdentifier: any, aggregator: any);
|
|
4
4
|
alreadySent: boolean | undefined;
|
|
5
5
|
getScheme(): "http" | "https";
|
|
6
6
|
sendRum(): void;
|
|
7
7
|
}
|
|
8
|
-
import {
|
|
8
|
+
import { FeatureBase } from '../../utils/feature-base';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_view_event/aggregate/index.js"],"names":[],"mappings":"AAoBA;IACE,2BAA2C;IAC3C,mDA2BC;IAvBG,iCAAwB;IAyB5B,8BAEC;IAED,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_view_event/aggregate/index.js"],"names":[],"mappings":"AAoBA;IACE,2BAA2C;IAC3C,mDA2BC;IAvBG,iCAAwB;IAyB5B,8BAEC;IAED,gBAyFC;CACF;4BAjI2B,0BAA0B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class Aggregate extends
|
|
1
|
+
export class Aggregate extends FeatureBase {
|
|
2
2
|
static featureName: string;
|
|
3
3
|
constructor(agentIdentifier: any, aggregator: any);
|
|
4
4
|
timings: any[];
|
|
@@ -27,6 +27,6 @@ export class Aggregate extends AggregateBase {
|
|
|
27
27
|
} | undefined;
|
|
28
28
|
getPayload(data: any): string;
|
|
29
29
|
}
|
|
30
|
-
import {
|
|
30
|
+
import { FeatureBase } from '../../utils/feature-base';
|
|
31
31
|
import { HarvestScheduler } from '../../../common/harvest/harvest-scheduler';
|
|
32
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_view_timing/aggregate/index.js"],"names":[],"mappings":"AAqBA;IACE,2BAAiC;IACjC,mDA4GC;IAzGC,eAAiB;IACjB,mBAAqB;IACrB,4BAA+B;IAC/B,mBAAe;IAKf,sBAA4B;IAkF5B,4BAGQ;IAeV,8CAUC;IAED;;;OAGG;IACH,6BAFW,MAAM,QAOhB;IAED;;OAEG;IACH,uCAUC;IAED,mDAqBC;IAED,qCAOC;IAED,gDAWC;IAGD;;;;kBAWC;IAGD,8BAuBC;CACF;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/page_view_timing/aggregate/index.js"],"names":[],"mappings":"AAqBA;IACE,2BAAiC;IACjC,mDA4GC;IAzGC,eAAiB;IACjB,mBAAqB;IACrB,4BAA+B;IAC/B,mBAAe;IAKf,sBAA4B;IAkF5B,4BAGQ;IAeV,8CAUC;IAED;;;OAGG;IACH,6BAFW,MAAM,QAOhB;IAED;;OAEG;IACH,uCAUC;IAED,mDAqBC;IAED,qCAOC;IAED,gDAWC;IAGD;;;;kBAWC;IAGD,8BAuBC;CACF;4BA7O2B,0BAA0B;iCARrB,2CAA2C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class Aggregate extends
|
|
1
|
+
export class Aggregate extends FeatureBase {
|
|
2
2
|
static featureName: string;
|
|
3
3
|
constructor(agentIdentifier: any, aggregator: any);
|
|
4
4
|
ptid: string | undefined;
|
|
@@ -73,5 +73,5 @@ export class Aggregate extends AggregateBase {
|
|
|
73
73
|
trivial(node: any): boolean;
|
|
74
74
|
shouldIgnoreEvent(event: any, target: any): boolean;
|
|
75
75
|
}
|
|
76
|
-
import {
|
|
76
|
+
import { FeatureBase } from '../../utils/feature-base';
|
|
77
77
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_trace/aggregate/index.js"],"names":[],"mappings":"AAkBA;IACE,2BAAiC;IACjC,mDAoHC;IA7GC,yBAAc;IACd;;;;;;;;;;;;kBAOC;IACD;;;;;kBAKC;IACD;;;;;;;;;;;;;;;;;;;;;;;;kBAwBC;IAED,sBAAe;IACf,8BAAkB;IAClB,iCAAqB;IACrB,wBAA0G;IAC1G,wBAA4G;IAE5G,8BAAkB;IAgEpB,oDAKC;IAED,2BAuBC;IAED,+DAaC;IAED,oFAmBC;IAED,wBAQC;IAED,uCAqBC;IAED,gDAUC;IAED,qCAoBC;IAED,qEAUC;IAED,mEAUC;IAED,yBASC;IAED,sCASC;IAED,yBAmCC;IAED,gCAEC;IAED,+DAyBC;IAED,+BAEC;IAED,6BAEC;IAED,uCAEC;IAED,4BAIC;IAED,oDAMC;CACF;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/session_trace/aggregate/index.js"],"names":[],"mappings":"AAkBA;IACE,2BAAiC;IACjC,mDAoHC;IA7GC,yBAAc;IACd;;;;;;;;;;;;kBAOC;IACD;;;;;kBAKC;IACD;;;;;;;;;;;;;;;;;;;;;;;;kBAwBC;IAED,sBAAe;IACf,8BAAkB;IAClB,iCAAqB;IACrB,wBAA0G;IAC1G,wBAA4G;IAE5G,8BAAkB;IAgEpB,oDAKC;IAED,2BAuBC;IAED,+DAaC;IAED,oFAmBC;IAED,wBAQC;IAED,uCAqBC;IAED,gDAUC;IAED,qCAoBC;IAED,qEAUC;IAED,mEAUC;IAED,yBASC;IAED,sCASC;IAED,yBAmCC;IAED,gCAEC;IAED,+DAyBC;IAED,+BAEC;IAED,6BAEC;IAED,uCAEC;IAED,4BAIC;IAED,oDAMC;CACF;4BA5Y2B,0BAA0B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export class Aggregate extends
|
|
1
|
+
export class Aggregate extends FeatureBase {
|
|
2
2
|
static featureName: string;
|
|
3
3
|
constructor(agentIdentifier: any, aggregator: any);
|
|
4
4
|
state: {
|
|
@@ -20,6 +20,6 @@ export class Aggregate extends AggregateBase {
|
|
|
20
20
|
};
|
|
21
21
|
serializer: Serializer;
|
|
22
22
|
}
|
|
23
|
-
import {
|
|
23
|
+
import { FeatureBase } from '../../utils/feature-base';
|
|
24
24
|
import { Serializer } from './serializer';
|
|
25
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/spa/aggregate/index.js"],"names":[],"mappings":"AA2BA;IACE,2BAAiC;IACjC,mDAmsBC;IAhsBC;;;;;;;;;;;;;;;;MAgBC;IAED,uBAAsC;CA+qBzC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/spa/aggregate/index.js"],"names":[],"mappings":"AA2BA;IACE,2BAAiC;IACjC,mDAmsBC;IAhsBC;;;;;;;;;;;;;;;;MAgBC;IAED,uBAAsC;CA+qBzC;4BA5sB2B,0BAA0B;2BAL3B,cAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-session.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/agent-session.js"],"names":[],"mappings":"AAWA,6DAwDC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrument-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/instrument-base.js"],"names":[],"mappings":"AAYA;;;GAGG;AACH;IACE;;;;;;;;OAQG;IACH,6BAPW,MAAM,uCAEN,MAAM,8BAchB;IAPC,uBAA0B;IAC1B,cAAgB;IAEhB,8IAA8I;IAC9I,cADW,WAAW,SAAS,CACd;IAKnB;;;OAGG;IACH,
|
|
1
|
+
{"version":3,"file":"instrument-base.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/instrument-base.js"],"names":[],"mappings":"AAYA;;;GAGG;AACH;IACE;;;;;;;;OAQG;IACH,6BAPW,MAAM,uCAEN,MAAM,8BAchB;IAPC,uBAA0B;IAC1B,cAAgB;IAEhB,8IAA8I;IAC9I,cADW,WAAW,SAAS,CACd;IAKnB;;;OAGG;IACH,yBA4BC;CACF;4BA/D2B,gBAAgB"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* should be.
|
|
8
8
|
* @param featureName Name of the feature to import such as ajax or session_trace
|
|
9
9
|
* @param featurePart Name of the feature part to load; should be either instrument or aggregate
|
|
10
|
-
* @returns {Promise<InstrumentBase|
|
|
10
|
+
* @returns {Promise<InstrumentBase|FeatureBase|null>}
|
|
11
11
|
*/
|
|
12
|
-
export function lazyLoader(featureName: any, featurePart: any): Promise<InstrumentBase |
|
|
12
|
+
export function lazyLoader(featureName: any, featurePart: any): Promise<InstrumentBase | FeatureBase | null>;
|
|
13
13
|
//# sourceMappingURL=lazy-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy-loader.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/lazy-loader.js"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,gEAFa,QAAQ,
|
|
1
|
+
{"version":3,"file":"lazy-loader.d.ts","sourceRoot":"","sources":["../../../../src/features/utils/lazy-loader.js"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,gEAFa,QAAQ,+BAA2B,IAAI,CAAC,CAyBpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/loaders/api/api.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/loaders/api/api.js"],"names":[],"mappings":"AAkBA,2CAoBC;AAED;;;;;IA0DE;;;;OAIG;qBAFQ,MAAM;;;EAuElB;AA3JD,0CAA0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiAsync.d.ts","sourceRoot":"","sources":["../../../../src/loaders/api/apiAsync.js"],"names":[],"mappings":"AAUA,
|
|
1
|
+
{"version":3,"file":"apiAsync.d.ts","sourceRoot":"","sources":["../../../../src/loaders/api/apiAsync.js"],"names":[],"mappings":"AAUA,mDAkFC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../../src/loaders/configure/configure.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../../src/loaders/configure/configure.js"],"names":[],"mappings":"AAMA;;;;;;;;EA2BC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newrelic/browser-agent",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.232.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "New Relic Browser Agent Team <browser-agent@newrelic.com>",
|
|
6
6
|
"description": "Tests for the New Relic JavaScript agent",
|
|
@@ -108,6 +108,7 @@
|
|
|
108
108
|
"cdn:build:current": "npm run cdn:fresh-build && PUBLISH=CURRENT npm run cdn:webpack && npm run cdn:cleanup",
|
|
109
109
|
"cdn:build:nr": "npm run cdn:fresh-build && PUBLISH=PROD SOURCEMAPS=false npm run cdn:webpack && npm run cdn:cleanup",
|
|
110
110
|
"cdn:build:pr": "npm run cdn:fresh-build && PUBLISH=PR npm run cdn:webpack && npm run cdn:cleanup",
|
|
111
|
+
"cdn:build:experiment": "npm run cdn:fresh-build && PUBLISH=EXPERIMENT npm run cdn:webpack && npm run cdn:cleanup",
|
|
111
112
|
"cdn:cleanup": "node ./tools/scripts/post-build-cleanup",
|
|
112
113
|
"cdn:clone": "node ./tools/scripts/clone",
|
|
113
114
|
"cdn:fresh-build": "rm -rf ./build",
|
|
@@ -117,15 +118,14 @@
|
|
|
117
118
|
"packages:bundle": "webpack -c tools/jil/webpack.modular.js",
|
|
118
119
|
"test-server": "node ./tools/jil/bin/server",
|
|
119
120
|
"sauce:connect": "node ./tools/wdio/bin/sauce",
|
|
120
|
-
"sauce:get-browsers": "node ./tools/
|
|
121
|
+
"sauce:get-browsers": "node ./tools/browsers-lists/sauce-browsers.mjs",
|
|
121
122
|
"tools:test-builds": "npm --prefix ./tools/test-builds run build-all",
|
|
122
123
|
"third-party-updates": "oss third-party manifest --includeOptDeps && oss third-party notices --includeOptDeps",
|
|
123
124
|
"prepare": "husky install",
|
|
124
125
|
"npm:build:esm": "npx babel --env-name npm-esm --out-dir dist/esm --out-file-extension .js ./src",
|
|
125
126
|
"npm:build:cjs": "npx babel --env-name npm-cjs --out-dir dist/cjs --out-file-extension .js ./src",
|
|
126
127
|
"npm:build:types": "npx tsc -b",
|
|
127
|
-
"npm:pack": "mkdir -p temp && export PKG_NAME=$(npm pack --pack-destination temp) && echo ./temp/$PKG_NAME"
|
|
128
|
-
"sync:version": "node tools/scripts/sync-version.js"
|
|
128
|
+
"npm:pack": "mkdir -p temp && export PKG_NAME=$(npm pack --pack-destination temp) && echo ./temp/$PKG_NAME"
|
|
129
129
|
},
|
|
130
130
|
"config": {
|
|
131
131
|
"unsafe-perm": true
|
|
@@ -183,6 +183,7 @@
|
|
|
183
183
|
"fs-extra": "^11.1.0",
|
|
184
184
|
"function-bind": "^1.1.1",
|
|
185
185
|
"glob": "^7.0.5",
|
|
186
|
+
"gzip-size": "^7.0.0",
|
|
186
187
|
"html-webpack-plugin": "^5.5.0",
|
|
187
188
|
"husky": "^8.0.0",
|
|
188
189
|
"jest": "^28.1.1",
|
|
@@ -223,4 +224,4 @@
|
|
|
223
224
|
"README.md",
|
|
224
225
|
"types.ts"
|
|
225
226
|
]
|
|
226
|
-
}
|
|
227
|
+
}
|
|
@@ -3,24 +3,31 @@ import { warn } from '../../util/console'
|
|
|
3
3
|
|
|
4
4
|
export class Configurable {
|
|
5
5
|
constructor (obj, model) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
6
|
+
Object.assign(this, setValues(obj, model))
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function setValues (obj, model) {
|
|
11
|
+
const state = {}
|
|
12
|
+
try {
|
|
13
|
+
if (!obj || typeof obj !== 'object') return warn('New setting a Configurable requires an object as input')
|
|
14
|
+
if (!model || typeof model !== 'object') return warn('Setting a Configurable requires a model to set its initial properties')
|
|
15
|
+
Object.assign(state, model)
|
|
16
|
+
Object.entries(obj).forEach(([key, value]) => {
|
|
17
|
+
if (!Object.keys(model).includes(key)) return
|
|
18
|
+
const frozenAttrs = getFrozenAttributes(key)
|
|
19
|
+
if (frozenAttrs.length && value && typeof value === 'object') {
|
|
20
|
+
frozenAttrs.forEach(attr => {
|
|
21
|
+
if (attr in value) {
|
|
22
|
+
warn(`"${attr}" is a protected attribute and can not be changed in feature ${key}. It will have no effect.`)
|
|
23
|
+
delete value[attr]
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
state[key] = value
|
|
28
|
+
})
|
|
29
|
+
return state
|
|
30
|
+
} catch (err) {
|
|
31
|
+
warn('An error occured while setting a Configurable', err)
|
|
25
32
|
}
|
|
26
33
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
|
|
2
|
+
import { DEFAULT_EXPIRES_MS, DEFAULT_INACTIVE_MS } from '../../session/constants'
|
|
3
|
+
import { globalScope } from '../../util/global-scope'
|
|
2
4
|
import { gosNREUMInitializedAgents } from '../../window/nreum'
|
|
3
5
|
import { Configurable } from './configurable'
|
|
4
6
|
|
|
@@ -13,6 +15,11 @@ const model = {
|
|
|
13
15
|
cors_use_tracecontext_headers: undefined,
|
|
14
16
|
allowed_origins: undefined
|
|
15
17
|
},
|
|
18
|
+
session: {
|
|
19
|
+
domain: undefined, // used by first party cookies to set the top-level domain
|
|
20
|
+
expiresMs: DEFAULT_EXPIRES_MS,
|
|
21
|
+
inactiveMs: DEFAULT_INACTIVE_MS
|
|
22
|
+
},
|
|
16
23
|
ssl: undefined,
|
|
17
24
|
obfuscate: undefined,
|
|
18
25
|
jserrors: { enabled: true, harvestTimeSeconds: 10 },
|
|
@@ -1,35 +1,30 @@
|
|
|
1
1
|
import * as userAgent from '../../util/user-agent'
|
|
2
2
|
import { Configurable } from './configurable'
|
|
3
3
|
import { gosNREUMInitializedAgents } from '../../window/nreum'
|
|
4
|
-
import { getCurrentSessionIdOrMakeNew } from '../../window/session-storage'
|
|
5
|
-
import { getConfigurationValue } from '../config'
|
|
6
4
|
import { globalScope } from '../../util/global-scope'
|
|
7
5
|
import { BUILD_ENV, DIST_METHOD, VERSION } from '../../constants/env'
|
|
8
6
|
|
|
9
|
-
const model =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
userAgent,
|
|
31
|
-
version: VERSION
|
|
32
|
-
}
|
|
7
|
+
const model = {
|
|
8
|
+
buildEnv: BUILD_ENV,
|
|
9
|
+
bytesSent: {}, // Used for SM to capture body bytes sent per endpoint
|
|
10
|
+
queryBytesSent: {}, // Used for SM to capture query parameter bytes sent per endpoint
|
|
11
|
+
customTransaction: undefined,
|
|
12
|
+
disabled: false,
|
|
13
|
+
distMethod: DIST_METHOD,
|
|
14
|
+
isolatedBacklog: false,
|
|
15
|
+
loaderType: undefined,
|
|
16
|
+
maxBytes: 30000,
|
|
17
|
+
// The "timeOrigin" property is the new standard timestamp property shared across main frame and workers, but is not supported in some early Safari browsers (safari<15) + IE
|
|
18
|
+
// ingest expects an integer value, and timeOrigin can return a float.
|
|
19
|
+
offset: Math.floor(globalScope?.performance?.timeOrigin || globalScope?.performance?.timing?.navigationStart || Date.now()),
|
|
20
|
+
onerror: undefined,
|
|
21
|
+
origin: '' + globalScope.location,
|
|
22
|
+
ptid: undefined,
|
|
23
|
+
releaseIds: {},
|
|
24
|
+
session: undefined,
|
|
25
|
+
xhrWrappable: typeof globalScope.XMLHttpRequest?.prototype?.addEventListener === 'function',
|
|
26
|
+
userAgent,
|
|
27
|
+
version: VERSION
|
|
33
28
|
}
|
|
34
29
|
|
|
35
30
|
const _cache = {}
|
|
@@ -42,6 +37,6 @@ export function getRuntime (id) {
|
|
|
42
37
|
|
|
43
38
|
export function setRuntime (id, obj) {
|
|
44
39
|
if (!id) throw new Error('All runtime objects require an agent identifier!')
|
|
45
|
-
_cache[id] = new Configurable(obj, model
|
|
40
|
+
_cache[id] = new Configurable(obj, model)
|
|
46
41
|
gosNREUMInitializedAgents(id, _cache[id], 'runtime')
|
|
47
42
|
}
|
|
@@ -276,7 +276,7 @@ describe('event-emitter emit', () => {
|
|
|
276
276
|
|
|
277
277
|
expect(mockScopeListener).toHaveBeenCalledTimes(1)
|
|
278
278
|
expect(mockListener).not.toHaveBeenCalled()
|
|
279
|
-
expect(scopeEE.backlog
|
|
279
|
+
expect(scopeEE.backlog.feature).toEqual(expect.arrayContaining([
|
|
280
280
|
expect.arrayContaining([
|
|
281
281
|
scopeEE,
|
|
282
282
|
eventType,
|
|
@@ -284,7 +284,7 @@ describe('event-emitter emit', () => {
|
|
|
284
284
|
{}
|
|
285
285
|
])
|
|
286
286
|
]))
|
|
287
|
-
expect(ee.backlog
|
|
287
|
+
expect(ee.backlog.feature).toEqual(scopeEE.backlog.feature)
|
|
288
288
|
})
|
|
289
289
|
})
|
|
290
290
|
|
|
@@ -19,7 +19,7 @@ test('should default group to "feature"', async () => {
|
|
|
19
19
|
|
|
20
20
|
registerHandler(eventType, eventHandler)
|
|
21
21
|
|
|
22
|
-
expect(registerHandler.handlers
|
|
22
|
+
expect(registerHandler.handlers.feature).toEqual(expect.objectContaining({
|
|
23
23
|
[eventType]: [expect.arrayContaining([
|
|
24
24
|
handleEE, eventHandler
|
|
25
25
|
])]
|
|
@@ -32,10 +32,10 @@ export function eventListenerOpts (useCapture, abortSignal) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/** Do not use this within the worker context. */
|
|
35
|
-
export function windowAddEventListener (event, listener, capture = false) {
|
|
36
|
-
window.addEventListener(event, listener, eventListenerOpts(capture))
|
|
35
|
+
export function windowAddEventListener (event, listener, capture = false, abortSignal) {
|
|
36
|
+
window.addEventListener(event, listener, eventListenerOpts(capture, abortSignal))
|
|
37
37
|
}
|
|
38
38
|
/** Do not use this within the worker context. */
|
|
39
|
-
export function documentAddEventListener (event, listener, capture = false) {
|
|
40
|
-
document.addEventListener(event, listener, eventListenerOpts(capture))
|
|
39
|
+
export function documentAddEventListener (event, listener, capture = false, abortSignal) {
|
|
40
|
+
document.addEventListener(event, listener, eventListenerOpts(capture, abortSignal))
|
|
41
41
|
}
|
|
@@ -23,13 +23,18 @@ export class HarvestScheduler extends SharedContext {
|
|
|
23
23
|
|
|
24
24
|
this.harvest = new Harvest(this.sharedContext)
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
// unload if EOL mechanism fires
|
|
27
|
+
subscribeToEOL(this.unload.bind(this), getConfigurationValue(this.sharedContext.agentIdentifier, 'allow_bfcache')) // TO DO: remove feature flag after rls stable
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
// unload if session resets
|
|
30
|
+
this.sharedContext?.ee.on('session-reset', this.unload.bind(this))
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
unload () {
|
|
34
|
+
if (this.aborted) return
|
|
35
|
+
// If opts.onUnload is defined, these are special actions to execute before attempting to send the final payload.
|
|
36
|
+
if (this.opts.onUnload) this.opts.onUnload()
|
|
37
|
+
this.runHarvest({ unload: true })
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
startTimer (interval, initialDelay) {
|
|
@@ -76,8 +81,7 @@ export class HarvestScheduler extends SharedContext {
|
|
|
76
81
|
}
|
|
77
82
|
}
|
|
78
83
|
} else {
|
|
79
|
-
|
|
80
|
-
this.harvest.sendX(this.endpoint, opts, runAfterSending)
|
|
84
|
+
this.harvest.sendX(this.endpoint, opts, onHarvestFinished)
|
|
81
85
|
}
|
|
82
86
|
|
|
83
87
|
if (this.started) {
|
|
@@ -118,6 +118,8 @@ export class Harvest extends SharedContext {
|
|
|
118
118
|
|
|
119
119
|
// Get bytes harvested per endpoint as a supportability metric. See metrics aggregator (on unload).
|
|
120
120
|
agentRuntime.bytesSent[endpoint] = (agentRuntime.bytesSent[endpoint] || 0) + body?.length || 0
|
|
121
|
+
// Get query bytes harvested per endpoint as a supportability metric. See metrics aggregator (on unload).
|
|
122
|
+
agentRuntime.queryBytesSent[endpoint] = (agentRuntime.queryBytesSent[endpoint] || 0) + fullUrl.split('?').slice(-1)[0]?.length || 0
|
|
121
123
|
|
|
122
124
|
/* Since workers don't support sendBeacon right now, or Image(), they can only use XHR method.
|
|
123
125
|
Because they still do permit synch XHR, the idea is that at final harvest time (worker is closing),
|
|
@@ -167,7 +169,7 @@ export class Harvest extends SharedContext {
|
|
|
167
169
|
encodeParam('ct', runtime.customTransaction),
|
|
168
170
|
'&rst=' + now(),
|
|
169
171
|
'&ck=0', // ck param DEPRECATED - still expected by backend
|
|
170
|
-
'&s=' + (runtime.
|
|
172
|
+
'&s=' + (runtime.session?.value || '0'), // the 0 id encaps all untrackable and default traffic
|
|
171
173
|
encodeParam('ref', ref),
|
|
172
174
|
encodeParam('ptid', (runtime.ptid ? '' + runtime.ptid : ''))
|
|
173
175
|
].join(''))
|