From d3af5e1094cbff0b0f789d062110a5d31cd1c578 Mon Sep 17 00:00:00 2001 From: Ahmad Bamieh Date: Mon, 24 Aug 2020 15:50:03 +0300 Subject: [PATCH] remove unrelated changes --- .../ui_metric/telemetry_ui_metric_collector.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/plugins/kibana_usage_collection/server/collectors/ui_metric/telemetry_ui_metric_collector.ts b/src/plugins/kibana_usage_collection/server/collectors/ui_metric/telemetry_ui_metric_collector.ts index 2b2ee5362c4d4..ec2f1bfdfc25f 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/ui_metric/telemetry_ui_metric_collector.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/ui_metric/telemetry_ui_metric_collector.ts @@ -29,13 +29,6 @@ interface UIMetricsSavedObjects extends SavedObjectAttributes { count: number; } -type UiMetricApps = 'canvas' | 'maps'; -interface Stats { - key: string; - value: number; -} -type Usage = Record; - export function registerUiMetricUsageCollector( usageCollection: UsageCollectionSetup, registerType: SavedObjectsServiceSetup['registerType'], @@ -54,7 +47,7 @@ export function registerUiMetricUsageCollector( }, }); - const collector = usageCollection.makeUsageCollector({ + const collector = usageCollection.makeUsageCollector({ type: 'ui_metric', fetch: async () => { const savedObjectsClient = getSavedObjectsClient(); @@ -73,14 +66,14 @@ export function registerUiMetricUsageCollector( attributes: { count }, } = rawUiMetric; - const [appName, metricType] = id.split(':') as [UiMetricApps, string]; + const [appName, metricType] = id.split(':'); const pair = { key: metricType, value: count }; return { ...accum, [appName]: [...(accum[appName] || []), pair], }; - }, {} as Usage); + }, {} as Record>); return uiMetricsByAppName; },