Skip to content

Commit

Permalink
remove unrelated changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bamieh committed Aug 24, 2020
1 parent f88977c commit d3af5e1
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ interface UIMetricsSavedObjects extends SavedObjectAttributes {
count: number;
}

type UiMetricApps = 'canvas' | 'maps';
interface Stats {
key: string;
value: number;
}
type Usage = Record<UiMetricApps, Stats[]>;

export function registerUiMetricUsageCollector(
usageCollection: UsageCollectionSetup,
registerType: SavedObjectsServiceSetup['registerType'],
Expand All @@ -54,7 +47,7 @@ export function registerUiMetricUsageCollector(
},
});

const collector = usageCollection.makeUsageCollector<Usage>({
const collector = usageCollection.makeUsageCollector({
type: 'ui_metric',
fetch: async () => {
const savedObjectsClient = getSavedObjectsClient();
Expand All @@ -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<string, Array<{ key: string; value: number }>>);

return uiMetricsByAppName;
},
Expand Down

0 comments on commit d3af5e1

Please sign in to comment.