ソースを参照

AMBARI-10073. Get all host cpu metrics query made every 10 seconds from dashboard page. (jaimin)

Jaimin Jetly 10 年 前
コミット
0082ca1aa7

+ 7 - 3
ambari-web/app/views/main/dashboard/widgets/namenode_cpu.js

@@ -42,9 +42,13 @@ App.NameNodeCpuPieChartView = App.PieChartDashboardWidgetView.extend({
     }else{
      this.set('nnHostName', this.get('model').get('nameNode.hostName'));
     }
-    this.getValue();
-    intervalId = setInterval(function() {self.getValue()}, App.componentsUpdateInterval);
-    this.set('intervalId', intervalId);
+    if (this.get('nnHostName')) {
+      this.getValue();
+      intervalId = setInterval(function () {
+        self.getValue()
+      }, App.componentsUpdateInterval);
+      this.set('intervalId', intervalId);
+    }
   },
 
   getValue: function () {