Modified: incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_heap.js URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_heap.js?rev=1433668&r1=1433667&r2=1433668&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_heap.js (original) +++ incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_heap.js Tue Jan 15 21:34:47 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/trunk/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_threads.js URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_threads.js?rev=1433668&r1=1433667&r2=1433668&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_threads.js (original) +++ incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/hdfs/jvm_threads.js Tue Jan 15 21:34:47 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/trunk/ambari-web/app/views/main/service/info/metrics/hdfs/rpc.js URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/hdfs/rpc.js?rev=1433668&r1=1433667&r2=1433668&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/hdfs/rpc.js (original) +++ incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/hdfs/rpc.js Tue Jan 15 21:34:47 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/trunk/ambari-web/app/views/main/service/info/metrics/hdfs/space_utilization.js URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/hdfs/space_utilization.js?rev=1433668&r1=1433667&r2=1433668&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/hdfs/space_utilization.js (original) +++ incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/hdfs/space_utilization.js Tue Jan 15 21:34:47 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/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/gc.js URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/gc.js?rev=1433668&r1=1433667&r2=1433668&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/gc.js (original) +++ incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/gc.js Tue Jan 15 21:34:47 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/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/jobs_status.js URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/jobs_status.js?rev=1433668&r1=1433667&r2=1433668&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/jobs_status.js (original) +++ incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/jobs_status.js Tue Jan 15 21:34:47 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/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_heap.js URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_heap.js?rev=1433668&r1=1433667&r2=1433668&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_heap.js (original) +++ incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_heap.js Tue Jan 15 21:34:47 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/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_threads.js URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_threads.js?rev=1433668&r1=1433667&r2=1433668&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_threads.js (original) +++ incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/jvm_threads.js Tue Jan 15 21:34:47 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/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/map_slots.js URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/map_slots.js?rev=1433668&r1=1433667&r2=1433668&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/map_slots.js (original) +++ incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/map_slots.js Tue Jan 15 21:34:47 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/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/reduce_slots.js URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/reduce_slots.js?rev=1433668&r1=1433667&r2=1433668&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/reduce_slots.js (original) +++ incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/reduce_slots.js Tue Jan 15 21:34:47 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/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/rpc.js URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/rpc.js?rev=1433668&r1=1433667&r2=1433668&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/rpc.js (original) +++ incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/rpc.js Tue Jan 15 21:34:47 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/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/tasks_running_waiting.js URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/tasks_running_waiting.js?rev=1433668&r1=1433667&r2=1433668&view=diff ============================================================================== --- incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/tasks_running_waiting.js (original) +++ incubator/ambari/trunk/ambari-web/app/views/main/service/info/metrics/mapreduce/tasks_running_waiting.js Tue Jan 15 21:34:47 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)); } } }
