incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srima...@apache.org
Subject svn commit: r1495241 - /incubator/ambari/trunk/ambari-web/app/controllers/global/update_controller.js
Date Thu, 20 Jun 2013 23:47:19 GMT
Author: srimanth
Date: Thu Jun 20 23:47:19 2013
New Revision: 1495241

URL: http://svn.apache.org/r1495241
Log:
AMBARI-2454. Inability to retrieve flume metrics on cluster without flume breaks web-ui. (srimanth)

Modified:
    incubator/ambari/trunk/ambari-web/app/controllers/global/update_controller.js

Modified: incubator/ambari/trunk/ambari-web/app/controllers/global/update_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/global/update_controller.js?rev=1495241&r1=1495240&r2=1495241&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/global/update_controller.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/global/update_controller.js Thu Jun
20 23:47:19 2013
@@ -78,10 +78,17 @@ App.UpdateController = Em.Controller.ext
   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");
+    }
+    var conditionalFieldsString = conditionalFields.length > 0 ? ',' + conditionalFields.join(',')
: '';
+    
     var servicesUrl = isInitialLoad ? 
       //this.getUrl('/data/dashboard/services.json', '/services?fields=components/ServiceComponentInfo,components/host_components,components/host_components/HostRoles')
:
-      this.getUrl('/data/dashboard/services.json', '/services?fields=components/ServiceComponentInfo,components/host_components,components/host_components/HostRoles,components/host_components/metrics/jvm/memHeapUsedM,components/host_components/metrics/jvm/memHeapCommittedM,components/host_components/metrics/mapred/jobtracker/trackers_decommissioned,components/host_components/metrics/cpu/cpu_wio,components/host_components/metrics/rpc/RpcQueueTime_avg_time,components/host_components/metrics/flume/flume'):
-      this.getUrl('/data/dashboard/services.json', '/services?fields=components/ServiceComponentInfo,components/host_components,components/host_components/HostRoles,components/host_components/metrics/jvm/memHeapUsedM,components/host_components/metrics/jvm/memHeapCommittedM,components/host_components/metrics/mapred/jobtracker/trackers_decommissioned,components/host_components/metrics/cpu/cpu_wio,components/host_components/metrics/rpc/RpcQueueTime_avg_time,components/host_components/metrics/flume/flume');
+      this.getUrl('/data/dashboard/services.json', '/services?fields=components/ServiceComponentInfo,components/host_components,components/host_components/HostRoles,components/host_components/metrics/jvm/memHeapUsedM,components/host_components/metrics/jvm/memHeapCommittedM,components/host_components/metrics/mapred/jobtracker/trackers_decommissioned,components/host_components/metrics/cpu/cpu_wio,components/host_components/metrics/rpc/RpcQueueTime_avg_time'+conditionalFieldsString):
+      this.getUrl('/data/dashboard/services.json', '/services?fields=components/ServiceComponentInfo,components/host_components,components/host_components/HostRoles,components/host_components/metrics/jvm/memHeapUsedM,components/host_components/metrics/jvm/memHeapCommittedM,components/host_components/metrics/mapred/jobtracker/trackers_decommissioned,components/host_components/metrics/cpu/cpu_wio,components/host_components/metrics/rpc/RpcQueueTime_avg_time'+conditionalFieldsString);
     var callback = callback || function (jqXHR, textStatus) {
       self.set('isUpdated', true);
     };



Mime
View raw message