mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(profiling): refactorign profiling code, #5286
This commit is contained in:
@@ -35,10 +35,6 @@ function (angular, $, config, moment) {
|
||||
};
|
||||
|
||||
$scope.setupDashboard = function(data) {
|
||||
$rootScope.performance.dashboardLoadStart = new Date().getTime();
|
||||
$rootScope.performance.panelsInitialized = 0;
|
||||
$rootScope.performance.panelsRendered = 0;
|
||||
|
||||
var dashboard = dashboardSrv.create(data.dashboard, data.meta);
|
||||
dashboardSrv.setCurrent(dashboard);
|
||||
|
||||
@@ -68,7 +64,7 @@ function (angular, $, config, moment) {
|
||||
});
|
||||
}
|
||||
|
||||
$scope.appEvent("dashboard-loaded", $scope.dashboard);
|
||||
$scope.appEvent("dashboard-initialized", $scope.dashboard);
|
||||
}).catch(function(err) {
|
||||
if (err.data && err.data.message) { err.message = err.data.message; }
|
||||
$scope.appEvent("alert-error", ['Dashboard init failed', 'Template variables could not be initialized: ' + err.message]);
|
||||
@@ -84,7 +80,6 @@ function (angular, $, config, moment) {
|
||||
};
|
||||
|
||||
$scope.broadcastRefresh = function() {
|
||||
$rootScope.performance.panelsRendered = 0;
|
||||
$rootScope.$broadcast('refresh');
|
||||
};
|
||||
|
||||
|
||||
@@ -47,6 +47,8 @@ function (angular, moment, _, $, kbn, dateMath, impressionStore) {
|
||||
}
|
||||
|
||||
promise.then(function(result) {
|
||||
$rootScope.appEvent("dashboard-fetched", result.dashboard);
|
||||
|
||||
if (result.meta.dashboardNotFound !== true) {
|
||||
impressionStore.impressions.addDashboardImpression(result.dashboard.id);
|
||||
}
|
||||
|
||||
@@ -51,13 +51,6 @@ function (angular, _, $) {
|
||||
|
||||
$scope.onAppEvent('panel-initialized', function(evt, payload) {
|
||||
self.registerPanel(payload.scope);
|
||||
|
||||
if ($scope.profilingEnabled) {
|
||||
$scope.performance.panelsInitialized++;
|
||||
if ($scope.performance.panelsInitialized === $scope.performance.panelCount) {
|
||||
$scope.performance.allPanelsInitialized = new Date().getTime();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.update(this.getQueryStringState());
|
||||
|
||||
Reference in New Issue
Block a user