Skip to content

Commit 4de37e2

Browse files
committed
Code review
1 parent dbee8f9 commit 4de37e2

4 files changed

Lines changed: 3 additions & 27 deletions

File tree

src/core/server/core_usage_data/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,5 +145,5 @@ export interface CoreUsageDataStart {
145145
* Internal API for collecting Core usage data
146146
* @internal
147147
* */
148-
getCoreUsageData(): CoreUsageData | null;
148+
getCoreUsageData(): CoreUsageData;
149149
}

src/plugins/kibana_usage_collection/server/collectors/core/core_usage_collector.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import {
2525
} from '../../../../../core/server/core_usage_data/types';
2626
// telemetry_check is unable to check types which are re-exported, it only
2727
// works when pointed to the typescript file where the type was defined.
28-
import { KIBANA_STATS_TYPE } from '../../../common/constants';
2928

3029
export function getCoreUsageCollector(
3130
usageCollection: UsageCollectionSetup,
@@ -118,20 +117,6 @@ export function getCoreUsageCollector(
118117
fetch() {
119118
return getCoreUsageDataService().getCoreUsageData();
120119
},
121-
122-
/*
123-
* Format the response data into a model for internal upload
124-
* 1. Make this data part of the "kibana_stats" type
125-
* 2. Organize the payload in the usage namespace of the data payload (usage.index, etc)
126-
*/
127-
formatForBulkUpload: (result) => {
128-
return {
129-
type: KIBANA_STATS_TYPE,
130-
payload: {
131-
core: result,
132-
},
133-
};
134-
},
135120
});
136121
}
137122

src/plugins/kibana_usage_collection/server/collectors/core/index.test.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,4 @@ describe('telemetry_core', () => {
5050
test('fetch', async () => {
5151
expect(await collector.fetch(callCluster)).toEqual(getCoreUsageDataReturnValue);
5252
});
53-
54-
test('formatForBulkUpload', async () => {
55-
expect(collector.formatForBulkUpload!(getCoreUsageDataReturnValue)).toStrictEqual({
56-
type: 'kibana_stats',
57-
payload: {
58-
core: getCoreUsageDataReturnValue,
59-
},
60-
});
61-
});
6253
});

src/plugins/kibana_usage_collection/server/plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class KibanaUsageCollectionPlugin implements Plugin {
9090
) {
9191
const getSavedObjectsClient = () => this.savedObjectsClient;
9292
const getUiSettingsClient = () => this.uiSettingsClient;
93-
const getcoreUsageData = () => this.coreUsageData!;
93+
const getCoreUsageDataService = () => this.coreUsageData!;
9494

9595
registerOpsStatsCollector(usageCollection, metric$);
9696
registerKibanaUsageCollector(usageCollection, this.legacyConfig$);
@@ -103,6 +103,6 @@ export class KibanaUsageCollectionPlugin implements Plugin {
103103
getSavedObjectsClient
104104
);
105105
registerCspCollector(usageCollection, coreSetup.http);
106-
registerCoreUsageCollector(usageCollection, getcoreUsageData);
106+
registerCoreUsageCollector(usageCollection, getCoreUsageDataService);
107107
}
108108
}

0 commit comments

Comments
 (0)