You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ma...@apache.org on 2013/02/04 03:24:02 UTC

svn commit: r1442010 [28/29] - in /incubator/ambari/branches/branch-1.2: ./ ambari-agent/ ambari-agent/conf/unix/ ambari-agent/src/examples/ ambari-agent/src/main/puppet/modules/hdp-ganglia/files/ ambari-agent/src/main/puppet/modules/hdp-ganglia/manife...

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/details.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/details.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/details.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/details.js Mon Feb  4 02:23:55 2013
@@ -17,6 +17,7 @@
  */
 
 var App = require('app');
+var date = require('utils/date');
 
 App.MainHostDetailsView = Em.View.extend({
   templateName: require('templates/main/host/details'),
@@ -28,5 +29,34 @@ App.MainHostDetailsView = Em.View.extend
   maintenance: function(){
     var options = [{action: 'deleteHost', 'label': 'Delete Host'}];
     return options;
-  }.property('controller.content')
+  }.property('controller.content'),
+
+  healthToolTip: function(){
+    var hostComponents = this.get('content.hostComponents').filter(function(item){
+      if(item.get('workStatus') !== App.HostComponentStatus.started){
+        return true;
+      }
+    });
+    var output = '';
+    switch (this.get('content.healthClass')){
+      case 'health-status-DEAD':
+        hostComponents = hostComponents.filterProperty('isMaster', true);
+        output = Em.I18n.t('hosts.host.healthStatus.mastersDown');
+        hostComponents.forEach(function(hc, index){
+          output += (index == (hostComponents.length-1)) ? hc.get('displayName') : (hc.get('displayName')+", ");
+        }, this);
+        break;
+      case 'health-status-DEAD-YELLOW':
+        output = Em.I18n.t('hosts.host.healthStatus.heartBeatNotReceived');
+        break;
+      case 'health-status-DEAD-ORANGE':
+        hostComponents = hostComponents.filterProperty('isSlave', true);
+        output = Em.I18n.t('hosts.host.healthStatus.slavesDown');
+        hostComponents.forEach(function(hc, index){
+          output += (index == (hostComponents.length-1)) ? hc.get('displayName') : (hc.get('displayName')+", ");
+        }, this);
+        break;
+    }
+    return output;
+  }.property('content.healthClass')
 });

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/cpu.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/cpu.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/cpu.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/cpu.js Mon Feb  4 02:23:55 2013
@@ -33,11 +33,14 @@ App.ChartHostMetricsCPU = App.ChartLinea
 
 
   url: function () {
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/hosts/{hostName}?fields=metrics/cpu/cpu_user[{fromSeconds},{toSeconds},{stepSeconds}],metrics/cpu/cpu_wio[{fromSeconds},{toSeconds},{stepSeconds}],metrics/cpu/cpu_nice[{fromSeconds},{toSeconds},{stepSeconds}],metrics/cpu/cpu_aidle[{fromSeconds},{toSeconds},{stepSeconds}],metrics/cpu/cpu_system[{fromSeconds},{toSeconds},{stepSeconds}],metrics/cpu/cpu_idle[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName'),
-      hostName: this.get('content').get('hostName')
-    }, "/data/hosts/metrics/cpu.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/hosts/{hostName}?fields=metrics/cpu/cpu_user[{fromSeconds},{toSeconds},{stepSeconds}],metrics/cpu/cpu_wio[{fromSeconds},{toSeconds},{stepSeconds}],metrics/cpu/cpu_nice[{fromSeconds},{toSeconds},{stepSeconds}],metrics/cpu/cpu_aidle[{fromSeconds},{toSeconds},{stepSeconds}],metrics/cpu/cpu_system[{fromSeconds},{toSeconds},{stepSeconds}],metrics/cpu/cpu_idle[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {
+        hostName: this.get('content').get('hostName')
+      },
+      "/data/hosts/metrics/cpu.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -69,25 +72,12 @@ App.ChartHostMetricsCPU = App.ChartLinea
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          if (name != 'cpu_idle') {
-            seriesArray.push(series);
+          var s = this.transformData(seriesData, displayName);
+          if ('CPU Idle' == s.name) {
+            cpu_idle = s;
           }
           else {
-            cpu_idle = series;
+            seriesArray.push(s);
           }
         }
       }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/disk.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/disk.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/disk.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/disk.js Mon Feb  4 02:23:55 2013
@@ -32,14 +32,18 @@ App.ChartHostMetricsDisk = App.ChartLine
   yAxisFormatter: App.ChartLinearTimeView.BytesFormatter,
   renderer: 'line',
   url: function () {
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/hosts/{hostName}?fields=metrics/disk/disk_total[{fromSeconds},{toSeconds},{stepSeconds}],metrics/disk/disk_free[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName'),
-      hostName: this.get('content').get('hostName')
-    }, "/data/hosts/metrics/disk.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/hosts/{hostName}?fields=metrics/disk/disk_total[{fromSeconds},{toSeconds},{stepSeconds}],metrics/disk/disk_free[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {
+        hostName: this.get('content').get('hostName')
+      },
+      "/data/hosts/metrics/disk.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
+    var GB = Math.pow(2, 30);
     if (jsonData && jsonData.metrics && jsonData.metrics.disk) {
       if(jsonData.metrics.part_max_used){
         jsonData.metrics.disk.part_max_used = jsonData.metrics.part_max_used;
@@ -58,22 +62,11 @@ App.ChartHostMetricsDisk = App.ChartLine
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
+          var s = this.transformData(seriesData, displayName);
+          for (var i = 0; i < s.data.length; i++) {
+            s.data[i].y *= GB;
           }
-          // We have valid data
-          var GB = Math.pow(2, 30);
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0] * GB
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(s);
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/load.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/load.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/load.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/load.js Mon Feb  4 02:23:55 2013
@@ -31,11 +31,14 @@ App.ChartHostMetricsLoad = App.ChartLine
   title: "Load",
   renderer: 'line',
   url: function () {
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/hosts/{hostName}?fields=metrics/load/load_fifteen[{fromSeconds},{toSeconds},{stepSeconds}],metrics/load/load_one[{fromSeconds},{toSeconds},{stepSeconds}],metrics/load/load_five[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName'),
-      hostName: this.get('content').get('hostName')
-    }, "/data/hosts/metrics/load.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/hosts/{hostName}?fields=metrics/load/load_fifteen[{fromSeconds},{toSeconds},{stepSeconds}],metrics/load/load_one[{fromSeconds},{toSeconds},{stepSeconds}],metrics/load/load_five[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {
+        hostName: this.get('content').get('hostName')
+      },
+      "/data/hosts/metrics/load.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -57,21 +60,7 @@ App.ChartHostMetricsLoad = App.ChartLine
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/memory.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/memory.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/memory.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/memory.js Mon Feb  4 02:23:55 2013
@@ -32,14 +32,19 @@ App.ChartHostMetricsMemory = App.ChartLi
   yAxisFormatter: App.ChartLinearTimeView.BytesFormatter,
   renderer: 'line',
   url: function () {
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/hosts/{hostName}?fields=metrics/memory/swap_free[{fromSeconds},{toSeconds},{stepSeconds}],metrics/memory/mem_shared[{fromSeconds},{toSeconds},{stepSeconds}],metrics/memory/mem_free[{fromSeconds},{toSeconds},{stepSeconds}],metrics/memory/mem_cached[{fromSeconds},{toSeconds},{stepSeconds}],metrics/memory/mem_buffers[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName'),
-      hostName: this.get('content').get('hostName')
-    }, "/data/hosts/metrics/memory.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/hosts/{hostName}?fields=metrics/memory/swap_free[{fromSeconds},{toSeconds},{stepSeconds}],metrics/memory/mem_shared[{fromSeconds},{toSeconds},{stepSeconds}],metrics/memory/mem_free[{fromSeconds},{toSeconds},{stepSeconds}],metrics/memory/mem_cached[{fromSeconds},{toSeconds},{stepSeconds}],metrics/memory/mem_buffers[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {
+        clusterName: this.get('clusterName'),
+        hostName: this.get('content').get('hostName')
+      },
+      "/data/hosts/metrics/memory.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
+    var KB = Math.pow(2, 10);
     if (jsonData && jsonData.metrics && jsonData.metrics.memory) {
       for ( var name in jsonData.metrics.memory) {
         var displayName;
@@ -64,22 +69,11 @@ App.ChartHostMetricsMemory = App.ChartLi
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
+          var s = this.transformData(seriesData, displayName);
+          for (var i = 0; i < s.data.length; i++) {
+            s.data[i].y *= KB;
           }
-          // We have valid data
-          var KB = Math.pow(2,10);
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0] * KB
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(s);
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/network.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/network.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/network.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/network.js Mon Feb  4 02:23:55 2013
@@ -32,11 +32,14 @@ App.ChartHostMetricsNetwork = App.ChartL
   yAxisFormatter: App.ChartLinearTimeView.BytesFormatter,
   renderer: 'line',
   url: function () {
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/hosts/{hostName}?fields=metrics/network/bytes_in[{fromSeconds},{toSeconds},{stepSeconds}],metrics/network/bytes_out[{fromSeconds},{toSeconds},{stepSeconds}],metrics/network/pkts_in[{fromSeconds},{toSeconds},{stepSeconds}],metrics/network/pkts_out[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName'),
-      hostName: this.get('content').get('hostName')
-    }, "/data/hosts/metrics/network.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/hosts/{hostName}?fields=metrics/network/bytes_in[{fromSeconds},{toSeconds},{stepSeconds}],metrics/network/bytes_out[{fromSeconds},{toSeconds},{stepSeconds}],metrics/network/pkts_in[{fromSeconds},{toSeconds},{stepSeconds}],metrics/network/pkts_out[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {
+        hostName: this.get('content').get('hostName')
+      },
+      "/data/hosts/metrics/network.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -61,21 +64,7 @@ App.ChartHostMetricsNetwork = App.ChartL
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/processes.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/processes.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/processes.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/metrics/processes.js Mon Feb  4 02:23:55 2013
@@ -31,11 +31,14 @@ App.ChartHostMetricsProcesses = App.Char
   title: "Processes",
   renderer: 'line',
   url: function () {
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/hosts/{hostName}?fields=metrics/process/proc_total[{fromSeconds},{toSeconds},{stepSeconds}],metrics/process/proc_run[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName'),
-      hostName: this.get('content').get('hostName')
-    }, "/data/hosts/metrics/processes.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/hosts/{hostName}?fields=metrics/process/proc_total[{fromSeconds},{toSeconds},{stepSeconds}],metrics/process/proc_run[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {
+        hostName: this.get('content').get('hostName')
+      },
+      "/data/hosts/metrics/processes.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -54,21 +57,7 @@ App.ChartHostMetricsProcesses = App.Char
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/summary.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/summary.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/summary.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/host/summary.js Mon Feb  4 02:23:55 2013
@@ -93,7 +93,7 @@ App.MainHostSummaryView = Em.View.extend
   sortedComponents: function() {
     var slaveComponents = [];
     var masterComponents = [];
-    this.get('content.components').forEach(function(component){
+    this.get('content.hostComponents').forEach(function(component){
       if(component.get('isMaster')){
         masterComponents.push(component);
       } else if(component.get('isSlave')) {
@@ -104,7 +104,7 @@ App.MainHostSummaryView = Em.View.extend
   }.property('content'),
   clients: function(){
     var clients = [];
-    this.get('content.components').forEach(function(component){
+    this.get('content.hostComponents').forEach(function(component){
       if(!component.get('componentName')){
         //temporary fix because of different data in hostComponents and serviceComponents
         return;
@@ -122,6 +122,11 @@ App.MainHostSummaryView = Em.View.extend
 
   ComponentView: Em.View.extend({
     content: null,
+    didInsertElement: function () {
+      if (this.get('isInProgress')) {
+        this.doBlinking();
+      }
+    },
     hostComponent: function(){
       var hostComponent = null;
       var serviceComponent = this.get('content');
@@ -138,7 +143,7 @@ App.MainHostSummaryView = Em.View.extend
         workStatus = hostComponent.get('workStatus');
       }
       return workStatus;
-    }.property('content.workStatus', 'hostComponent.workStatus'),
+    }.property('content.workStatus','hostComponent.workStatus'),
     statusClass: function(){
       var statusClass = null;
       if(this.get('isDataNode')){
@@ -147,14 +152,14 @@ App.MainHostSummaryView = Em.View.extend
           return 'health-status-DEAD-ORANGE';
         }
       }
-      return 'health-status-' + App.Component.Status.getKeyName(this.get('workStatus'));
-    }.property('workStatus'),
+      return 'health-status-' + App.HostComponentStatus.getKeyName(this.get('workStatus'));
+    }.property('workStatus', 'isDataNodeRecommissionAvailable'),
     /**
      * Disable element while component is starting/stopping
      */
     disabledClass:function(){
       var workStatus = this.get('workStatus');
-      if([App.Component.Status.starting, App.Component.Status.stopping].contains(workStatus) ){
+      if([App.HostComponentStatus.starting, App.HostComponentStatus.stopping].contains(workStatus) ){
         return 'disabled';
       } else {
         return '';
@@ -166,7 +171,7 @@ App.MainHostSummaryView = Em.View.extend
     doBlinking : function(){
       var workStatus = this.get('workStatus');
       var self = this;
-      var pulsate = [ App.Component.Status.starting, App.Component.Status.stopping ].contains(workStatus);
+      var pulsate = [ App.HostComponentStatus.starting, App.HostComponentStatus.stopping ].contains(workStatus);
       if (!pulsate && this.get('isDataNode')) {
         var dataNodeComponent = this.get('content');
         if (dataNodeComponent)
@@ -182,11 +187,17 @@ App.MainHostSummaryView = Em.View.extend
      * Start blinking when host component is starting/stopping
      */
     startBlinking:function(){
+      this.$('.components-health').stop(true, true);
+      this.$('.components-health').css({opacity: 1.0});
       this.doBlinking();
     }.observes('workStatus'),
 
     isStart : function() {
-      return (this.get('workStatus') === App.Component.Status.started || this.get('workStatus') === App.Component.Status.starting);
+      return (this.get('workStatus') === App.HostComponentStatus.started || this.get('workStatus') === App.HostComponentStatus.starting);
+    }.property('workStatus'),
+
+    isInProgress : function() {
+      return (this.get('workStatus') === App.HostComponentStatus.stopping || this.get('workStatus') === App.HostComponentStatus.starting);
     }.property('workStatus'),
     /**
      * Shows whether we need to show Decommision/Recomission buttons

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/cluster_requests.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/cluster_requests.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/cluster_requests.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/cluster_requests.js Mon Feb  4 02:23:55 2013
@@ -31,10 +31,12 @@ App.ChartServiceMetricsHBASE_ClusterRequ
   title: "Cluster Requests",
 
   url: function () {
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/services/HBASE/components/HBASE_MASTER?fields=metrics/hbase/master/cluster_requests[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName')
-    }, "/data/services/metrics/hbase/cluster_requests.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/services/HBASE/components/HBASE_MASTER?fields=metrics/hbase/master/cluster_requests[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {},
+      "/data/services/metrics/hbase/cluster_requests.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -50,21 +52,7 @@ App.ChartServiceMetricsHBASE_ClusterRequ
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/hlog_split_size.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/hlog_split_size.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/hlog_split_size.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/hlog_split_size.js Mon Feb  4 02:23:55 2013
@@ -32,10 +32,12 @@ App.ChartServiceMetricsHBASE_HlogSplitSi
   yAxisFormatter: App.ChartLinearTimeView.BytesFormatter,
 
   url: function () {
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/services/HBASE/components/HBASE_MASTER?fields=metrics/hbase/master/splitSize_avg_time[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName')
-    }, "/data/services/metrics/hbase/hlog_split_size.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/services/HBASE/components/HBASE_MASTER?fields=metrics/hbase/master/splitSize_avg_time[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {},
+      "/data/services/metrics/hbase/hlog_split_size.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -51,21 +53,7 @@ App.ChartServiceMetricsHBASE_HlogSplitSi
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/hlog_split_time.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/hlog_split_time.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/hlog_split_time.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/hlog_split_time.js Mon Feb  4 02:23:55 2013
@@ -32,10 +32,12 @@ App.ChartServiceMetricsHBASE_HlogSplitTi
   yAxisFormatter: App.ChartLinearTimeView.TimeElapsedFormatter,
 
   url: function () {
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/services/HBASE/components/HBASE_MASTER?fields=metrics/hbase/master/splitTime_avg_time[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName')
-    }, "/data/services/metrics/hbase/hlog_split_time.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/services/HBASE/components/HBASE_MASTER?fields=metrics/hbase/master/splitTime_avg_time[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {},
+      "/data/services/metrics/hbase/hlog_split_time.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -51,21 +53,7 @@ App.ChartServiceMetricsHBASE_HlogSplitTi
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_queuesize.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_queuesize.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_queuesize.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_queuesize.js Mon Feb  4 02:23:55 2013
@@ -31,10 +31,12 @@ App.ChartServiceMetricsHBASE_RegionServe
   title: "RegionServer Queue Size",
   renderer: 'line',
   url: function () {
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/services/HBASE/components/HBASE_REGIONSERVER?fields=metrics/hbase/regionserver/flushQueueSize[{fromSeconds},{toSeconds},{stepSeconds}],metrics/hbase/regionserver/compactionQueueSize[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName')
-    }, "/data/services/metrics/hbase/regionserver_queuesize.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/services/HBASE/components/HBASE_REGIONSERVER?fields=metrics/hbase/regionserver/flushQueueSize[{fromSeconds},{toSeconds},{stepSeconds}],metrics/hbase/regionserver/compactionQueueSize[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {},
+      "/data/services/metrics/hbase/regionserver_queuesize.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -53,21 +55,7 @@ App.ChartServiceMetricsHBASE_RegionServe
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_regions.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_regions.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_regions.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_regions.js Mon Feb  4 02:23:55 2013
@@ -31,10 +31,12 @@ App.ChartServiceMetricsHBASE_RegionServe
   title: "RegionServer Regions",
 
   url: function () {
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/services/HBASE/components/HBASE_REGIONSERVER?fields=metrics/hbase/regionserver/regions[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName')
-    }, "/data/services/metrics/hbase/regionserver_regions.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/services/HBASE/components/HBASE_REGIONSERVER?fields=metrics/hbase/regionserver/regions[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {},
+      "/data/services/metrics/hbase/regionserver_regions.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -50,21 +52,7 @@ App.ChartServiceMetricsHBASE_RegionServe
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_rw_requests.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_rw_requests.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_rw_requests.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_rw_requests.js Mon Feb  4 02:23:55 2013
@@ -31,10 +31,12 @@ App.ChartServiceMetricsHBASE_RegionServe
   title: "RegionServer Requests",
   renderer: 'line',
   url: function () {
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/services/HBASE/components/HBASE_REGIONSERVER?fields=metrics/hbase/regionserver/readRequestsCount[{fromSeconds},{toSeconds},{stepSeconds}],metrics/hbase/regionserver/writeRequestsCount[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName')
-    }, "/data/services/metrics/hbase/regionserver_rw_requests.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/services/HBASE/components/HBASE_REGIONSERVER?fields=metrics/hbase/regionserver/readRequestsCount[{fromSeconds},{toSeconds},{stepSeconds}],metrics/hbase/regionserver/writeRequestsCount[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {},
+      "/data/services/metrics/hbase/regionserver_rw_requests.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -53,21 +55,7 @@ App.ChartServiceMetricsHBASE_RegionServe
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/block_status.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/block_status.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/block_status.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/block_status.js Mon Feb  4 02:23:55 2013
@@ -33,11 +33,14 @@ App.ChartServiceMetricsHDFS_BlockStatus 
   url: function () {
     var hdfsService = App.HDFSService.find().objectAt(0);
     var nameNodeHostName = hdfsService.get('nameNode').get('hostName');
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/hosts/{hostName}/host_components/NAMENODE?fields=metrics/dfs/FSNamesystem/PendingReplicationBlocks[{fromSeconds},{toSeconds},{stepSeconds}],metrics/dfs/FSNamesystem/UnderReplicatedBlocks[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName'),
-      hostName: nameNodeHostName
-    }, "/data/services/metrics/hdfs/block_status.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/hosts/{hostName}/host_components/NAMENODE?fields=metrics/dfs/FSNamesystem/PendingReplicationBlocks[{fromSeconds},{toSeconds},{stepSeconds}],metrics/dfs/FSNamesystem/UnderReplicatedBlocks[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {
+        hostName: nameNodeHostName
+      },
+      "/data/services/metrics/hdfs/block_status.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -56,21 +59,7 @@ App.ChartServiceMetricsHDFS_BlockStatus 
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/file_operations.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/file_operations.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/file_operations.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/file_operations.js Mon Feb  4 02:23:55 2013
@@ -33,11 +33,14 @@ App.ChartServiceMetricsHDFS_FileOperatio
   url: function () {
     var hdfsService = App.HDFSService.find().objectAt(0);
     var nameNodeHostName = hdfsService.get('nameNode').get('hostName');
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/hosts/{hostName}/host_components/NAMENODE?fields=metrics/dfs/namenode/FileInfoOps[{fromSeconds},{toSeconds},{stepSeconds}],metrics/dfs/namenode/CreateFileOps[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName'),
-      hostName: nameNodeHostName
-    }, "/data/services/metrics/hdfs/file_operations.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/hosts/{hostName}/host_components/NAMENODE?fields=metrics/dfs/namenode/FileInfoOps[{fromSeconds},{toSeconds},{stepSeconds}],metrics/dfs/namenode/CreateFileOps[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {
+        hostName: nameNodeHostName
+      },
+      "/data/services/metrics/hdfs/file_operations.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -59,21 +62,7 @@ App.ChartServiceMetricsHDFS_FileOperatio
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/gc.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/gc.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/gc.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/gc.js Mon Feb  4 02:23:55 2013
@@ -34,11 +34,14 @@ App.ChartServiceMetricsHDFS_GC = App.Cha
   url: function () {
     var hdfsService = App.HDFSService.find().objectAt(0);
     var nameNodeHostName = hdfsService.get('nameNode').get('hostName');
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/hosts/{hostName}/host_components/NAMENODE?fields=metrics/jvm/gcTimeMillis[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName'),
-      hostName: nameNodeHostName
-    }, "/data/services/metrics/hdfs/gc.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/hosts/{hostName}/host_components/NAMENODE?fields=metrics/jvm/gcTimeMillis[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {
+        hostName: nameNodeHostName
+      },
+      "/data/services/metrics/hdfs/gc.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -54,21 +57,7 @@ App.ChartServiceMetricsHDFS_GC = App.Cha
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/io.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/io.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/io.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/io.js Mon Feb  4 02:23:55 2013
@@ -32,10 +32,12 @@ App.ChartServiceMetricsHDFS_IO = App.Cha
   yAxisFormatter: App.ChartLinearTimeView.BytesFormatter,
   renderer: 'line',
   url: function () {
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/services/HDFS/components/DATANODE?fields=metrics/dfs/datanode/bytes_written[{fromSeconds},{toSeconds},{stepSeconds}],metrics/dfs/datanode/bytes_read[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName')
-    }, "/data/services/metrics/hdfs/io.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/services/HDFS/components/DATANODE?fields=metrics/dfs/datanode/bytes_written[{fromSeconds},{toSeconds},{stepSeconds}],metrics/dfs/datanode/bytes_read[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {},
+      "/data/services/metrics/hdfs/io.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -54,21 +56,7 @@ App.ChartServiceMetricsHDFS_IO = App.Cha
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_heap.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_heap.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_heap.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_heap.js Mon Feb  4 02:23:55 2013
@@ -34,14 +34,18 @@ App.ChartServiceMetricsHDFS_JVMHeap = Ap
   url: function () {
     var hdfsService = App.HDFSService.find().objectAt(0);
     var nameNodeHostName = hdfsService.get('nameNode').get('hostName');
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/hosts/{hostName}/host_components/NAMENODE?fields=metrics/jvm/memNonHeapUsedM[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/memNonHeapCommittedM[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/memHeapUsedM[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/memHeapCommittedM[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName'),
-      hostName: nameNodeHostName
-    }, "/data/services/metrics/hdfs/jvm_heap.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/hosts/{hostName}/host_components/NAMENODE?fields=metrics/jvm/memNonHeapUsedM[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/memNonHeapCommittedM[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/memHeapUsedM[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/memHeapCommittedM[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {
+        hostName: nameNodeHostName
+      },
+      "/data/services/metrics/hdfs/jvm_heap.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
+    var MB = Math.pow(2, 20);
     if (jsonData && jsonData.metrics && jsonData.metrics.jvm) {
       for ( var name in jsonData.metrics.jvm) {
         var displayName;
@@ -63,23 +67,11 @@ App.ChartServiceMetricsHDFS_JVMHeap = Ap
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
+          var s = this.transformData(seriesData, displayName);
+          for (var i = 0; i < s.data.length; i++) {
+            s.data[i].y *= MB;
           }
-          // We have valid data
-          var MB = Math.pow(2,20);
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0] * MB
-            // Data is in MB
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(s);
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_threads.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_threads.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_threads.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_threads.js Mon Feb  4 02:23:55 2013
@@ -33,11 +33,14 @@ App.ChartServiceMetricsHDFS_JVMThreads =
   url: function () {
     var hdfsService = App.HDFSService.find().objectAt(0);
     var nameNodeHostName = hdfsService.get('nameNode').get('hostName');
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/hosts/{hostName}/host_components/NAMENODE?fields=metrics/jvm/threadsRunnable[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/threadsBlocked[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/threadsWaiting[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/threadsTimedWaiting[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName'),
-      hostName: nameNodeHostName
-    }, "/data/services/metrics/hdfs/jvm_threads.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/hosts/{hostName}/host_components/NAMENODE?fields=metrics/jvm/threadsRunnable[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/threadsBlocked[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/threadsWaiting[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/threadsTimedWaiting[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {
+        hostName: nameNodeHostName
+      },
+      "/data/services/metrics/hdfs/jvm_threads.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -62,21 +65,7 @@ App.ChartServiceMetricsHDFS_JVMThreads =
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/rpc.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/rpc.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/rpc.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/rpc.js Mon Feb  4 02:23:55 2013
@@ -34,11 +34,14 @@ App.ChartServiceMetricsHDFS_RPC = App.Ch
   url: function () {
     var hdfsService = App.HDFSService.find().objectAt(0);
     var nameNodeHostName = hdfsService.get('nameNode').get('hostName');
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/hosts/{hostName}/host_components/NAMENODE?fields=metrics/rpc/RpcQueueTime_avg_time[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName'),
-      hostName: nameNodeHostName
-    }, "/data/services/metrics/hdfs/rpc.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/hosts/{hostName}/host_components/NAMENODE?fields=metrics/rpc/RpcQueueTime_avg_time[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {
+        hostName: nameNodeHostName
+      },
+      "/data/services/metrics/hdfs/rpc.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -54,21 +57,7 @@ App.ChartServiceMetricsHDFS_RPC = App.Ch
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/space_utilization.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/space_utilization.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/space_utilization.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/hdfs/space_utilization.js Mon Feb  4 02:23:55 2013
@@ -34,14 +34,18 @@ App.ChartServiceMetricsHDFS_SpaceUtiliza
   url: function () {
     var hdfsService = App.HDFSService.find().objectAt(0);
     var nameNodeHostName = hdfsService.get('nameNode').get('hostName');
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/hosts/{hostName}/host_components/NAMENODE?fields=metrics/dfs/FSNamesystem/CapacityRemainingGB[{fromSeconds},{toSeconds},{stepSeconds}],metrics/dfs/FSNamesystem/CapacityUsedGB[{fromSeconds},{toSeconds},{stepSeconds}],metrics/dfs/FSNamesystem/CapacityTotalGB[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName'),
-      hostName: nameNodeHostName
-    }, "/data/services/metrics/hdfs/space_utilization.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/hosts/{hostName}/host_components/NAMENODE?fields=metrics/dfs/FSNamesystem/CapacityRemainingGB[{fromSeconds},{toSeconds},{stepSeconds}],metrics/dfs/FSNamesystem/CapacityUsedGB[{fromSeconds},{toSeconds},{stepSeconds}],metrics/dfs/FSNamesystem/CapacityTotalGB[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {
+        hostName: nameNodeHostName
+      },
+      "/data/services/metrics/hdfs/space_utilization.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
+    var GB = Math.pow(2, 30);
     if (jsonData && jsonData.metrics && jsonData.metrics.dfs && jsonData.metrics.dfs.FSNamesystem) {
       for ( var name in jsonData.metrics.dfs.FSNamesystem) {
         var displayName;
@@ -60,22 +64,11 @@ App.ChartServiceMetricsHDFS_SpaceUtiliza
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
+          var s = this.transformData(seriesData, displayName);
+          for (var i = 0; i < s.data.length; i++) {
+            s.data[i].y *= GB;
           }
-          // We have valid data
-          var GB = Math.pow(2,30);
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]*GB
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(s);
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/gc.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/gc.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/gc.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/gc.js Mon Feb  4 02:23:55 2013
@@ -34,11 +34,14 @@ App.ChartServiceMetricsMapReduce_GC = Ap
   url: function () {
     var mrService = App.MapReduceService.find().objectAt(0);
     var jtHostName = mrService.get('jobTracker').get('hostName');
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/hosts/{hostName}/host_components/JOBTRACKER?fields=metrics/jvm/gcTimeMillis[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName'),
-      hostName: jtHostName
-    }, "/data/services/metrics/mapreduce/gc.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/hosts/{hostName}/host_components/JOBTRACKER?fields=metrics/jvm/gcTimeMillis[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {
+        hostName: jtHostName
+      },
+      "/data/services/metrics/mapreduce/gc.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -54,21 +57,7 @@ App.ChartServiceMetricsMapReduce_GC = Ap
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/jobs_status.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/jobs_status.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/jobs_status.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/jobs_status.js Mon Feb  4 02:23:55 2013
@@ -31,10 +31,12 @@ App.ChartServiceMetricsMapReduce_JobsSta
   title: "Jobs Status",
   renderer: 'line',
   url: function () {
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/services/MAPREDUCE/components/JOBTRACKER?fields=metrics/mapred/jobtracker/jobs_completed[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/jobs_preparing[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/jobs_failed[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/jobs_submitted[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/jobs_failed[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/jobs_running[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName')
-    }, "/data/services/metrics/mapreduce/jobs_status.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/services/MAPREDUCE/components/JOBTRACKER?fields=metrics/mapred/jobtracker/jobs_completed[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/jobs_preparing[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/jobs_failed[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/jobs_submitted[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/jobs_failed[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/jobs_running[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {},
+      "/data/services/metrics/mapreduce/jobs_status.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -62,21 +64,7 @@ App.ChartServiceMetricsMapReduce_JobsSta
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_heap.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_heap.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_heap.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_heap.js Mon Feb  4 02:23:55 2013
@@ -34,14 +34,18 @@ App.ChartServiceMetricsMapReduce_JVMHeap
   url: function () {
     var mrService = App.MapReduceService.find().objectAt(0);
     var jtHostName = mrService.get('jobTracker').get('hostName');
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/hosts/{hostName}/host_components/JOBTRACKER?fields=metrics/jvm/memNonHeapUsedM[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/memNonHeapCommittedM[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/memHeapUsedM[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/memHeapCommittedM[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName'),
-      hostName: jtHostName
-    }, "/data/services/metrics/mapreduce/jvm_heap.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/hosts/{hostName}/host_components/JOBTRACKER?fields=metrics/jvm/memNonHeapUsedM[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/memNonHeapCommittedM[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/memHeapUsedM[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/memHeapCommittedM[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {
+        hostName: jtHostName
+      },
+      "/data/services/metrics/mapreduce/jvm_heap.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
+    var MB = Math.pow(2, 20);
     if (jsonData && jsonData.metrics && jsonData.metrics.jvm) {
       for ( var name in jsonData.metrics.jvm) {
         var displayName;
@@ -63,23 +67,11 @@ App.ChartServiceMetricsMapReduce_JVMHeap
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
+          var s = this.transformData(seriesData, displayName);
+          for (var i = 0; i < s.data.length; i++) {
+            s.data[i].y *= MB;
           }
-          // We have valid data
-          var MB = Math.pow(2, 20);
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0] * MB
-            // Data is in MB
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(s);
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_threads.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_threads.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_threads.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_threads.js Mon Feb  4 02:23:55 2013
@@ -33,11 +33,14 @@ App.ChartServiceMetricsMapReduce_JVMThre
   url: function () {
     var mrService = App.MapReduceService.find().objectAt(0);
     var jtHostName = mrService.get('jobTracker').get('hostName');
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/hosts/{hostName}/host_components/JOBTRACKER?fields=metrics/jvm/threadsRunnable[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/threadsBlocked[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/threadsWaiting[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/threadsTimedWaiting[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName'),
-      hostName: jtHostName
-    }, "/data/services/metrics/mapreduce/jvm_threads.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/hosts/{hostName}/host_components/JOBTRACKER?fields=metrics/jvm/threadsRunnable[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/threadsBlocked[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/threadsWaiting[{fromSeconds},{toSeconds},{stepSeconds}],metrics/jvm/threadsTimedWaiting[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {
+        hostName: jtHostName
+      },
+      "/data/services/metrics/mapreduce/jvm_threads.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -61,22 +64,9 @@ App.ChartServiceMetricsMapReduce_JVMThre
           default:
             break;
         }
+
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/map_slots.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/map_slots.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/map_slots.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/map_slots.js Mon Feb  4 02:23:55 2013
@@ -31,10 +31,12 @@ App.ChartServiceMetricsMapReduce_MapSlot
   title: "Map Slots Utilization",
   renderer: 'line',
   url: function () {
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/services/MAPREDUCE/components/JOBTRACKER?fields=metrics/mapred/jobtracker/occupied_map_slots[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/reserved_map_slots[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName')
-    }, "/data/services/metrics/mapreduce/map_slots.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/services/MAPREDUCE/components/JOBTRACKER?fields=metrics/mapred/jobtracker/occupied_map_slots[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/reserved_map_slots[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {},
+      "/data/services/metrics/mapreduce/map_slots.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -53,21 +55,7 @@ App.ChartServiceMetricsMapReduce_MapSlot
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/reduce_slots.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/reduce_slots.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/reduce_slots.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/reduce_slots.js Mon Feb  4 02:23:55 2013
@@ -31,10 +31,12 @@ App.ChartServiceMetricsMapReduce_ReduceS
   title: "Reduce Slots Utilization",
   renderer: 'line',
   url: function () {
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/services/MAPREDUCE/components/JOBTRACKER?fields=metrics/mapred/jobtracker/occupied_reduce_slots[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/reserved_reduce_slots[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName')
-    }, "/data/services/metrics/mapreduce/reduce_slots.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/services/MAPREDUCE/components/JOBTRACKER?fields=metrics/mapred/jobtracker/occupied_reduce_slots[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/reserved_reduce_slots[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {},
+      "/data/services/metrics/mapreduce/reduce_slots.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -53,21 +55,7 @@ App.ChartServiceMetricsMapReduce_ReduceS
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/rpc.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/rpc.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/rpc.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/rpc.js Mon Feb  4 02:23:55 2013
@@ -34,11 +34,14 @@ App.ChartServiceMetricsMapReduce_RPC = A
   url: function () {
     var mrService = App.MapReduceService.find().objectAt(0);
     var jtHostName = mrService.get('jobTracker').get('hostName');
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/hosts/{hostName}/host_components/JOBTRACKER?fields=metrics/rpc/RpcQueueTime_avg_time[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName'),
-      hostName: jtHostName
-    }, "/data/services/metrics/mapreduce/rpc.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/hosts/{hostName}/host_components/JOBTRACKER?fields=metrics/rpc/RpcQueueTime_avg_time[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {
+        hostName: jtHostName
+      },
+      "/data/services/metrics/mapreduce/rpc.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -54,21 +57,7 @@ App.ChartServiceMetricsMapReduce_RPC = A
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/tasks_running_waiting.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/tasks_running_waiting.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/tasks_running_waiting.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/metrics/mapreduce/tasks_running_waiting.js Mon Feb  4 02:23:55 2013
@@ -31,10 +31,12 @@ App.ChartServiceMetricsMapReduce_TasksRu
   title: "Tasks (Running/Waiting)",
   renderer: 'line',
   url: function () {
-    return App.formatUrl(App.apiPrefix + "/clusters/{clusterName}/services/MAPREDUCE/components/JOBTRACKER?fields=metrics/mapred/jobtracker/running_maps[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/running_reduces[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/waiting_maps[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/waiting_reduces[{fromSeconds},{toSeconds},{stepSeconds}]", {
-      clusterName: App.router.get('clusterController.clusterName')
-    }, "/data/services/metrics/mapreduce/tasks_running_waiting.json");
-  }.property('App.router.clusterController.clusterName').volatile(),
+    return App.formatUrl(
+      this.get('urlPrefix') + "/services/MAPREDUCE/components/JOBTRACKER?fields=metrics/mapred/jobtracker/running_maps[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/running_reduces[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/waiting_maps[{fromSeconds},{toSeconds},{stepSeconds}],metrics/mapred/jobtracker/waiting_reduces[{fromSeconds},{toSeconds},{stepSeconds}]",
+      {},
+      "/data/services/metrics/mapreduce/tasks_running_waiting.json"
+    );
+  }.property('clusterName').volatile(),
 
   transformToSeries: function (jsonData) {
     var seriesArray = [];
@@ -59,21 +61,7 @@ App.ChartServiceMetricsMapReduce_TasksRu
             break;
         }
         if (seriesData) {
-          // Is it a string?
-          if ("string" == typeof seriesData) {
-            seriesData = JSON.parse(seriesData);
-          }
-          // We have valid data
-          var series = {};
-          series.name = displayName;
-          series.data = [];
-          for ( var index = 0; index < seriesData.length; index++) {
-            series.data.push({
-              x: seriesData[index][1],
-              y: seriesData[index][0]
-            });
-          }
-          seriesArray.push(series);
+          seriesArray.push(this.transformData(seriesData, displayName));
         }
       }
     }

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/summary.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/summary.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/summary.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/main/service/info/summary.js Mon Feb  4 02:23:55 2013
@@ -49,32 +49,9 @@ App.MainServiceInfoSummaryView = Em.View
     var result = [];
     var service = this.get('controller.content');
     if (service.get("id") == "OOZIE" || service.get("id") == "ZOOKEEPER") {
-      var clients = service.get('hostComponents').filterProperty('isClient');
-      if (clients.length > 0) {
-        result = [{
-          'displayName': clients[0].get('displayName'),
-          'isComma': false,
-          'isAnd': false
-        }];
-      }
-      if (clients.length > 1) {
-        result[0].isComma = true;
-        result.push({
-          'displayName': clients[1].get('displayName'),
-          'isComma': false,
-          'isAnd': false
-        });
-      }
-      if (clients.length > 2) {
-        result[1].isAnd = true;
-        result.push({
-          'displayName': clients.length - 2 + ' more',
-          'isComma': false,
-          'isAnd': false
-        });
-      }
+      return service.get('hostComponents').filterProperty('isClient');
     }
-    return result;
+    return [];
   }.property('controller.content'),
 
   hasManyServers: function () {
@@ -142,7 +119,7 @@ App.MainServiceInfoSummaryView = Em.View
   monitorsObj: function(){
     var service = this.get('controller.content');
     if (service.get("id") == "GANGLIA") {
-      var monitors = service.get('components').filterProperty('isMaster', false);
+      var monitors = service.get('hostComponents').filterProperty('isMaster', false);
       if (monitors.length) {
         return monitors[0];
       }
@@ -157,7 +134,7 @@ App.MainServiceInfoSummaryView = Em.View
   serversHost: function() {
     var service = this.get('controller.content');
     if (service.get("id") == "ZOOKEEPER") {
-      var servers = service.get('components').filterProperty('isMaster');
+      var servers = service.get('hostComponents').filterProperty('isMaster');
       if (servers.length > 0) {
         return servers[0];
       }
@@ -172,7 +149,7 @@ App.MainServiceInfoSummaryView = Em.View
   clientObj: function() {
     var service = this.get('controller.content');
     if (service.get("id") == "OOZIE" || service.get("id") == "ZOOKEEPER") {
-      var clients = service.get('components').filterProperty('isMaster', false);
+      var clients = service.get('hostComponents').filterProperty('isMaster', false);
       if (clients.length > 0) {
         return clients[0];
       }
@@ -190,7 +167,7 @@ App.MainServiceInfoSummaryView = Em.View
   gangliaServer:function(){
     var service=this.get('controller.content');
     if(service.get("id") == "GANGLIA"){
-      return service.get("components").findProperty('isMaster', true).get("host").get("publicHostName");
+      return service.get("hostComponents").findProperty('isMaster', true).get("host").get("publicHostName");
     }else{
       return "";
     }
@@ -198,7 +175,7 @@ App.MainServiceInfoSummaryView = Em.View
   nagiosServer:function(){
     var service=this.get('controller.content');
     if(service.get("id") == "NAGIOS"){
-      return service.get("components").findProperty('isMaster', true).get("host").get("publicHostName");
+      return service.get("hostComponents").findProperty('isMaster', true).get("host").get("publicHostName");
     }else{
       return "";
     }
@@ -206,7 +183,7 @@ App.MainServiceInfoSummaryView = Em.View
   oozieServer:function(){
     var service=this.get('controller.content');
     if(service.get("id") == "OOZIE"){
-      return service.get("components").findProperty('isMaster', true).get("host").get("publicHostName");
+      return service.get("hostComponents").findProperty('isMaster', true).get("host").get("publicHostName");
     }else{
       return "";
     }
@@ -224,7 +201,7 @@ App.MainServiceInfoSummaryView = Em.View
     var service=this.get('controller.content');
     if(service.get("id") == "HIVE"){
       var self = this;
-      var components = service.get("components");
+      var components = service.get("hostComponents");
       if(components){
         components.forEach(function(component){
           var ci = {
@@ -321,7 +298,7 @@ App.MainServiceInfoSummaryView = Em.View
       }
     }
     return graphs;
-  }.property('service'),
+  }.property(''),
 
   loadServiceSummary:function (serviceName) {
 

Modified: incubator/ambari/branches/branch-1.2/ambari-web/app/views/wizard/controls_view.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2/ambari-web/app/views/wizard/controls_view.js?rev=1442010&r1=1442009&r2=1442010&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.2/ambari-web/app/views/wizard/controls_view.js (original)
+++ incubator/ambari/branches/branch-1.2/ambari-web/app/views/wizard/controls_view.js Mon Feb  4 02:23:55 2013
@@ -117,7 +117,7 @@ App.ServiceConfigTextArea = Ember.TextAr
 
   valueBinding: 'serviceConfig.value',
   rows: 4,
-  classNames: ['span6'],
+  classNames: ['span6', 'directories'],
   placeholderBinding: 'serviceConfig.defaultValue',
 
   disabled: function () {