You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2012/12/09 12:57:40 UTC

svn commit: r1418896 - in /incubator/ambari/branches/AMBARI-666/ambari-web/app: ./ assets/data/dashboard/ controllers/ utils/ views/common/chart/ views/main/host/metrics/ views/main/service/info/metrics/hbase/ views/main/service/info/metrics/hdfs/ view...

Author: yusaku
Date: Sun Dec  9 11:57:37 2012
New Revision: 1418896

URL: http://svn.apache.org/viewvc?rev=1418896&view=rev
Log:
AMBARI-976. Hook HDFS/MapReduce/HBase/Host graphs to backend API. (Srimanth Gunturi via yusaku)

Modified:
    incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/data/dashboard/services.json
    incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/initialize.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/helper.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/common/chart/linear_time.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/cpu.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/disk.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/load.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/memory.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/network.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/processes.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/cluster_requests.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/hlog_split_size.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/hlog_split_time.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_queuesize.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_regions.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_rw_requests.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/file_operations.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/gc.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/io.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_heap.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_threads.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/rpc.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/gc.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jobs_running_waiting.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jobs_status.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_heap.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_threads.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/map_slots.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/reduce_slots.js
    incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/rpc.js

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/data/dashboard/services.json
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/data/dashboard/services.json?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/data/dashboard/services.json (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/assets/data/dashboard/services.json Sun Dec  9 11:57:37 2012
@@ -1,15 +1,15 @@
 {
-  "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=components/host_components/*",
+  "href" : "http://ambari/api/clusters/mycluster/services?ServiceInfo/service_name!=MISCELLANEOUS&ServiceInfo/service_name!=DASHBOARD&fields=components/host_components/*",
   "items" : [
     {
-      "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/services/MAPREDUCE",
+      "href" : "http://ambari/api/clusters/mycluster/services/MAPREDUCE",
       "ServiceInfo" : {
         "cluster_name" : "mycluster",
         "service_name" : "MAPREDUCE"
       },
       "components" : [
         {
-          "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/services/MAPREDUCE/components/MAPREDUCE_CLIENT",
+          "href" : "http://ambari/api/clusters/mycluster/services/MAPREDUCE/components/MAPREDUCE_CLIENT",
           "ServiceComponentInfo" : {
             "cluster_name" : "mycluster",
             "component_name" : "MAPREDUCE_CLIENT",
@@ -17,7 +17,7 @@
           },
           "host_components" : [
             {
-              "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/MAPREDUCE_CLIENT",
+              "href" : "http://ambari/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/MAPREDUCE_CLIENT",
               "HostRoles" : {
                 "cluster_name" : "mycluster",
                 "state" : "INSTALLED",
@@ -26,7 +26,7 @@
               },
               "component" : [
                 {
-                  "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/services/MAPREDUCE/components/MAPREDUCE_CLIENT",
+                  "href" : "http://ambari/api/clusters/mycluster/services/MAPREDUCE/components/MAPREDUCE_CLIENT",
                   "ServiceComponentInfo" : {
                     "cluster_name" : "mycluster",
                     "component_name" : "MAPREDUCE_CLIENT",
@@ -38,7 +38,7 @@
           ]
         },
         {
-          "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/services/MAPREDUCE/components/JOBTRACKER",
+          "href" : "http://ambari/api/clusters/mycluster/services/MAPREDUCE/components/JOBTRACKER",
           "ServiceComponentInfo" : {
             "cluster_name" : "mycluster",
             "component_name" : "JOBTRACKER",
@@ -46,7 +46,7 @@
           },
           "host_components" : [
             {
-              "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/JOBTRACKER",
+              "href" : "http://ambari/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/JOBTRACKER",
               "HostRoles" : {
                 "cluster_name" : "mycluster",
                 "state" : "STARTED",
@@ -108,7 +108,7 @@
               },
               "component" : [
                 {
-                  "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/services/MAPREDUCE/components/JOBTRACKER",
+                  "href" : "http://ambari/api/clusters/mycluster/services/MAPREDUCE/components/JOBTRACKER",
                   "ServiceComponentInfo" : {
                     "cluster_name" : "mycluster",
                     "component_name" : "JOBTRACKER",
@@ -120,7 +120,7 @@
           ]
         },
         {
-          "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/services/MAPREDUCE/components/TASKTRACKER",
+          "href" : "http://ambari/api/clusters/mycluster/services/MAPREDUCE/components/TASKTRACKER",
           "ServiceComponentInfo" : {
             "cluster_name" : "mycluster",
             "component_name" : "TASKTRACKER",
@@ -128,7 +128,7 @@
           },
           "host_components" : [
             {
-              "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/TASKTRACKER",
+              "href" : "http://ambari/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/TASKTRACKER",
               "HostRoles" : {
                 "cluster_name" : "mycluster",
                 "state" : "STARTED",
@@ -190,7 +190,7 @@
               },
               "component" : [
                 {
-                  "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/services/MAPREDUCE/components/TASKTRACKER",
+                  "href" : "http://ambari/api/clusters/mycluster/services/MAPREDUCE/components/TASKTRACKER",
                   "ServiceComponentInfo" : {
                     "cluster_name" : "mycluster",
                     "component_name" : "TASKTRACKER",
@@ -204,14 +204,14 @@
       ]
     },
     {
-      "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/services/HDFS",
+      "href" : "http://ambari/api/clusters/mycluster/services/HDFS",
       "ServiceInfo" : {
         "cluster_name" : "mycluster",
         "service_name" : "HDFS"
       },
       "components" : [
         {
-          "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/services/HDFS/components/SECONDARY_NAMENODE",
+          "href" : "http://ambari/api/clusters/mycluster/services/HDFS/components/SECONDARY_NAMENODE",
           "ServiceComponentInfo" : {
             "cluster_name" : "mycluster",
             "component_name" : "SECONDARY_NAMENODE",
@@ -219,7 +219,7 @@
           },
           "host_components" : [
             {
-              "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/SECONDARY_NAMENODE",
+              "href" : "http://ambari/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/SECONDARY_NAMENODE",
               "HostRoles" : {
                 "cluster_name" : "mycluster",
                 "state" : "STARTED",
@@ -228,7 +228,7 @@
               },
               "component" : [
                 {
-                  "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/services/HDFS/components/SECONDARY_NAMENODE",
+                  "href" : "http://ambari/api/clusters/mycluster/services/HDFS/components/SECONDARY_NAMENODE",
                   "ServiceComponentInfo" : {
                     "cluster_name" : "mycluster",
                     "component_name" : "SECONDARY_NAMENODE",
@@ -240,7 +240,7 @@
           ]
         },
         {
-          "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/services/HDFS/components/NAMENODE",
+          "href" : "http://ambari/api/clusters/mycluster/services/HDFS/components/NAMENODE",
           "ServiceComponentInfo" : {
             "cluster_name" : "mycluster",
             "component_name" : "NAMENODE",
@@ -248,7 +248,7 @@
           },
           "host_components" : [
             {
-              "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/NAMENODE",
+              "href" : "http://ambari/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/NAMENODE",
               "HostRoles" : {
                 "cluster_name" : "mycluster",
                 "state" : "STARTED",
@@ -331,7 +331,7 @@
               },
               "component" : [
                 {
-                  "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/services/HDFS/components/NAMENODE",
+                  "href" : "http://ambari/api/clusters/mycluster/services/HDFS/components/NAMENODE",
                   "ServiceComponentInfo" : {
                     "cluster_name" : "mycluster",
                     "component_name" : "NAMENODE",
@@ -343,7 +343,7 @@
           ]
         },
         {
-          "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/services/HDFS/components/DATANODE",
+          "href" : "http://ambari/api/clusters/mycluster/services/HDFS/components/DATANODE",
           "ServiceComponentInfo" : {
             "cluster_name" : "mycluster",
             "component_name" : "DATANODE",
@@ -351,7 +351,7 @@
           },
           "host_components" : [
             {
-              "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/DATANODE",
+              "href" : "http://ambari/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/DATANODE",
               "HostRoles" : {
                 "cluster_name" : "mycluster",
                 "state" : "STARTED",
@@ -413,7 +413,7 @@
               },
               "component" : [
                 {
-                  "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/services/HDFS/components/DATANODE",
+                  "href" : "http://ambari/api/clusters/mycluster/services/HDFS/components/DATANODE",
                   "ServiceComponentInfo" : {
                     "cluster_name" : "mycluster",
                     "component_name" : "DATANODE",
@@ -425,7 +425,7 @@
           ]
         },
         {
-          "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/services/HDFS/components/HDFS_CLIENT",
+          "href" : "http://ambari/api/clusters/mycluster/services/HDFS/components/HDFS_CLIENT",
           "ServiceComponentInfo" : {
             "cluster_name" : "mycluster",
             "component_name" : "HDFS_CLIENT",
@@ -433,7 +433,7 @@
           },
           "host_components" : [
             {
-              "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/HDFS_CLIENT",
+              "href" : "http://ambari/api/clusters/mycluster/hosts/dev.hortonworks.com/host_components/HDFS_CLIENT",
               "HostRoles" : {
                 "cluster_name" : "mycluster",
                 "state" : "INSTALLED",
@@ -442,7 +442,7 @@
               },
               "component" : [
                 {
-                  "href" : "http://dev.hortonworks.com:8080/api/clusters/mycluster/services/HDFS/components/HDFS_CLIENT",
+                  "href" : "http://ambari/api/clusters/mycluster/services/HDFS/components/HDFS_CLIENT",
                   "ServiceComponentInfo" : {
                     "cluster_name" : "mycluster",
                     "component_name" : "HDFS_CLIENT",

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/controllers/main.js Sun Dec  9 11:57:37 2012
@@ -26,7 +26,15 @@ App.MainController = Em.Controller.exten
   backgroundOperationsUrl : '',
   intervalId: false,
   updateOperationsInterval: 6000,
-
+  clusters: App.Cluster.find(),
+  cluster: function(){
+    var clusters = this.get('clusters');
+    if(clusters){
+      var cluster = clusters.objectAt(0);
+      return cluster;
+    }
+  }.property('clusters'),
+  
   startLoadOperationsPeriodically: function() {
     this.loadBackgroundOperations();
     this.intervalId = setInterval(this.loadBackgroundOperations, this.get('updateOperationsInterval'));

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/initialize.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/initialize.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/initialize.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/initialize.js Sun Dec  9 11:57:37 2012
@@ -19,8 +19,8 @@
 
 window.App = require('app');
 
-App.testMode = true;
-//App.testMode = false;
+App.testMode = false;
+//App.testMode = true;
 
 require('messages');
 require('utils/data_table');
@@ -38,6 +38,12 @@ require('utils/http_client');
 
 App.initialize();
 
+/**
+ * Test Mode values
+ */
+//App.Cluster.FIXTURES[0].cluster_name = 'vmc';
+//App.test_hostname = 'hostname';
+
 console.log('after initialize');
 console.log('TRACE: app.js-> localStorage:Ambari.authenticated=' + localStorage.getItem('Ambari' + 'authenticated'));
 console.log('TRACE: app.js-> localStorage:currentStep=' + localStorage.getItem(App.get('router').getLoginName() + 'Installer' + 'currentStep'));

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/helper.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/helper.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/helper.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/utils/helper.js Sun Dec  9 11:57:37 2012
@@ -86,4 +86,48 @@ Number.prototype.toDaysHoursMinutes = fu
 Number.prototype.countPercentageRatio = function (maxValue) {
   var usedValue = this;
   return Math.round((usedValue / maxValue) * 100) + "%";
+}
+
+/**
+ * Formats the given URL template by replacing keys in 'substitutes' 
+ * with their values. If not in App.testMode, the testUrl is used.
+ * 
+ * The substitution points in urlTemplate should be of format "...{key}..."
+ * For example "http://apache.org/{projectName}". 
+ * The substitutes can then be{projectName: "Ambari"}. 
+ * 
+ * Keys which will be automatically taken care of are:
+ * {
+ *  hostName: App.test_hostname,
+ *  fromSeconds: ..., // 1 hour back from now
+ *  toSeconds: ..., // now
+ *  stepSeconds: ..., // 15 seconds by default
+ * }
+ * 
+ * @param {String} urlTemplate  URL template on which substitutions are to be made
+ * @param substitutes Object containing keys to be replaced with respective values
+ * @param {String} testUrl  URL to be used if app is not in test mode (!App.testMode)
+ * @return {String} Formatted URL
+ */
+App.formatUrl = function (urlTemplate, substitutes, testUrl) {
+  var formatted = urlTemplate;
+  if (urlTemplate) {
+    if (App.testMode) {
+      var toSeconds = Math.round(new Date().getTime() / 1000);
+      var allSubstitutes = {
+        toSeconds: toSeconds,
+        fromSeconds: toSeconds - 3600, // 1 hour back
+        stepSeconds: 15, // 15 seconds
+        hostName: App.test_hostname
+      };
+      jQuery.extend(allSubstitutes, substitutes);
+      for (key in allSubstitutes) {
+        var useKey = '{' + key + '}';
+        formatted = formatted.replace(new RegExp(useKey, 'g'), allSubstitutes[key]);
+      }
+    } else {
+      formatted = testUrl;
+    }
+  }
+  return formatted;
 }
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/common/chart/linear_time.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/common/chart/linear_time.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/common/chart/linear_time.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/common/chart/linear_time.js Sun Dec  9 11:57:37 2012
@@ -44,8 +44,7 @@ var App = require('app');
  * @extends Ember.Object
  * @extends Ember.View
  */
-App.ChartLinearTimeView = Ember.View
-    .extend({
+App.ChartLinearTimeView = Ember.View.extend({
       templateName: require('templates/main/charts/linear_time'),
 
       /**
@@ -104,16 +103,17 @@ App.ChartLinearTimeView = Ember.View
 
       didInsertElement: function () {
         this._super();
-        if (this.url != null) {
+        var validUrl = this.get('url');
+        if (validUrl) {
           var hash = {};
-          hash.url = this.url;
+          hash.url = validUrl;
           hash.type = 'GET';
           hash.dataType = 'json';
           hash.contentType = 'application/json; charset=utf-8';
           hash.context = this;
           hash.success = this._refreshGraph;
-          hash.error = function(xhr, textStatus, errorThrown){
-            this._showMessage('warn', 'Error', 'There was a problem getting data for the chart ('+textStatus+': '+errorThrown+')');
+          hash.error = function (xhr, textStatus, errorThrown) {
+            this._showMessage('warn', 'Error', 'There was a problem getting data for the chart (' + textStatus + ': ' + errorThrown + ')');
           }
           jQuery.ajax(hash);
         }
@@ -375,4 +375,4 @@ App.ChartLinearTimeView.TimeElapsedForma
     }
   }
   return value;
-};
+};
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/cpu.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/cpu.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/cpu.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/cpu.js Sun Dec  9 11:57:37 2012
@@ -28,10 +28,15 @@ var App = require('app');
  */
 App.ChartHostMetricsCPU = App.ChartLinearTimeView.extend({
   id: "host-metrics-cpu",
-  url: "/data/hosts/metrics/cpu.json",
   title: "CPU Usage",
   yAxisFormatter: App.ChartLinearTimeView.PercentageFormatter,
-  
+
+  url: function () {
+    return App.formatUrl("/api/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('mainController.cluster').get('clusterName')
+    }, "/data/hosts/metrics/cpu.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.cpu) {
@@ -81,9 +86,9 @@ App.ChartHostMetricsCPU = App.ChartLinea
     }
     return seriesArray;
   },
-  
+
   colorForSeries: function (series) {
-    if ("Idle" == series.name){
+    if ("Idle" == series.name) {
       return 'rgba(255,255,255,1)';
     }
     return null;

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/disk.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/disk.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/disk.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/disk.js Sun Dec  9 11:57:37 2012
@@ -1,19 +1,18 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
  */
 
 var App = require('app');
@@ -29,11 +28,16 @@ var App = require('app');
  */
 App.ChartHostMetricsDisk = App.ChartLinearTimeView.extend({
   id: "host-metrics-disk",
-  url : "/data/hosts/metrics/disk.json",
   title: "Disk Usage",
   yAxisFormatter: App.ChartLinearTimeView.BytesFormatter,
-  
-  transformToSeries : function (jsonData) {
+
+  url: function () {
+    return App.formatUrl("/api/clusters/{clusterName}/hosts/{hostName}?fields=metrics/disk/disk_total[{fromSeconds},{toSeconds},{stepSeconds}],metrics/disk/part_max_used[{fromSeconds},{toSeconds},{stepSeconds}],metrics/disk/disk_free[{fromSeconds},{toSeconds},{stepSeconds}]", {
+      clusterName: App.router.get('mainController.cluster').get('clusterName')
+    }, "/data/hosts/metrics/disk.json");
+  }.property('App.router.mainController.cluster'),
+
+  transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.disk) {
       for ( var name in jsonData.metrics.disk) {

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/load.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/load.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/load.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/load.js Sun Dec  9 11:57:37 2012
@@ -1,19 +1,18 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
  */
 
 var App = require('app');
@@ -29,10 +28,15 @@ var App = require('app');
  */
 App.ChartHostMetricsLoad = App.ChartLinearTimeView.extend({
   id: "host-metrics-load",
-  url: "/data/hosts/metrics/load.json",
   title: "Load",
-  
-  transformToSeries: function(jsonData){
+
+  url: function () {
+    return App.formatUrl("/api/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('mainController.cluster').get('clusterName')
+    }, "/data/hosts/metrics/load.json");
+  }.property('App.router.mainController.cluster'),
+
+  transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.load) {
       for ( var name in jsonData.metrics.load) {

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/memory.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/memory.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/memory.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/memory.js Sun Dec  9 11:57:37 2012
@@ -28,10 +28,15 @@ var App = require('app');
  */
 App.ChartHostMetricsMemory = App.ChartLinearTimeView.extend({
   id: "host-metrics-memory",
-  url: "/data/hosts/metrics/memory.json",
   title: "Memory Usage",
   yAxisFormatter: App.ChartLinearTimeView.BytesFormatter,
-  
+
+  url: function () {
+    return App.formatUrl("/api/clusters/{clusterName}/hosts/{hostName}?fields=metrics/memory/swap_free[{fromSeconds},{toSeconds},{stepSeconds}],metrics/memory/mem_total[{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('mainController.cluster').get('clusterName')
+    }, "/data/hosts/metrics/memory.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.memory) {
@@ -78,9 +83,9 @@ App.ChartHostMetricsMemory = App.ChartLi
     }
     return seriesArray;
   },
-  
+
   colorForSeries: function (series) {
-    if("Total"==series.name){
+    if ("Total" == series.name) {
       return 'rgba(255,255,255,1)';
     }
     return null;

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/network.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/network.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/network.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/network.js Sun Dec  9 11:57:37 2012
@@ -1,19 +1,18 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
  */
 
 var App = require('app');
@@ -29,11 +28,16 @@ var App = require('app');
  */
 App.ChartHostMetricsNetwork = App.ChartLinearTimeView.extend({
   id: "host-metrics-network",
-  url : "/data/hosts/metrics/network.json",
   title: "Network Usage",
   yAxisFormatter: App.ChartLinearTimeView.BytesFormatter,
-  
-  transformToSeries : function (jsonData) {
+
+  url: function () {
+    return App.formatUrl("/api/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('mainController.cluster').get('clusterName')
+    }, "/data/hosts/metrics/network.json");
+  }.property('App.router.mainController.cluster'),
+
+  transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.network) {
       for ( var name in jsonData.metrics.network) {

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/processes.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/processes.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/processes.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/host/metrics/processes.js Sun Dec  9 11:57:37 2012
@@ -1,19 +1,18 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
  */
 
 var App = require('app');
@@ -29,10 +28,15 @@ var App = require('app');
  */
 App.ChartHostMetricsProcesses = App.ChartLinearTimeView.extend({
   id: "host-metrics-processes",
-  url: "/data/hosts/metrics/processes.json",
   title: "Processes",
-  
-  transformToSeries: function(jsonData){
+
+  url: function () {
+    return App.formatUrl("/api/clusters/{clusterName}/hosts/{hostName}?fields=metrics/processes/proc_total[{fromSeconds},{toSeconds},{stepSeconds}],metrics/processes/proc_run[{fromSeconds},{toSeconds},{stepSeconds}]", {
+      clusterName: App.router.get('mainController.cluster').get('clusterName')
+    }, "/data/hosts/metrics/processes.json");
+  }.property('App.router.mainController.cluster'),
+
+  transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.processes) {
       for ( var name in jsonData.metrics.processes) {

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/cluster_requests.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/cluster_requests.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/cluster_requests.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/cluster_requests.js Sun Dec  9 11:57:37 2012
@@ -28,9 +28,14 @@ var App = require('app');
  */
 App.ChartServiceMetricsHBASE_ClusterRequests = App.ChartLinearTimeView.extend({
   id: "service-metrics-hbase-cluster-requests",
-  url: "/data/services/metrics/hbase/cluster_requests.json",
   title: "Cluster Requests",
 
+  url: function () {
+    return App.formatUrl("/api/clusters/{clusterName}/services/HBASE/components/HBASE_MASTER?fields=metrics/hbase/master/cluster_requests[{fromSeconds},{toSeconds},{stepSeconds}]", {
+      clusterName: App.router.get('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/hbase/cluster_requests.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.hbase && jsonData.metrics.hbase.master) {

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/hlog_split_size.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/hlog_split_size.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/hlog_split_size.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/hlog_split_size.js Sun Dec  9 11:57:37 2012
@@ -28,10 +28,15 @@ var App = require('app');
  */
 App.ChartServiceMetricsHBASE_HlogSplitSize = App.ChartLinearTimeView.extend({
   id: "service-metrics-hbase-hlog-split-size",
-  url: "/data/services/metrics/hbase/hlog_split_size.json",
   title: "HLog Split Size",
   yAxisFormatter: App.ChartLinearTimeView.BytesFormatter,
 
+  url: function () {
+    return App.formatUrl("/api/clusters/{clusterName}/services/HBASE/components/HBASE_MASTER?fields=metrics/hbase/master/splitSize_avg_time[{fromSeconds},{toSeconds},{stepSeconds}]", {
+      clusterName: App.router.get('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/hbase/hlog_split_size.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.hbase && jsonData.metrics.hbase.master) {

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/hlog_split_time.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/hlog_split_time.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/hlog_split_time.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/hlog_split_time.js Sun Dec  9 11:57:37 2012
@@ -28,10 +28,15 @@ var App = require('app');
  */
 App.ChartServiceMetricsHBASE_HlogSplitTime = App.ChartLinearTimeView.extend({
   id: "service-metrics-hbase-hlog-split-time",
-  url: "/data/services/metrics/hbase/hlog_split_time.json",
   title: "HLog Split Time",
   yAxisFormatter: App.ChartLinearTimeView.TimeElapsedFormatter,
 
+  url: function () {
+    return App.formatUrl("/api/clusters/{clusterName}/services/HBASE/components/HBASE_MASTER?fields=metrics/hbase/master/splitTime_avg_time[{fromSeconds},{toSeconds},{stepSeconds}]", {
+      clusterName: App.router.get('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/hbase/hlog_split_time.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.hbase && jsonData.metrics.hbase.master) {

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_queuesize.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_queuesize.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_queuesize.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_queuesize.js Sun Dec  9 11:57:37 2012
@@ -28,9 +28,14 @@ var App = require('app');
  */
 App.ChartServiceMetricsHBASE_RegionServerQueueSize = App.ChartLinearTimeView.extend({
   id: "service-metrics-hbase-regionserver-queuesize",
-  url: "/data/services/metrics/hbase/regionserver_queuesize.json",
   title: "RegionServer Queue Size",
 
+  url: function () {
+    return App.formatUrl("/api/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('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/hbase/regionserver_queuesize.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.hbase && jsonData.metrics.hbase.regionserver) {

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_regions.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_regions.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_regions.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_regions.js Sun Dec  9 11:57:37 2012
@@ -28,9 +28,14 @@ var App = require('app');
  */
 App.ChartServiceMetricsHBASE_RegionServerRegions = App.ChartLinearTimeView.extend({
   id: "service-metrics-hbase-regionserver-regions",
-  url: "/data/services/metrics/hbase/regionserver_regions.json",
   title: "RegionServer Regions",
 
+  url: function () {
+    return App.formatUrl("/api/clusters/{clusterName}/services/HBASE/components/HBASE_REGIONSERVER?fields=metrics/hbase/regionserver/regions[{fromSeconds},{toSeconds},{stepSeconds}]", {
+      clusterName: App.router.get('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/hbase/regionserver_regions.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.hbase && jsonData.metrics.hbase.regionserver) {

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_rw_requests.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_rw_requests.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_rw_requests.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hbase/regionserver_rw_requests.js Sun Dec  9 11:57:37 2012
@@ -28,9 +28,14 @@ var App = require('app');
  */
 App.ChartServiceMetricsHBASE_RegionServerReadWriteRequests = App.ChartLinearTimeView.extend({
   id: "service-metrics-hbase-regionserver-rw-requests",
-  url: "/data/services/metrics/hbase/regionserver_rw_requests.json",
   title: "RegionServer Requests",
 
+  url: function () {
+    return App.formatUrl("/api/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('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/hbase/regionserver_rw_requests.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.hbase && jsonData.metrics.hbase.regionserver) {

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/file_operations.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/file_operations.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/file_operations.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/file_operations.js Sun Dec  9 11:57:37 2012
@@ -28,13 +28,18 @@ var App = require('app');
  */
 App.ChartServiceMetricsHDFS_FileOperations = App.ChartLinearTimeView.extend({
   id: "service-metrics-hdfs-file-operations",
-  url: "/data/services/metrics/hdfs/file_operations.json",
   title: "File Operations",
-  
+
+  url: function () {
+    return App.formatUrl("/api/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('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/hdfs/file_operations.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.dfs && jsonData.metrics.dfs.namenode) {
-      for (var name in jsonData.metrics.dfs.namenode){
+      for ( var name in jsonData.metrics.dfs.namenode) {
         var displayName;
         var seriesData = jsonData.metrics.dfs.namenode[name];
         switch (name) {
@@ -50,9 +55,9 @@ App.ChartServiceMetricsHDFS_FileOperatio
           default:
             break;
         }
-        if(seriesData){
+        if (seriesData) {
           // Is it a string?
-          if("string" == typeof seriesData){
+          if ("string" == typeof seriesData) {
             seriesData = JSON.parse(seriesData);
           }
           // We have valid data

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/gc.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/gc.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/gc.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/gc.js Sun Dec  9 11:57:37 2012
@@ -28,14 +28,19 @@ var App = require('app');
  */
 App.ChartServiceMetricsHDFS_GC = App.ChartLinearTimeView.extend({
   id: "service-metrics-hdfs-gc",
-  url: "/data/services/metrics/hdfs/gc.json",
   title: "Garbage Collection",
   yAxisFormatter: App.ChartLinearTimeView.TimeElapsedFormatter,
-  
+
+  url: function () {
+    return App.formatUrl("/api/clusters/{clusterName}/hosts/{hostName}/host_components/NAMENODE?fields=metrics/jvm/gcTimeMillis[{fromSeconds},{toSeconds},{stepSeconds}]", {
+      clusterName: App.router.get('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/hdfs/gc.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.jvm) {
-      for (var name in jsonData.metrics.jvm){
+      for ( var name in jsonData.metrics.jvm) {
         var displayName;
         var seriesData = jsonData.metrics.jvm[name];
         switch (name) {
@@ -45,9 +50,9 @@ App.ChartServiceMetricsHDFS_GC = App.Cha
           default:
             break;
         }
-        if(seriesData){
+        if (seriesData) {
           // Is it a string?
-          if("string" == typeof seriesData){
+          if ("string" == typeof seriesData) {
             seriesData = JSON.parse(seriesData);
           }
           // We have valid data

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/io.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/io.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/io.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/io.js Sun Dec  9 11:57:37 2012
@@ -28,14 +28,19 @@ var App = require('app');
  */
 App.ChartServiceMetricsHDFS_IO = App.ChartLinearTimeView.extend({
   id: "service-metrics-hdfs-io",
-  url: "/data/services/metrics/hdfs/io.json",
   title: "HDFS I/O",
   yAxisFormatter: App.ChartLinearTimeView.BytesFormatter,
-  
+
+  url: function () {
+    return App.formatUrl("/api/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('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/hdfs/io.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.dfs && jsonData.metrics.dfs.datanode) {
-      for (var name in jsonData.metrics.dfs.datanode){
+      for ( var name in jsonData.metrics.dfs.datanode) {
         var displayName;
         var seriesData = jsonData.metrics.dfs.datanode[name];
         switch (name) {
@@ -48,9 +53,9 @@ App.ChartServiceMetricsHDFS_IO = App.Cha
           default:
             break;
         }
-        if(seriesData){
+        if (seriesData) {
           // Is it a string?
-          if("string" == typeof seriesData){
+          if ("string" == typeof seriesData) {
             seriesData = JSON.parse(seriesData);
           }
           // We have valid data

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_heap.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_heap.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_heap.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_heap.js Sun Dec  9 11:57:37 2012
@@ -28,14 +28,19 @@ var App = require('app');
  */
 App.ChartServiceMetricsHDFS_JVMHeap = App.ChartLinearTimeView.extend({
   id: "service-metrics-hdfs-jvm-heap",
-  url: "/data/services/metrics/hdfs/jvm_heap.json",
   title: "JVM Memory Status",
   yAxisFormatter: App.ChartLinearTimeView.BytesFormatter,
-  
+
+  url: function () {
+    return App.formatUrl("/api/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('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/hdfs/jvm_heap.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.jvm) {
-      for (var name in jsonData.metrics.jvm){
+      for ( var name in jsonData.metrics.jvm) {
         var displayName;
         var seriesData = jsonData.metrics.jvm[name];
         switch (name) {
@@ -54,9 +59,9 @@ App.ChartServiceMetricsHDFS_JVMHeap = Ap
           default:
             break;
         }
-        if(seriesData){
+        if (seriesData) {
           // Is it a string?
-          if("string" == typeof seriesData){
+          if ("string" == typeof seriesData) {
             seriesData = JSON.parse(seriesData);
           }
           // We have valid data
@@ -66,7 +71,8 @@ App.ChartServiceMetricsHDFS_JVMHeap = Ap
           for ( var index = 0; index < seriesData.length; index++) {
             series.data.push({
               x: seriesData[index][1],
-              y: seriesData[index][0] * 1000000 // Data is in MB
+              y: seriesData[index][0] * 1000000
+            // Data is in MB
             });
           }
           seriesArray.push(series);

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_threads.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_threads.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_threads.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_threads.js Sun Dec  9 11:57:37 2012
@@ -28,13 +28,18 @@ var App = require('app');
  */
 App.ChartServiceMetricsHDFS_JVMThreads = App.ChartLinearTimeView.extend({
   id: "service-metrics-hdfs-jvm-threads",
-  url: "/data/services/metrics/hdfs/jvm_threads.json",
   title: "JVM Thread Status",
-  
+
+  url: function () {
+    return App.formatUrl("/api/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('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/hdfs/jvm_threads.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.jvm) {
-      for (var name in jsonData.metrics.jvm){
+      for ( var name in jsonData.metrics.jvm) {
         var displayName;
         var seriesData = jsonData.metrics.jvm[name];
         switch (name) {
@@ -53,9 +58,9 @@ App.ChartServiceMetricsHDFS_JVMThreads =
           default:
             break;
         }
-        if(seriesData){
+        if (seriesData) {
           // Is it a string?
-          if("string" == typeof seriesData){
+          if ("string" == typeof seriesData) {
             seriesData = JSON.parse(seriesData);
           }
           // We have valid data

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/rpc.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/rpc.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/rpc.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/hdfs/rpc.js Sun Dec  9 11:57:37 2012
@@ -28,14 +28,19 @@ var App = require('app');
  */
 App.ChartServiceMetricsHDFS_RPC = App.ChartLinearTimeView.extend({
   id: "service-metrics-hdfs-rpc",
-  url: "/data/services/metrics/hdfs/rpc.json",
   title: "RPC",
   yAxisFormatter: App.ChartLinearTimeView.TimeElapsedFormatter,
-  
+
+  url: function () {
+    return App.formatUrl("/api/clusters/{clusterName}/hosts/{hostName}/host_components/NAMENODE?fields=metrics/rpc/RpcQueueTime_avg_time[{fromSeconds},{toSeconds},{stepSeconds}]", {
+      clusterName: App.router.get('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/hdfs/rpc.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.rpc) {
-      for (var name in jsonData.metrics.rpc){
+      for ( var name in jsonData.metrics.rpc) {
         var displayName;
         var seriesData = jsonData.metrics.rpc[name];
         switch (name) {
@@ -45,9 +50,9 @@ App.ChartServiceMetricsHDFS_RPC = App.Ch
           default:
             break;
         }
-        if(seriesData){
+        if (seriesData) {
           // Is it a string?
-          if("string" == typeof seriesData){
+          if ("string" == typeof seriesData) {
             seriesData = JSON.parse(seriesData);
           }
           // We have valid data

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/gc.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/gc.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/gc.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/gc.js Sun Dec  9 11:57:37 2012
@@ -28,14 +28,19 @@ var App = require('app');
  */
 App.ChartServiceMetricsMapReduce_GC = App.ChartLinearTimeView.extend({
   id: "service-metrics-mapreduce-gc",
-  url: "/data/services/metrics/mapreduce/gc.json",
   title: "Garbage Collection",
   yAxisFormatter: App.ChartLinearTimeView.TimeElapsedFormatter,
-  
+
+  url: function () {
+    return App.formatUrl("/api/clusters/{clusterName}/hosts/{hostName}/host_components/JOBTRACKER?fields=metrics/jvm/gcTimeMillis[{fromSeconds},{toSeconds},{stepSeconds}]", {
+      clusterName: App.router.get('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/mapreduce/gc.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.jvm) {
-      for (var name in jsonData.metrics.jvm){
+      for ( var name in jsonData.metrics.jvm) {
         var displayName;
         var seriesData = jsonData.metrics.jvm[name];
         switch (name) {
@@ -45,9 +50,9 @@ App.ChartServiceMetricsMapReduce_GC = Ap
           default:
             break;
         }
-        if(seriesData){
+        if (seriesData) {
           // Is it a string?
-          if("string" == typeof seriesData){
+          if ("string" == typeof seriesData) {
             seriesData = JSON.parse(seriesData);
           }
           // We have valid data

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jobs_running_waiting.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jobs_running_waiting.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jobs_running_waiting.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jobs_running_waiting.js Sun Dec  9 11:57:37 2012
@@ -28,13 +28,18 @@ var App = require('app');
  */
 App.ChartServiceMetricsMapReduce_JobsRunningWaiting = App.ChartLinearTimeView.extend({
   id: "service-metrics-mapreduce-jobs-running-waiting",
-  url: "/data/services/metrics/mapreduce/jobs_running_waiting.json",
   title: "Jobs",
-  
+
+  url: function () {
+    return App.formatUrl("/api/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('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/mapreduce/jobs_running_waiting.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.mapred && jsonData.metrics.mapred.jobtracker) {
-      for (var name in jsonData.metrics.mapred.jobtracker){
+      for ( var name in jsonData.metrics.mapred.jobtracker) {
         var displayName;
         var seriesData = jsonData.metrics.mapred.jobtracker[name];
         switch (name) {
@@ -53,9 +58,9 @@ App.ChartServiceMetricsMapReduce_JobsRun
           default:
             break;
         }
-        if(seriesData){
+        if (seriesData) {
           // Is it a string?
-          if("string" == typeof seriesData){
+          if ("string" == typeof seriesData) {
             seriesData = JSON.parse(seriesData);
           }
           // We have valid data

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jobs_status.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jobs_status.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jobs_status.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jobs_status.js Sun Dec  9 11:57:37 2012
@@ -28,13 +28,18 @@ var App = require('app');
  */
 App.ChartServiceMetricsMapReduce_JobsStatus = App.ChartLinearTimeView.extend({
   id: "service-metrics-mapreduce-jobs-status",
-  url: "/data/services/metrics/mapreduce/jobs_status.json",
   title: "Jobs Status",
-  
+
+  url: function () {
+    return App.formatUrl("/api/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('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/mapreduce/jobs_status.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.mapred && jsonData.metrics.mapred.jobtracker) {
-      for (var name in jsonData.metrics.mapred.jobtracker){
+      for ( var name in jsonData.metrics.mapred.jobtracker) {
         var displayName;
         var seriesData = jsonData.metrics.mapred.jobtracker[name];
         switch (name) {
@@ -56,9 +61,9 @@ App.ChartServiceMetricsMapReduce_JobsSta
           default:
             break;
         }
-        if(seriesData){
+        if (seriesData) {
           // Is it a string?
-          if("string" == typeof seriesData){
+          if ("string" == typeof seriesData) {
             seriesData = JSON.parse(seriesData);
           }
           // We have valid data

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_heap.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_heap.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_heap.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_heap.js Sun Dec  9 11:57:37 2012
@@ -28,14 +28,19 @@ var App = require('app');
  */
 App.ChartServiceMetricsMapReduce_JVMHeap = App.ChartLinearTimeView.extend({
   id: "service-metrics-mapreduce-jvm-heap",
-  url: "/data/services/metrics/mapreduce/jvm_heap.json",
   title: "JVM Memory Status",
   yAxisFormatter: App.ChartLinearTimeView.BytesFormatter,
-  
+
+  url: function () {
+    return App.formatUrl("/api/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('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/mapreduce/jvm_heap.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.jvm) {
-      for (var name in jsonData.metrics.jvm){
+      for ( var name in jsonData.metrics.jvm) {
         var displayName;
         var seriesData = jsonData.metrics.jvm[name];
         switch (name) {
@@ -54,9 +59,9 @@ App.ChartServiceMetricsMapReduce_JVMHeap
           default:
             break;
         }
-        if(seriesData){
+        if (seriesData) {
           // Is it a string?
-          if("string" == typeof seriesData){
+          if ("string" == typeof seriesData) {
             seriesData = JSON.parse(seriesData);
           }
           // We have valid data
@@ -66,7 +71,8 @@ App.ChartServiceMetricsMapReduce_JVMHeap
           for ( var index = 0; index < seriesData.length; index++) {
             series.data.push({
               x: seriesData[index][1],
-              y: seriesData[index][0] * 1000000 // Data is in MB
+              y: seriesData[index][0] * 1000000
+            // Data is in MB
             });
           }
           seriesArray.push(series);

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_threads.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_threads.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_threads.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_threads.js Sun Dec  9 11:57:37 2012
@@ -28,13 +28,18 @@ var App = require('app');
  */
 App.ChartServiceMetricsMapReduce_JVMThreads = App.ChartLinearTimeView.extend({
   id: "service-metrics-mapreduce-jvm-threads",
-  url: "/data/services/metrics/mapreduce/jvm_threads.json",
   title: "JVM Thread Status",
-  
+
+  url: function () {
+    return App.formatUrl("/api/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('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/mapreduce/jvm_threads.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.jvm) {
-      for (var name in jsonData.metrics.jvm){
+      for ( var name in jsonData.metrics.jvm) {
         var displayName;
         var seriesData = jsonData.metrics.jvm[name];
         switch (name) {
@@ -53,9 +58,9 @@ App.ChartServiceMetricsMapReduce_JVMThre
           default:
             break;
         }
-        if(seriesData){
+        if (seriesData) {
           // Is it a string?
-          if("string" == typeof seriesData){
+          if ("string" == typeof seriesData) {
             seriesData = JSON.parse(seriesData);
           }
           // We have valid data

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/map_slots.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/map_slots.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/map_slots.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/map_slots.js Sun Dec  9 11:57:37 2012
@@ -28,13 +28,18 @@ var App = require('app');
  */
 App.ChartServiceMetricsMapReduce_MapSlots = App.ChartLinearTimeView.extend({
   id: "service-metrics-mapreduce-map-slots",
-  url: "/data/services/metrics/mapreduce/map_slots.json",
   title: "Map Slot Utilization",
-  
+
+  url: function () {
+    return App.formatUrl("/api/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('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/mapreduce/map_slots.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.mapred && jsonData.metrics.mapred.jobtracker) {
-      for (var name in jsonData.metrics.mapred.jobtracker){
+      for ( var name in jsonData.metrics.mapred.jobtracker) {
         var displayName;
         var seriesData = jsonData.metrics.mapred.jobtracker[name];
         switch (name) {
@@ -47,9 +52,9 @@ App.ChartServiceMetricsMapReduce_MapSlot
           default:
             break;
         }
-        if(seriesData){
+        if (seriesData) {
           // Is it a string?
-          if("string" == typeof seriesData){
+          if ("string" == typeof seriesData) {
             seriesData = JSON.parse(seriesData);
           }
           // We have valid data

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/reduce_slots.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/reduce_slots.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/reduce_slots.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/reduce_slots.js Sun Dec  9 11:57:37 2012
@@ -28,13 +28,18 @@ var App = require('app');
  */
 App.ChartServiceMetricsMapReduce_ReduceSlots = App.ChartLinearTimeView.extend({
   id: "service-metrics-mapreduce-reduce-slots",
-  url: "/data/services/metrics/mapreduce/reduce_slots.json",
   title: "Reduce Slots Utilization",
-  
+
+  url: function () {
+    return App.formatUrl("/api/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('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/mapreduce/reduce_slots.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.mapred && jsonData.metrics.mapred.jobtracker) {
-      for (var name in jsonData.metrics.mapred.jobtracker){
+      for ( var name in jsonData.metrics.mapred.jobtracker) {
         var displayName;
         var seriesData = jsonData.metrics.mapred.jobtracker[name];
         switch (name) {
@@ -47,9 +52,9 @@ App.ChartServiceMetricsMapReduce_ReduceS
           default:
             break;
         }
-        if(seriesData){
+        if (seriesData) {
           // Is it a string?
-          if("string" == typeof seriesData){
+          if ("string" == typeof seriesData) {
             seriesData = JSON.parse(seriesData);
           }
           // We have valid data

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/rpc.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/rpc.js?rev=1418896&r1=1418895&r2=1418896&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/rpc.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/app/views/main/service/info/metrics/mapreduce/rpc.js Sun Dec  9 11:57:37 2012
@@ -28,14 +28,19 @@ var App = require('app');
  */
 App.ChartServiceMetricsMapReduce_RPC = App.ChartLinearTimeView.extend({
   id: "service-metrics-mapreduce-rpc",
-  url: "/data/services/metrics/mapreduce/rpc.json",
   title: "RPC",
   yAxisFormatter: App.ChartLinearTimeView.TimeElapsedFormatter,
-  
+
+  url: function () {
+    return App.formatUrl("/api/clusters/{clusterName}/hosts/{hostName}/host_components/JOBTRACKER?fields=metrics/rpc/RpcQueueTime_avg_time[{fromSeconds},{toSeconds},{stepSeconds}]", {
+      clusterName: App.router.get('mainController.cluster').get('clusterName')
+    }, "/data/services/metrics/mapreduce/rpc.json");
+  }.property('App.router.mainController.cluster'),
+
   transformToSeries: function (jsonData) {
     var seriesArray = [];
     if (jsonData && jsonData.metrics && jsonData.metrics.rpc) {
-      for (var name in jsonData.metrics.rpc){
+      for ( var name in jsonData.metrics.rpc) {
         var displayName;
         var seriesData = jsonData.metrics.rpc[name];
         switch (name) {
@@ -45,9 +50,9 @@ App.ChartServiceMetricsMapReduce_RPC = A
           default:
             break;
         }
-        if(seriesData){
+        if (seriesData) {
           // Is it a string?
-          if("string" == typeof seriesData){
+          if ("string" == typeof seriesData) {
             seriesData = JSON.parse(seriesData);
           }
           // We have valid data