You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rz...@apache.org on 2015/08/13 19:45:56 UTC

ambari git commit: AMBARI-12757. Hosts Page Performance: Hosts page takes 2-3 seconds to render an 100 items page (rzang)

Repository: ambari
Updated Branches:
  refs/heads/trunk 288fffb70 -> 8bb25bed2


AMBARI-12757. Hosts Page Performance: Hosts page takes 2-3 seconds to render an 100 items page (rzang)


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

Branch: refs/heads/trunk
Commit: 8bb25bed2c857ca0c351a1e3863aa56d07ab8e8e
Parents: 288fffb
Author: Richard Zang <rz...@apache.org>
Authored: Wed Aug 12 19:27:02 2015 -0700
Committer: Richard Zang <rz...@apache.org>
Committed: Thu Aug 13 10:43:33 2015 -0700

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host.js | 18 +++++++-----------
 ambari-web/app/routes/main.js           |  1 -
 ambari-web/app/views/main/host.js       | 21 ++++++---------------
 ambari-web/app/views/main/menu.js       |  1 -
 ambari-web/test/views/main/host_test.js |  5 -----
 5 files changed, 13 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8bb25bed/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 d660779..9ebc99f 100644
--- a/ambari-web/app/controllers/main/host.js
+++ b/ambari-web/app/controllers/main/host.js
@@ -50,23 +50,19 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin, {
   filterClearHappened: false,
 
   /**
-   * true if user click "Hosts" on top menu bar
-   */
-  fromTopBarClicking: false,
-  /**
    * if true, do not clean stored filter before hosts page rendering.
    */
   showFilterConditionsFirstLoad: false,
 
   /**
-   * if true, fire host loading immediately with out any postpone.
-   */
-  needQuickInitLoad: false,
-
-  /**
-   * true if from details page
+   * Components which will be shown in component filter
+   * @returns {Array}
    */
-  isDrillUp: false,
+  componentsForFilter: function () {
+    var installedComponents = App.StackServiceComponent.find().toArray();
+    installedComponents.setEach('checkedForHostFilter', false);
+    return installedComponents;
+  }.property('App.router.clusterController.isLoaded'),
 
   content: App.Host.find(),
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/8bb25bed/ambari-web/app/routes/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index 44bb055..b2bf9ef 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -267,7 +267,6 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
     back: function (router, event) {
       var referer = router.get('mainHostDetailsController.referer');
       if (referer) {
-        router.set('mainHostController.isDrillUp', true);
         router.route(referer);
       }
       else {

http://git-wip-us.apache.org/repos/asf/ambari/blob/8bb25bed/ambari-web/app/views/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host.js b/ambari-web/app/views/main/host.js
index db857cd..9491744 100644
--- a/ambari-web/app/views/main/host.js
+++ b/ambari-web/app/views/main/host.js
@@ -204,7 +204,6 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
     this.addObserver('startIndex', this, 'updatePagination');
     this.addObserver('displayLength', this, 'updatePagination');
     this.addObserver('filteredCount', this, this.updatePaging);
-    this.overlayObserver();
   },
 
   willDestroyElement: function () {
@@ -213,24 +212,16 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
 
   onInitialLoad: function () {
     if (this.get('tableFilteringComplete')) {
-      if (this.get('controller.fromTopBarClicking') && !this.get('controller.filterClearHappened')
-      && !this.get('controller.needQuickInitLoad') || this.get('controller.isDrillUp')) {
-        Em.run.later(this, this.refresh, App.get('contentUpdateInterval'));
-        this.clearLoadRelatedStates();
-      } else {
+      if (this.get('controller.filterClearHappened')) {
         this.refresh();
-        this.clearLoadRelatedStates();
+      } else {
+        // no refresh but still need to enable pagination controls
+        this.propertyDidChange('filteringComplete');
       }
     }
-  }.observes('tableFilteringComplete'),
-
-  clearLoadRelatedStates: function() {
+    // reset filter cleaning marker
     this.set('controller.filterClearHappened', false);
-    this.set('controller.fromTopBarClicking', false);
-    this.set('controller.needQuickInitLoad', false);
-    this.set('controller.isDrillUp', false);
-
-  },
+  }.observes('tableFilteringComplete'),
 
   /**
    * Set <code>selected</code> property for each App.Host

http://git-wip-us.apache.org/repos/asf/ambari/blob/8bb25bed/ambari-web/app/views/main/menu.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/menu.js b/ambari-web/app/views/main/menu.js
index d4d7ef3..40f9781 100644
--- a/ambari-web/app/views/main/menu.js
+++ b/ambari-web/app/views/main/menu.js
@@ -101,7 +101,6 @@ App.MainMenuView = Em.CollectionView.extend({
     goToSection: function (event) {
       if (event.context === 'hosts') {
         App.router.set('mainHostController.showFilterConditionsFirstLoad', false);
-        App.router.set('mainHostController.fromTopBarClicking', true);
       } else if (event.context === 'views') {
         App.router.route('views');
         return;

http://git-wip-us.apache.org/repos/asf/ambari/blob/8bb25bed/ambari-web/test/views/main/host_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/host_test.js b/ambari-web/test/views/main/host_test.js
index a63caca..22954ff 100644
--- a/ambari-web/test/views/main/host_test.js
+++ b/ambari-web/test/views/main/host_test.js
@@ -44,11 +44,6 @@ describe('App.MainHostView', function () {
           callCount: 1
         },
         {
-          methodName: 'overlayObserver',
-          propertyToChange: 'filteringComplete',
-          callCount: 2
-        },
-        {
           methodName: 'updatePagination',
           propertyToChange: 'displayLength',
           callCount: 1