[Telemetry] Introduce UI Counters (#84224)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Ahmad Bamieh 2020-12-04 17:47:04 +02:00 committed by GitHub
parent e7d8dd48f3
commit aa9a353205
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
119 changed files with 1647 additions and 401 deletions

View file

@ -3,7 +3,7 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { UiStatsMetricType, METRIC_TYPE } from '@kbn/analytics';
import { UiCounterMetricType, METRIC_TYPE } from '@kbn/analytics';
import { UsageCollectionSetup } from 'src/plugins/usage_collection/public';
import { UIM_APP_NAME } from '../constants';
@ -15,12 +15,12 @@ export function init(_usageCollection: UsageCollectionSetup): void {
usageCollection = _usageCollection;
}
export function trackUiMetric(metricType: UiStatsMetricType, name: string) {
export function trackUiMetric(metricType: UiCounterMetricType, name: string) {
if (!usageCollection) {
return;
}
const { reportUiStats } = usageCollection;
reportUiStats(UIM_APP_NAME, metricType, name);
const { reportUiCounter } = usageCollection;
reportUiCounter(UIM_APP_NAME, metricType, name);
}
/**