mirror of
https://github.com/grafana/grafana.git
synced 2025-01-27 08:47:12 -06:00
53186c14a4
* some type fixes * few more * more type fixes * fix the majority of (window as any) calls * don't make new variable for event * few more * MOAR
24 lines
536 B
TypeScript
24 lines
536 B
TypeScript
declare global {
|
|
interface Window {
|
|
panelsRendered?: number;
|
|
}
|
|
}
|
|
|
|
export class Profiler {
|
|
panelsRendered = 0;
|
|
enabled?: boolean = undefined;
|
|
|
|
renderingCompleted() {
|
|
// add render counter to root scope
|
|
// used by image renderer to know when panel has rendered
|
|
this.panelsRendered += 1;
|
|
|
|
// this window variable is used by backend rendering tools to know
|
|
// all panels have completed rendering
|
|
window.panelsRendered = this.panelsRendered;
|
|
}
|
|
}
|
|
|
|
const profiler = new Profiler();
|
|
export { profiler };
|