grafana/public/app/core/profiler.ts
Marcus Efraimsson 6e313e7d37
Image Rendering: Remove PhantomJS support (#23460)
Removes all references and usage of PhantomJS #23375.
Remove direct link rendered image e2e smoke test for now.
Docker: Fix installing chrome in ubuntu custom docker image.
Improve handling of image renderer not available/installed #23593.
Add PhantomJS breaking change and upgrading notes.
Use grabpl v0.2.10.

Closes #13802

Co-authored-by: Kyle Brandt <kyle@grafana.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
2020-04-15 22:17:41 +02:00

31 lines
756 B
TypeScript

import { GrafanaRootScope } from 'app/routes/GrafanaCtrl';
export class Profiler {
panelsRendered: number;
enabled: boolean;
$rootScope: GrafanaRootScope;
window: any;
init(config: any, $rootScope: GrafanaRootScope) {
this.$rootScope = $rootScope;
this.window = window;
if (!this.enabled) {
return;
}
}
renderingCompleted() {
// add render counter to root scope
// used by image renderer to know when panel has rendered
this.panelsRendered = (this.panelsRendered || 0) + 1;
// this window variable is used by backend rendering tools to know
// all panels have completed rendering
this.window.panelsRendered = this.panelsRendered;
}
}
const profiler = new Profiler();
export { profiler };