diff options
author | Yusaku Sako <yusaku@apache.org> | 2012-12-09 15:13:09 +0000 |
---|---|---|
committer | Yusaku Sako <yusaku@apache.org> | 2012-12-09 15:13:09 +0000 |
commit | 2f2ad380560a41f8241605ffc15a262795e76f57 (patch) | |
tree | bce02959d792c02b358ee4feff7f74bfe9baa4fa /ambari-web | |
parent | 28a9ae32d340739fc230ea020de3f153d8e59131 (diff) |
AMBARI-1051. Dashboard page takes long time to load. (Srimanth Gunturi via yusaku)
git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/AMBARI-666@1419004 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'ambari-web')
-rw-r--r-- | ambari-web/app/controllers/global/cluster_controller.js | 6 | ||||
-rw-r--r-- | ambari-web/app/controllers/global/update_controller.js | 21 | ||||
-rw-r--r-- | ambari-web/app/mappers/server_data_mapper.js | 4 |
3 files changed, 18 insertions, 13 deletions
diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js index f215549b00..8c0ea3892a 100644 --- a/ambari-web/app/controllers/global/cluster_controller.js +++ b/ambari-web/app/controllers/global/cluster_controller.js @@ -284,10 +284,10 @@ App.ClusterController = Em.Controller.extend({ return; } - var servicesUrl1 = this.getUrl('/data/dashboard/services.json', '/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=*,components/host_components/*'); + var servicesUrl = this.getUrl('/data/dashboard/services.json', '/services?fields=components/ServiceComponentInfo,components/host_components,components/host_components/HostRoles'); var self = this; - App.HttpClient.get(servicesUrl1, App.statusMapper, { + App.HttpClient.get(servicesUrl, App.statusMapper, { complete:function (jqXHR, textStatus) { console.log('Cluster Controller: Updated components statuses successfully!!!') self.loadUpdatedStatusDelayed(); @@ -351,7 +351,7 @@ App.ClusterController = Em.Controller.extend({ App.router.get('updateController').updateServiceMetric(function(){ self.updateLoadStatus('services'); - }); + }, true); setTimeout(function(){ self.set('updateStatus', true); diff --git a/ambari-web/app/controllers/global/update_controller.js b/ambari-web/app/controllers/global/update_controller.js index c27251a2f0..16c6d9d356 100644 --- a/ambari-web/app/controllers/global/update_controller.js +++ b/ambari-web/app/controllers/global/update_controller.js @@ -60,14 +60,10 @@ App.UpdateController = Em.Controller.extend({ }, updateHost:function(){ - var hostsUrl = this.getUrl('/data/hosts/hosts.json', '/hosts?fields=*'); App.HttpClient.get(hostsUrl, App.hostsMapper, { - complete:function (jqXHR, textStatus) { - - } + complete:function (jqXHR, textStatus) {} }); - }, graphs: [], graphsUpdate: function () { @@ -86,14 +82,21 @@ App.UpdateController = Em.Controller.extend({ }); this.set('graphs', existedGraphs); }, - updateServiceMetric:function(callback){ + + /** + * Updates the services information. + * + * @param isInitialLoad If true, only basic information is loaded. + */ + updateServiceMetric: function (callback, isInitialLoad) { var self = this; self.set('isUpdated', false); - var servicesUrl = this.getUrl('/data/dashboard/services.json', '/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=*,components/host_components/*,components/ServiceComponentInfo'); - var callback = callback || function(jqXHR, textStatus){ + var servicesUrl = isInitialLoad ? + this.getUrl('/data/dashboard/services.json', '/services?fields=components/ServiceComponentInfo,components/host_components,components/host_components/HostRoles') : + this.getUrl('/data/dashboard/services.json', '/services?fields=components/ServiceComponentInfo,components/host_components,components/host_components/HostRoles,components/host_components/metrics/jvm/memHeapUsedM,components/host_components/metrics/jvm/memHeapCommittedM,components/host_components/metrics/mapred/jobtracker/trackers_decommissioned'); + var callback = callback || function (jqXHR, textStatus) { self.set('isUpdated', true); }; - App.HttpClient.get(servicesUrl, App.servicesMapper, { complete: callback }); diff --git a/ambari-web/app/mappers/server_data_mapper.js b/ambari-web/app/mappers/server_data_mapper.js index cea7bc97d8..d2ccd699f2 100644 --- a/ambari-web/app/mappers/server_data_mapper.js +++ b/ambari-web/app/mappers/server_data_mapper.js @@ -99,7 +99,9 @@ App.QuickDataMapper = App.ServerDataMapper.extend({ if (pathArr[0].substr(-1) == ']') { var index = parseInt(pathArr[0].substr(-2, 1)); var attr = pathArr[0].substr(0, pathArr[0].length - 3); - current = current[attr][index]; + if (attr in current) { + current = current[attr][index]; + } } else { current = current[pathArr[0]]; } |