incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From onechipore...@apache.org
Subject git commit: AMBARI-2796. YARN containers and applications count is 'null'. (Andrii Babiichuk via onechiporenko)
Date Fri, 02 Aug 2013 11:34:52 GMT
Updated Branches:
  refs/heads/trunk e67c81126 -> b56ab107d


AMBARI-2796. YARN containers and applications count is 'null'. (Andrii Babiichuk via onechiporenko)


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

Branch: refs/heads/trunk
Commit: b56ab107de96f40e6a128df0b879c73366157d3d
Parents: e67c811
Author: Oleg Nechiporenko <cv_github@yahoo.com>
Authored: Fri Aug 2 14:34:38 2013 +0300
Committer: Oleg Nechiporenko <cv_github@yahoo.com>
Committed: Fri Aug 2 14:34:38 2013 +0300

----------------------------------------------------------------------
 .../app/controllers/global/update_controller.js | 23 ++++++++++++++------
 ambari-web/app/mappers/service_mapper.js        | 20 ++++++++---------
 ambari-web/app/models/service/yarn.js           |  2 +-
 .../app/views/main/dashboard/service/hdfs.js    |  6 ++---
 .../app/views/main/dashboard/service/yarn.js    | 13 +++--------
 5 files changed, 33 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/b56ab107/ambari-web/app/controllers/global/update_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/update_controller.js b/ambari-web/app/controllers/global/update_controller.js
index 694f979..6bdfe3f 100644
--- a/ambari-web/app/controllers/global/update_controller.js
+++ b/ambari-web/app/controllers/global/update_controller.js
@@ -78,14 +78,23 @@ App.UpdateController = Em.Controller.extend({
   updateServiceMetric: function (callback, isInitialLoad) {
     var self = this;
     self.set('isUpdated', false);
-    
+
     var conditionalFields = [];
-    if (App.Service.find().findProperty('serviceName', 'FLUME')) {
-      conditionalFields.push("components/host_components/metrics/flume/flume");
-    }
-    if (App.Service.find().findProperty('serviceName', 'YARN')) {
-      conditionalFields.push("components/host_components/metrics/yarn/Queue");
-    }
+    var services = [
+        {
+            name: 'FLUME',
+            urlParam: 'flume/flume'
+        },
+        {
+            name: 'YARN',
+            urlParam: 'yarn/Queue'
+        }
+    ];
+    services.forEach(function(service) {
+        if (App.Service.find(service.name)) {
+            conditionalFields.push("components/host_components/metrics/" + service.urlParam);
+        }
+    });
     var conditionalFieldsString = conditionalFields.length > 0 ? ',' + conditionalFields.join(',')
: '';
     var methodStartTs = new Date().getTime();
     var testUrl = App.testHadoop2Stack ? '/data/dashboard/HDP2/services.json':'/data/dashboard/services.json';

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/b56ab107/ambari-web/app/mappers/service_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/service_mapper.js b/ambari-web/app/mappers/service_mapper.js
index ab00caf..4874319 100644
--- a/ambari-web/app/mappers/service_mapper.js
+++ b/ambari-web/app/mappers/service_mapper.js
@@ -91,20 +91,20 @@ App.servicesMapper = App.QuickDataMapper.create({
     resource_manager_start_time: 'resourceManagerComponent.ServiceComponentInfo.StartTime',
     jvm_memory_heap_used: 'resourceManagerComponent.host_components[0].metrics.jvm.memHeapUsedM',
     jvm_memory_heap_committed: 'resourceManagerComponent.host_components[0].metrics.jvm.memHeapCommittedM',
-    containers_allocated: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.AllocatedContainers',
-    containers_pending: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.PendingContainers',
-    containers_reserved: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.ReservedContainers',
-    apps_submitted: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.AppsSubmitted',
-    apps_running: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.AppsRunning',
-    apps_pending: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.AppsPending',
-    apps_completed: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.AppsCompleted',
-    apps_killed: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.AppsKilled',
-    apps_failed: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.AppsFailed',
+    containers_allocated: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.AllocatedContainers',
+    containers_pending: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.PendingContainers',
+    containers_reserved: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.ReservedContainers',
+    apps_submitted: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.AppsSubmitted',
+    apps_running: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.AppsRunning',
+    apps_pending: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.AppsPending',
+    apps_completed: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.AppsCompleted',
+    apps_killed: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.AppsKilled',
+    apps_failed: 'resourceManagerComponent.host_components[0].metrics.yarn.Queue.root.AppsFailed',
     node_managers_count_active: 'resourceManagerComponent.ServiceComponentInfo.rm_metrics.cluster.activeNMcount',
     node_managers_count_lost: 'resourceManagerComponent.ServiceComponentInfo.rm_metrics.cluster.lostNMcount',
     node_managers_count_unhealthy: 'resourceManagerComponent.ServiceComponentInfo.rm_metrics.cluster.unhealthyNMcount',
     node_managers_count_rebooted: 'resourceManagerComponent.ServiceComponentInfo.rm_metrics.cluster.rebootedNMcount',
-    node_managers_count_decommissioned: 'resourceManagerComponent.ServiceComponentInfo.rm_metrics.cluster.decommissionedNMcount'
+    node_managers_count_decommissioned: 'resourceManagerComponent.ServiceComponentInfo.rm_metrics.cluster.decommissionedNMcount',
   },
   mapReduce2Config: {
     version: 'jobHistoryServerComponent.ServiceComponentInfo.Version',

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/b56ab107/ambari-web/app/models/service/yarn.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service/yarn.js b/ambari-web/app/models/service/yarn.js
index 3635967..b4b007f 100644
--- a/ambari-web/app/models/service/yarn.js
+++ b/ambari-web/app/models/service/yarn.js
@@ -39,7 +39,7 @@ App.YARNService = App.Service.extend({
   yarnClientNodes: DS.hasMany('App.Host'),
   resourceManagerStartTime: DS.attr('number'),
   jvmMemoryHeapUsed: DS.attr('number'),
-  jvmMemoryHeapCommitted: DS.attr('number'),
+  jvmMemoryHeapCommitted: DS.attr('number')
 });
 
 App.YARNService.FIXTURES = [];

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/b56ab107/ambari-web/app/views/main/dashboard/service/hdfs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/service/hdfs.js b/ambari-web/app/views/main/dashboard/service/hdfs.js
index 15207b0..f7a1920 100644
--- a/ambari-web/app/views/main/dashboard/service/hdfs.js
+++ b/ambari-web/app/views/main/dashboard/service/hdfs.js
@@ -89,8 +89,8 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
   }.property('service.nameNode'),
 
   nodeHeap: function () {
-    var memUsed = this.get('service').get('jvmMemoryHeapUsed') * 1000000;
-    var memCommitted = this.get('service').get('jvmMemoryHeapCommitted') * 1000000;
+    var memUsed = this.get('service').get('jvmMemoryHeapUsed') * 1024 * 1024;
+    var memCommitted = this.get('service').get('jvmMemoryHeapCommitted') * 1024 * 1024;
     var percent = memCommitted > 0 ? ((100 * memUsed) / memCommitted) : 0;
     return this.t('dashboard.services.hdfs.nodes.heapUsed').format(memUsed.bytesToSize(1,
'parseFloat'), memCommitted.bytesToSize(1, 'parseFloat'), percent.toFixed(1));
 
@@ -137,4 +137,4 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
     var safeMode = this.get('service.safeModeStatus');
     return safeMode != null && safeMode.length > 0;
   }.property('service.safeModeStatus')
-});
\ No newline at end of file
+});

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/b56ab107/ambari-web/app/views/main/dashboard/service/yarn.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/service/yarn.js b/ambari-web/app/views/main/dashboard/service/yarn.js
index a739545..29bcb96 100644
--- a/ambari-web/app/views/main/dashboard/service/yarn.js
+++ b/ambari-web/app/views/main/dashboard/service/yarn.js
@@ -23,8 +23,8 @@ App.MainDashboardServiceYARNView = App.MainDashboardServiceView.extend({
   serviceName: 'YARN',
 
   nodeHeap: function () {
-    var memUsed = this.get('service').get('jvmMemoryHeapUsed') * 1000000;
-    var memCommitted = this.get('service').get('jvmMemoryHeapCommitted') * 1000000;
+    var memUsed = this.get('service').get('jvmMemoryHeapUsed') * 1024 * 1024;
+    var memCommitted = this.get('service').get('jvmMemoryHeapCommitted') * 1024 * 1024;
     var percent = memCommitted > 0 ? ((100 * memUsed) / memCommitted) : 0;
     return this.t('dashboard.services.hdfs.nodes.heapUsed').format(memUsed.bytesToSize(1,
'parseFloat'), memCommitted.bytesToSize(1, 'parseFloat'), percent.toFixed(1));
 
@@ -66,13 +66,6 @@ App.MainDashboardServiceYARNView = App.MainDashboardServiceView.extend({
     return this.t('services.service.summary.notRunning');
   }.property("service.resourceManagerStartTime"),
 
-  nodeHeap: function () {
-    var memUsed = this.get('service').get('jvmMemoryHeapUsed') * 1000000;
-    var memCommitted = this.get('service').get('jvmMemoryHeapCommitted') * 1000000;
-    var percent = memCommitted > 0 ? ((100 * memUsed) / memCommitted) : 0;
-    return this.t('dashboard.services.hdfs.nodes.heapUsed').format(memUsed.bytesToSize(1,
'parseFloat'), memCommitted.bytesToSize(1, 'parseFloat'), percent.toFixed(1));
-  }.property('service.jvmMemoryHeapUsed', 'service.jvmMemoryHeapCommitted'),
-
   nodeManagersLive: function () {
     return this.get('service.nodeManagerLiveNodes.length');
   }.property('service.nodeManagerNodes', 'service.nodeManagerLiveNodes'),
@@ -112,4 +105,4 @@ App.MainDashboardServiceYARNView = App.MainDashboardServiceView.extend({
     return this.t('dashboard.services.yarn.apps.msg').format(appsSubmitted, appsRunning,
appsPending, appsCompleted, appsKilled, appsFailed);
   }.property('service.appsSubmitted', 'service.appsRunning', 'service.appsPending', 'service.appsCompleted',
'service.appsKilled', 'service.appsFailed'),
 
-});
\ No newline at end of file
+});


Mime
View raw message