Repository: ambari
Updated Branches:
  refs/heads/trunk cef629f81 -> bb21aae27


AMBARI-5548. Flume host graphs not showing lines even when data is available. 
(srimanth)


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

Branch: refs/heads/trunk
Commit: bb21aae27d916899f6b134de294bd014cc7d0ea3
Parents: cef629f
Author: Srimanth Gunturi <sgunt...@hortonworks.com>
Authored: Wed Apr 23 12:00:03 2014 -0700
Committer: Srimanth Gunturi <sgunt...@hortonworks.com>
Committed: Wed Apr 23 12:02:04 2014 -0700

----------------------------------------------------------------------
 .../info/metrics/flume/flume_metric_graph.js    | 27 ++++++++------------
 1 file changed, 10 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/bb21aae2/ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graph.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graph.js 
b/ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graph.js
index 4d23f0c..56a1c7f 100644
--- a/ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graph.js
+++ b/ambari-web/app/views/main/service/info/metrics/flume/flume_metric_graph.js
@@ -35,7 +35,7 @@ App.ChartServiceFlumeMetricGraph = 
App.ChartLinearTimeView.extend({
   hostName: null,
 
   id: function(){
-    return "service-metrics-flume-metric-graph-" + this.get('metricType') + 
'-' + this.get('metricType');
+    return "service-metrics-flume-metric-graph-" + this.get('metricType') + 
'-' + this.get('metricName');
   }.property('metricType', 'metricName'),
 
   title: function(){
@@ -55,23 +55,16 @@ App.ChartServiceFlumeMetricGraph = 
App.ChartLinearTimeView.extend({
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     var self = this;
-    if (jsonData && jsonData.host_components) {
-      jsonData.host_components.forEach(function (hc) {
-        var hostName = hc.HostRoles.host_name;
-        var host = App.Host.find(hostName);
-        if (host && host.get('publicHostName')) {
-          hostName = host.get('publicHostName');
+    if (jsonData && jsonData.metrics && jsonData.metrics.flume && 
jsonData.metrics.flume.flume &&
+        jsonData.metrics.flume.flume[this.get('metricType')]) {
+      var metricTypeData = 
jsonData.metrics.flume.flume[this.get('metricType')];
+      for ( var componentName in metricTypeData) {
+        var seriesName = componentName;
+        var seriesData = metricTypeData[componentName][this.get('metricName')];
+        if (seriesData) {
+          seriesArray.push(self.transformData(seriesData, seriesName));
         }
-        if (hc.metrics && hc.metrics.flume && hc.metrics.flume.flume && 
hc.metrics.flume.flume.SINK) {
-          for ( var cname in hc.metrics.flume.flume.SINK) {
-            var seriesName = 
Em.I18n.t('services.service.info.metrics.flume.sinkName').format(cname + " (" + 
hostName + ")");
-            var seriesData = 
hc.metrics.flume.flume.SINK[cname]['ConnectionFailedCount'];
-            if (seriesData) {
-              seriesArray.push(self.transformData(seriesData, seriesName));
-            }
-          }
-        }
-      });
+      }
     }
     return seriesArray;
   }

Reply via email to