Explorar el Código

AMBARI-10814. Heatmap displays NaN. (Srimanth Gunturi via yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1431627 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako hace 12 años
padre
commit
f8117d2348

+ 2 - 0
CHANGES.txt

@@ -654,6 +654,8 @@ AMBARI-666 branch (unreleased changes)
 
   BUG FIXES
 
+  AMBARI-1084. Heatmap displays NaN. (Srimanth Gunturi via yusaku)
+
   AMBARI-1081. HDFS disk capacity on dashboard is seen as negative number.
   (Srimanth Gunturi via yusaku)
 

+ 1 - 1
ambari-web/app/messages.js

@@ -321,7 +321,7 @@ Em.I18n.translations = {
   'dashboard.services.hdfs.nameNodeWebUI':'NameNode Web UI',
   'dashboard.services.hdfs.nodes.live':'live',
   'dashboard.services.hdfs.nodes.dead':'dead',
-  'dashboard.services.hdfs.nodes.decom':'decom',
+  'dashboard.services.hdfs.nodes.decom':'decommissioning',
   'dashboard.services.hdfs.nodes.uptime':'NameNode Uptime',
   'dashboard.services.hdfs.nodes.heap':'NameNode Heap',
   'dashboard.services.hdfs.nodes.heapUsed':'{0} / {1} ({2}% used)',

+ 27 - 3
ambari-web/app/views/main/charts/heatmap/heatmap_host.js

@@ -34,8 +34,28 @@ App.MainChartsHeatmapHostView = Em.View.extend({
   mouseEnter: function (e) {
     var host = this.get('content');
     var view = App.MainChartsHeatmapHostDetailView.create();
-    $.each(view.get('details'), function (i) {
-      view.set('details.' + i, host.get(i));
+    $.each(view.get('details'), function(i){
+      var val = host.get(i);
+      if (i == 'diskUsage') {
+        if (val == undefined || isNaN(val)) {
+          val = null;
+        } else {
+          val = val.toFixed(1);
+        }
+      } else if (i == 'cpuUsage') {
+        if (val == undefined || isNaN(val)) {
+          val = null;
+        } else {
+          val = val.toFixed(1);
+        }
+      } else if (i == 'memoryUsage') {
+        if (val == undefined || isNaN(val)) {
+          val = null;
+        } else {
+          val = val.toFixed(1);
+        }
+      }
+      view.set('details.' + i, val);
     });
     var selectedMetric = this.get('controller.selectedMetric');
     if (selectedMetric) {
@@ -49,7 +69,11 @@ App.MainChartsHeatmapHostView = Em.View.extend({
           if (metricName == 'Garbage Collection Time') {
             value = date.timingFormat(parseInt(value));
           } else {
-            value = value + selectedMetric.get('units');
+            if (isNaN(value)) {
+              value = this.t('charts.heatmap.unknown');
+            } else {
+              value = value + selectedMetric.get('units');
+            }
           }
         }
         view.set('details.metricName', metricName);