Repository: ambari
Updated Branches:
  refs/heads/trunk 441b02580 -> cd60e5aac


AMBARI-6047. Widget for supervisor always shows zero on dashboard. (Buzhor 
Denys via onechiporenko)


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

Branch: refs/heads/trunk
Commit: cd60e5aac205b319fa828d5babe9914e5da26fdd
Parents: 441b025
Author: Oleg Nechiporenko <[email protected]>
Authored: Fri Jun 6 17:04:29 2014 +0300
Committer: Oleg Nechiporenko <[email protected]>
Committed: Fri Jun 6 17:04:29 2014 +0300

----------------------------------------------------------------------
 .../app/mappers/service_metrics_mapper.js       |  5 +++-
 ambari-web/app/models/service/storm.js          |  3 ++
 .../templates/main/service/services/storm.hbs   |  2 +-
 .../main/dashboard/widgets/supervisor_live.js   | 29 ++++++++++----------
 .../app/views/main/service/services/storm.js    | 10 ++++++-
 5 files changed, 31 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/cd60e5aa/ambari-web/app/mappers/service_metrics_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/service_metrics_mapper.js 
b/ambari-web/app/mappers/service_metrics_mapper.js
index aa70ec1..9e9dcc4 100644
--- a/ambari-web/app/mappers/service_metrics_mapper.js
+++ b/ambari-web/app/mappers/service_metrics_mapper.js
@@ -147,7 +147,10 @@ App.serviceMetricsMapper = App.QuickDataMapper.create({
     used_slots: 'restApiComponent.metrics.api.cluster.summary.["tasks.total"]',
     topologies: 'restApiComponent.metrics.api.cluster.summary.topologies',
     total_executors: 
'restApiComponent.metrics.api.cluster.summary.["executors.total"]',
-    nimbus_uptime: 
'restApiComponent.metrics.api.cluster.summary.["nimbus.uptime"]'
+    nimbus_uptime: 
'restApiComponent.metrics.api.cluster.summary.["nimbus.uptime"]',
+    super_visors_started: 'super_visors_started',
+    super_visors_installed: 'super_visors_installed',
+    super_visors_total: 'super_visors_total'
   },
   flumeAgentConfig: {
     name: 'HostComponentProcess.name',

http://git-wip-us.apache.org/repos/asf/ambari/blob/cd60e5aa/ambari-web/app/models/service/storm.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service/storm.js 
b/ambari-web/app/models/service/storm.js
index 935df4f..f061d31 100644
--- a/ambari-web/app/models/service/storm.js
+++ b/ambari-web/app/models/service/storm.js
@@ -19,6 +19,9 @@ var App = require('app');
 
 App.StormService = App.Service.extend({
   version: DS.attr('string'),
+  superVisorsStarted: DS.attr('number'),
+  superVisorsInstalled: DS.attr('number'),
+  superVisorsTotal: DS.attr('number'),
   totalTasks: DS.attr('number'),
   totalSlots: DS.attr('number'),
   usedSlots: DS.attr('number'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/cd60e5aa/ambari-web/app/templates/main/service/services/storm.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/services/storm.hbs 
b/ambari-web/app/templates/main/service/services/storm.hbs
index b260d6b..d70842c 100644
--- a/ambari-web/app/templates/main/service/services/storm.hbs
+++ b/ambari-web/app/templates/main/service/services/storm.hbs
@@ -25,7 +25,7 @@
   </td>
   <td>
     <span>
-      {{#view App.ComponentLiveTextView 
liveComponentsBinding="view.service.superVisorsStarted" 
totalComponentsBinding="view.service.superVisorsTotal"}}
+      {{#view App.ComponentLiveTextView 
liveComponentsBinding="view.superVisorsLive" 
totalComponentsBinding="view.superVisorsTotal"}}
         {{view.liveComponents}}/{{view.totalComponents}}
       {{/view}}
     </span> {{t services.service.summary.SupervisorsLIVE}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/cd60e5aa/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js 
b/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js
index 597cb7f..663827a 100644
--- a/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js
+++ b/ambari-web/app/views/main/dashboard/widgets/supervisor_live.js
@@ -30,8 +30,8 @@ App.SuperVisorUpView = App.TextDashboardWidgetView.extend({
 
   hiddenInfo: function () {
     var result = [];
-    result.pushObject(this.get('superVisorsLive').length + ' ' + 
Em.I18n.t('dashboard.services.hdfs.nodes.live'));
-    result.pushObject(this.get('superVisorsDead').length + ' ' + 
Em.I18n.t('dashboard.services.hdfs.nodes.dead'));
+    result.pushObject(this.get('superVisorsLive') + ' ' + 
Em.I18n.t('dashboard.services.hdfs.nodes.live'));
+    result.pushObject(this.get('superVisorsDead') + ' ' + 
Em.I18n.t('dashboard.services.hdfs.nodes.dead'));
     return result;
   }.property('superVisorsLive', 'superVisorsDead'),
   hiddenInfoClass: "hidden-info-two-line",
@@ -40,30 +40,29 @@ App.SuperVisorUpView = App.TextDashboardWidgetView.extend({
   thresh2: 70,
   maxValue: 100,
 
-  superVisorComponents: function() {
-    return this.get('model.hostComponents').filterProperty('componentName', 
'SUPERVISOR');
-  }.property('model.hostComponents.length'),
-
   superVisorsLive: function () {
-    return this.get('superVisorComponents').filterProperty("workStatus", 
"STARTED");
-  }.property('[email protected]'),
+    return this.get('model.superVisorsStarted');
+  }.property('model.superVisorsStarted'),
 
   superVisorsDead: function () {
-    return this.get('superVisorComponents').filterProperty("workStatus", 
"INSTALLED");
-  }.property('[email protected]'),
+    return this.get('model.superVisorsInstalled');
+  }.property('model.superVisorsInstalled'),
 
+  superVisorsTotal: function() {
+    return this.get('model.superVisorsTotal');
+  }.property('model.superVisorsTotal'),
 
   data: function () {
-    if ( !this.get('superVisorComponents.length')) {
+    if ( !this.get('superVisorsTotal')) {
       return -1;
     } else {
-      return ((this.get('superVisorsLive').length / 
this.get('model.hostComponents').filterProperty('componentName', 
'SUPERVISOR').length).toFixed(2)) * 100;
+      return ((this.get('superVisorsLive') / 
this.get('superVisorsTotal')).toFixed(2)) * 100;
     }
-  }.property('model.hostComponents.length', 'superVisorsLive'),
+  }.property('superVisorsTotal', 'superVisorsLive'),
 
   content: function () {
-    return this.get('superVisorsLive').length + "/" + 
this.get('superVisorComponents').length;
-  }.property('superVisorComponents.length', 'superVisorsLive'),
+    return this.get('superVisorsLive') + "/" + this.get('superVisorsTotal');
+  }.property('superVisorsLive', 'superVisorsTotal'),
 
   editWidget: function (event) {
     var parent = this;

http://git-wip-us.apache.org/repos/asf/ambari/blob/cd60e5aa/ambari-web/app/views/main/service/services/storm.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/services/storm.js 
b/ambari-web/app/views/main/service/services/storm.js
index 937c856..406c46f 100644
--- a/ambari-web/app/views/main/service/services/storm.js
+++ b/ambari-web/app/views/main/service/services/storm.js
@@ -21,12 +21,20 @@ var date = require('utils/date');
 
 App.MainDashboardServiceStormView = App.MainDashboardServiceView.extend({
   templateName: require('templates/main/service/services/storm'),
-  serviceName: 'storm',
+  serviceName: 'STORM',
 
   freeSlotsPercentage: function() {
     return 
Math.round(this.get('service.freeSlots')/this.get('service.totalSlots')*100);
   }.property('service.freeSlots', 'service.totalSlots'),
 
+  superVisorsLive: function () {
+    return this.get('service.superVisorsStarted');
+  }.property('service.superVisorsStarted'),
+
+  superVisorsTotal: function() {
+    return this.get('service.superVisorsTotal');
+  }.property('service.superVisorsTotal'),
+
   nimbusUptimeFormatted: function() {
     if (this.get('service.nimbusUptime') > 0) {
       return date.timingFormat(this.get('service.nimbusUptime')*1000);

Reply via email to