You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2012/12/09 16:13:10 UTC

svn commit: r1419004 - in /incubator/ambari/branches/AMBARI-666: AMBARI-666-CHANGES.txt ambari-web/app/controllers/global/cluster_controller.js ambari-web/app/controllers/global/update_controller.js ambari-web/app/mappers/server_data_mapper.js

Author: yusaku
Date: Sun Dec  9 15:13:09 2012
New Revision: 1419004

URL: http://svn.apache.org/viewvc?rev=1419004&view=rev
Log:
AMBARI-1051. Dashboard page takes long time to load. (Srimanth Gunturi via yusaku)

Modified:
    incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/cluster_controller.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/update_controller.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/server_data_mapper.js

Modified: incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt?rev=1419004&r1=1419003&r2=1419004&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt (original)
+++ incubator/ambari/branches/AMBARI-666/AMBARI-666-CHANGES.txt Sun Dec  9 15:13:09 2012
@@ -427,6 +427,9 @@ AMBARI-666 branch (unreleased changes)
 
   IMPROVEMENTS
 
+  AMBARI-1051. Dashboard page takes long time to load. (Srimanth Gunturi via
+  yusaku)
+
   AMBARI-1041. Additional metrics need to be added to Heatmap UI. (Srimanth
   Gunturi via yusaku)
 

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/cluster_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/cluster_controller.js?rev=1419004&r1=1419003&r2=1419004&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/cluster_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/cluster_controller.js Sun Dec  9 15:13:09 2012
@@ -284,10 +284,10 @@ App.ClusterController = Em.Controller.ex
       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.ex
 
     App.router.get('updateController').updateServiceMetric(function(){
       self.updateLoadStatus('services');
-    });
+    }, true);
 
     setTimeout(function(){
       self.set('updateStatus', true);

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/update_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/update_controller.js?rev=1419004&r1=1419003&r2=1419004&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/update_controller.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/global/update_controller.js Sun Dec  9 15:13:09 2012
@@ -60,14 +60,10 @@ App.UpdateController = Em.Controller.ext
   },
 
   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.ext
       });
       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
     });

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/server_data_mapper.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/server_data_mapper.js?rev=1419004&r1=1419003&r2=1419004&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/server_data_mapper.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/mappers/server_data_mapper.js Sun Dec  9 15:13:09 2012
@@ -99,7 +99,9 @@ App.QuickDataMapper = App.ServerDataMapp
       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]];
       }