Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 53B171820D for ; Mon, 6 Jul 2015 23:39:02 +0000 (UTC) Received: (qmail 38703 invoked by uid 500); 6 Jul 2015 23:39:02 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 38671 invoked by uid 500); 6 Jul 2015 23:39:02 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 38662 invoked by uid 99); 6 Jul 2015 23:39:02 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Jul 2015 23:39:02 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 24D80E04EF; Mon, 6 Jul 2015 23:39:02 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: yusaku@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer 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, 6 Jul 2015 23:39:02 +0000 (UTC) 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 Authored: Mon Jul 6 16:15:45 2015 -0700 Committer: Yusaku Sako 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); }