ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject ambari git commit: AMBARI-12300. Hosts page becomes increasingly unresponsive and laggy (keeps freezing for a long time, especially on a big cluster). (yusaku)
Date Mon, 06 Jul 2015 23:39:02 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 7e06bfcc3 -> 6b5d4bfe9


AMBARI-12300. Hosts page becomes increasingly unresponsive and laggy (keeps freezing for a
long time, especially on a big cluster). (yusaku)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6b5d4bfe
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6b5d4bfe
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6b5d4bfe

Branch: refs/heads/branch-2.1
Commit: 6b5d4bfe91d810fb8ed556d4fd39b8de44c4079a
Parents: 7e06bfc
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Mon Jul 6 16:15:45 2015 -0700
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Mon Jul 6 16:38:50 2015 -0700

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host.js | 12 +++++++++---
 ambari-web/app/mappers/hosts_mapper.js  | 19 +++++++++++--------
 2 files changed, 20 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6b5d4bfe/ambari-web/app/controllers/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host.js b/ambari-web/app/controllers/main/host.js
index e5f08b3..81711ef 100644
--- a/ambari-web/app/controllers/main/host.js
+++ b/ambari-web/app/controllers/main/host.js
@@ -54,9 +54,15 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin,
{
     return installedComponents;
   }.property('App.router.clusterController.isLoaded'),
 
-  content: function () {
-    return this.get('dataSource').filterProperty('isRequested');
-  }.property('dataSource.@each.isRequested'),
+  content: [],
+
+  requestedObserver: function() {
+    Em.run.once(this, 'setContentOnce');
+  }.observes('dataSource.@each.isRequested'),
+
+  setContentOnce: function() {
+    this.set('content', this.get('dataSource').filterProperty('isRequested'));
+  },
 
   allHostStackVersions: App.HostStackVersion.find(),
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/6b5d4bfe/ambari-web/app/mappers/hosts_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/hosts_mapper.js b/ambari-web/app/mappers/hosts_mapper.js
index 6158ee9..5ab249e 100644
--- a/ambari-web/app/mappers/hosts_mapper.js
+++ b/ambari-web/app/mappers/hosts_mapper.js
@@ -156,11 +156,12 @@ App.hostsMapper = App.QuickDataMapper.create({
       }
 
 
-      App.Host.find().forEach(function (host) {
-        if (!hostIds[host.get('hostName')]) {
-          host.set('isRequested', false);
-        }
-      });
+      App.Host.find().filterProperty('isRequested', true)
+        .filter(function(item) {
+          return !hostIds[item.get('hostName')];
+        })
+        .setEach('isRequested', false);
+
       App.HostComponent.find().filterProperty('isMaster').forEach(function(component) {
         if (componentsIdMap[component.get('id')]) componentsIdMap[component.get('id')].display_name_advanced
= component.get('displayNameAdvanced');
       });
@@ -188,9 +189,11 @@ App.hostsMapper = App.QuickDataMapper.create({
     this.get('model').find().forEach(function (host) {
       if (host.get('isRequested')) {
         var hostMetrics = data.items.findProperty('Hosts.host_name', host.get('hostName'));
-        host.set('diskTotal', Em.get(hostMetrics, 'metrics.disk.disk_total'));
-        host.set('diskFree', Em.get(hostMetrics, 'metrics.disk.disk_free'));
-        host.set('loadOne', Em.get(hostMetrics, 'metrics.load.load_one'));
+        host.setProperties({
+          diskTotal: Em.get(hostMetrics, 'metrics.disk.disk_total'),
+          diskFree: Em.get(hostMetrics, 'metrics.disk.disk_free'),
+          loadOne: Em.get(hostMetrics, 'metrics.load.load_one')
+        });
       }
     }, this);
   }


Mime
View raw message