mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* Introduce Echo for collecting frontend metrics * Update public/app/core/services/echo/Echo.ts Co-Authored-By: Peter Holmberg <peterholmberg@users.noreply.github.com> * Custom meta when adding event * Rename consumer to backend * Remove buffer from Echo * Minor tweaks * Update package.json * Update public/app/app.ts * Update public/app/app.ts * Collect paint metrics when collecting tti. Remove echoBackendFactory * Update yarn.lock * Move Echo interfaces to runtime * progress on meta and echo * Collect meta analytics events * Move MetaanalyticsBackend to enterprise repo * Fixed unit tests * Removed unused type from test * Fixed issues with chunk loading (reverted index-template changes) * Restored changes * Fixed webpack prod
13 lines
360 B
TypeScript
13 lines
360 B
TypeScript
import { getEchoSrv, EchoEventType } from '@grafana/runtime';
|
|
import { PerformanceEvent } from './backends/PerformanceBackend';
|
|
|
|
export const reportPerformance = (metric: string, value: number) => {
|
|
getEchoSrv().addEvent<PerformanceEvent>({
|
|
type: EchoEventType.Performance,
|
|
payload: {
|
|
metricName: metric,
|
|
duration: value,
|
|
},
|
|
});
|
|
};
|