Skip to content

Commit 8dc4ce7

Browse files
committed
fix tests
1 parent 07e4dc2 commit 8dc4ce7

File tree

1 file changed

+13
-9
lines changed
  • src/features/generic_events/aggregate

1 file changed

+13
-9
lines changed

src/features/generic_events/aggregate/index.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,15 @@ export class Aggregate extends AggregateBase {
2929

3030
this.referrerUrl = (isBrowserScope && document.referrer) ? cleanURL(document.referrer) : undefined
3131

32-
/** track usage SMs to improve these experimental features */
33-
const configPerfTag = 'Config/Performance/'
34-
if (agentRef.init.performance.capture_marks) handle(SUPPORTABILITY_METRIC_CHANNEL, [configPerfTag + 'CaptureMarks/Enabled'])
35-
if (agentRef.init.performance.capture_measures) handle(SUPPORTABILITY_METRIC_CHANNEL, [configPerfTag + 'CaptureMeasures/Enabled'])
36-
if (agentRef.init.performance.resources.enabled) handle(SUPPORTABILITY_METRIC_CHANNEL, [configPerfTag + 'Resources/Enabled'])
37-
if (agentRef.init.performance.resources.asset_types?.length !== 0) handle(SUPPORTABILITY_METRIC_CHANNEL, [configPerfTag + 'Resources/AssetTypes/Changed'])
38-
if (agentRef.init.performance.resources.first_party_domains?.length !== 0) handle(SUPPORTABILITY_METRIC_CHANNEL, [configPerfTag + 'Resources/FirstPartyDomains/Changed'])
39-
if (agentRef.init.performance.resources.ignore_newrelic === false) handle(SUPPORTABILITY_METRIC_CHANNEL, [configPerfTag + 'Resources/IgnoreNewrelic/Changed'])
40-
4132
this.waitForFlags(['ins']).then(([ins]) => {
4233
if (!ins) {
4334
this.blocked = true
4435
this.deregisterDrain()
4536
return
4637
}
4738

39+
this.trackSupportabilityMetrics()
40+
4841
if (agentRef.init.page_action.enabled) {
4942
registerHandler('api-addPageAction', (timestamp, name, attributes) => {
5043
this.addEvent({
@@ -249,4 +242,15 @@ export class Aggregate extends AggregateBase {
249242
this.harvestScheduler.runHarvest()
250243
}
251244
}
245+
246+
trackSupportabilityMetrics () {
247+
/** track usage SMs to improve these experimental features */
248+
const configPerfTag = 'Config/Performance/'
249+
if (this.agentRef.init.performance.capture_marks) handle(SUPPORTABILITY_METRIC_CHANNEL, [configPerfTag + 'CaptureMarks/Enabled'])
250+
if (this.agentRef.init.performance.capture_measures) handle(SUPPORTABILITY_METRIC_CHANNEL, [configPerfTag + 'CaptureMeasures/Enabled'])
251+
if (this.agentRef.init.performance.resources.enabled) handle(SUPPORTABILITY_METRIC_CHANNEL, [configPerfTag + 'Resources/Enabled'])
252+
if (this.agentRef.init.performance.resources.asset_types?.length !== 0) handle(SUPPORTABILITY_METRIC_CHANNEL, [configPerfTag + 'Resources/AssetTypes/Changed'])
253+
if (this.agentRef.init.performance.resources.first_party_domains?.length !== 0) handle(SUPPORTABILITY_METRIC_CHANNEL, [configPerfTag + 'Resources/FirstPartyDomains/Changed'])
254+
if (this.agentRef.init.performance.resources.ignore_newrelic === false) handle(SUPPORTABILITY_METRIC_CHANNEL, [configPerfTag + 'Resources/IgnoreNewrelic/Changed'])
255+
}
252256
}

0 commit comments

Comments
 (0)