You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2014/06/26 17:54:14 UTC

git commit: AMBARI-6072. Cpu usage widget stuck in loading when data is corrupted. Additional patch (alexantonenko)

Repository: ambari
Updated Branches:
  refs/heads/branch-1.6.1 548422b2e -> 87cd5491f


AMBARI-6072. Cpu usage widget stuck in loading when data is corrupted. Additional patch (alexantonenko)


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

Branch: refs/heads/branch-1.6.1
Commit: 87cd5491fd866a71b35f535eab9cd711cefc1224
Parents: 548422b
Author: Alex Antonenko <hi...@gmail.com>
Authored: Thu Jun 26 18:54:01 2014 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Thu Jun 26 18:54:01 2014 +0300

----------------------------------------------------------------------
 .../app/views/main/dashboard/cluster_metrics/cpu.js   | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/87cd5491/ambari-web/app/views/main/dashboard/cluster_metrics/cpu.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/dashboard/cluster_metrics/cpu.js b/ambari-web/app/views/main/dashboard/cluster_metrics/cpu.js
index f15d2e7..1b372d9 100644
--- a/ambari-web/app/views/main/dashboard/cluster_metrics/cpu.js
+++ b/ambari-web/app/views/main/dashboard/cluster_metrics/cpu.js
@@ -36,14 +36,24 @@ App.ChartClusterMetricsCPU = App.ChartLinearTimeView.extend({
   isTimePagingDisable: true,
   transformToSeries: function (jsonData) {
     var seriesArray = [];
+    var idle = null;
+
     if (jsonData && jsonData.metrics && jsonData.metrics.cpu) {
-      for ( var name in jsonData.metrics.cpu) {
+      for (var name in jsonData.metrics.cpu) {
         var seriesData = jsonData.metrics.cpu[name];
         if (seriesData) {
           var s = this.transformData(seriesData, name);
+          if (name === 'Idle') {
+            //CPU idle metric should be the last in series array
+            idle = s;
+            continue;
+          }
           seriesArray.push(s);
         }
       }
+      if (idle) {
+        seriesArray.push(idle);
+      }
     }
     return seriesArray;
   },
@@ -54,4 +64,4 @@ App.ChartClusterMetricsCPU = App.ChartLinearTimeView.extend({
     }
     return null;
   }
-});
\ No newline at end of file
+});