Skip to content

chore: Remove componentsLoaded metric #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions src/internal/base-component/__tests__/metrics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,21 +416,6 @@ describe('Client Metrics support', () => {
});
});

describe('logComponentsLoaded', () => {
test('logs the components package loaded metric', () => {
metrics.logComponentsLoaded();
checkMetric(`awsui_dummy-package_d10`, {
o: 'main',
s: 'dummy-package',
t: 'default',
a: 'loaded',
f: 'react',
v: '1.0',
c: undefined,
});
});
});

describe('sendPanoramaMetric', () => {
test('does nothing when panorama is undefined', () => {
delete window.panorama;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ describe('useComponentMetrics', () => {
// the order is defined in the telemetry hook
expect(window.AWSC.Clog.log).toHaveBeenNthCalledWith(1, 'awsui-viewport-width', 1024, undefined);
expect(window.AWSC.Clog.log).toHaveBeenNthCalledWith(2, 'awsui-viewport-height', 768, undefined);
expect(window.AWSC.Clog.log).toHaveBeenNthCalledWith(3, 'awsui_toolkit_t30', 1, expect.stringContaining('loaded'));
expect(window.AWSC.Clog.log).toHaveBeenLastCalledWith(
getExpectedMetricName('test-component-1'),
1,
Expand Down
1 change: 0 additions & 1 deletion src/internal/base-component/component-metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export function useComponentMetrics(
metrics.sendMetricOnce('awsui-viewport-width', window.innerWidth || 0);
metrics.sendMetricOnce('awsui-viewport-height', window.innerHeight || 0);
}
metrics.logComponentsLoaded();
metrics.logComponentUsed(componentName.toLowerCase(), configuration);
// Components do not change the name dynamically. Explicit empty array to prevent accidental double metrics
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down
9 changes: 0 additions & 9 deletions src/internal/base-component/metrics/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,6 @@ export class Metrics {
}
}

/*
* Reports a metric value 1 to Console Platform's client logging service to indicate that the
* component was loaded. The component load event will only be reported as used to client logging
* service once per page view.
*/
logComponentsLoaded() {
this.sendMetricObjectOnce({ source: this.source, action: 'loaded', version: this.packageVersion }, 1);
}

/*
* Reports a metric value 1 to Console Platform's client logging service to indicate that the
* component was used in the page. A component will only be reported as used to client logging
Expand Down
Loading