ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject ambari git commit: AMBARI-12378. Widget display goes on and off at service dashboard for Number and Graph widgets using same metrics.
Date Fri, 10 Jul 2015 19:57:07 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 8905ec1dd -> c4ba56565


AMBARI-12378. Widget display goes on and off at service dashboard for Number and Graph widgets
using same metrics.


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

Branch: refs/heads/branch-2.1
Commit: c4ba56565d1c994c3f7bb2d25810e8cf4bff1148
Parents: 8905ec1
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Fri Jul 10 12:56:30 2015 -0700
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Fri Jul 10 12:56:30 2015 -0700

----------------------------------------------------------------------
 .../app/mixins/common/widgets/widget_mixin.js   |  4 ++-
 .../test/mixins/common/widget_mixin_test.js     | 30 ++++++++++++++++----
 2 files changed, 27 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c4ba5656/ambari-web/app/mixins/common/widgets/widget_mixin.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/widgets/widget_mixin.js b/ambari-web/app/mixins/common/widgets/widget_mixin.js
index 961ce7d..ac2c6e3 100644
--- a/ambari-web/app/mixins/common/widgets/widget_mixin.js
+++ b/ambari-web/app/mixins/common/widgets/widget_mixin.js
@@ -702,7 +702,9 @@ App.WidgetLoadAggregator = Em.Object.create({
     var bulks = {};
 
     requests.forEach(function (request) {
-      var id = request.startCallName + "_" + request.data.component_name;
+      //poll metrics for graph widgets separately
+      var graphSuffix = request.context.get('content.widgetType') === "GRAPH" ? "_graph"
: '';
+      var id = request.startCallName + "_" + request.data.component_name + graphSuffix;
 
       if (Em.isNone(bulks[id])) {
         bulks[id] = {

http://git-wip-us.apache.org/repos/asf/ambari/blob/c4ba5656/ambari-web/test/mixins/common/widget_mixin_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/common/widget_mixin_test.js b/ambari-web/test/mixins/common/widget_mixin_test.js
index 1881d98..f0f663c 100644
--- a/ambari-web/test/mixins/common/widget_mixin_test.js
+++ b/ambari-web/test/mixins/common/widget_mixin_test.js
@@ -419,7 +419,11 @@ describe('App.WidgetLoadAggregator', function () {
             component_name: 'C1',
             metric_paths: ['m1']
           },
-          context: 'c1'
+          context: Em.Object.create({
+            content: {
+              widgetType: 'GRAPH'
+            }
+          })
         },
         {
           startCallName: 'n1',
@@ -427,7 +431,11 @@ describe('App.WidgetLoadAggregator', function () {
             component_name: 'C1',
             metric_paths: ['m2']
           },
-          context: 'c2'
+          context: Em.Object.create({
+            content: {
+              widgetType: 'NUMBER'
+            }
+          })
         },
         {
           startCallName: 'n2',
@@ -435,7 +443,11 @@ describe('App.WidgetLoadAggregator', function () {
             component_name: 'C1',
             metric_paths: ['m3']
           },
-          context: 'c3'
+          context: Em.Object.create({
+            content: {
+              widgetType: 'TEMPLATE'
+            }
+          })
         },
         {
           startCallName: 'n1',
@@ -443,13 +455,19 @@ describe('App.WidgetLoadAggregator', function () {
             component_name: 'C2',
             metric_paths: ['m4']
           },
-          context: 'c4'
+          context: Em.Object.create({
+            content: {
+              widgetType: 'GAUGE'
+            }
+          })
         }
       ];
       var result = aggregator.groupRequests(requests);
 
-      expect(result['n1_C1'].subRequests.length).to.equal(2);
-      expect(result['n1_C1'].data.metric_paths.length).to.equal(2);
+      expect(result['n1_C1'].subRequests.length).to.equal(1);
+      expect(result['n1_C1'].data.metric_paths.length).to.equal(1);
+      expect(result['n1_C1_graph'].subRequests.length).to.equal(1);
+      expect(result['n1_C1_graph'].data.metric_paths.length).to.equal(1);
       expect(result['n2_C1'].subRequests.length).to.equal(1);
       expect(result['n2_C1'].data.metric_paths.length).to.equal(1);
       expect(result['n1_C2'].subRequests.length).to.equal(1);


Mime
View raw message