Updated Branches: refs/heads/trunk b56ab107d -> 92cceb87c
AMBARI-2798. YARN specific graphs should be created. (Andrii Babiichuk via onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/92cceb87 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/92cceb87 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/92cceb87 Branch: refs/heads/trunk Commit: 92cceb87caaa8ed59a47295a6d03b16d6c739551 Parents: b56ab10 Author: Oleg Nechiporenko <[email protected]> Authored: Fri Aug 2 19:22:38 2013 +0300 Committer: Oleg Nechiporenko <[email protected]> Committed: Fri Aug 2 19:22:38 2013 +0300 ---------------------------------------------------------------------- .../main/service/info/metrics/yarn/allocated.js | 61 +++++++++++++++++ .../info/metrics/yarn/allocated_container.js | 61 +++++++++++++++++ .../views/main/service/info/metrics/yarn/nms.js | 67 ++++++++++++++++++ .../views/main/service/info/metrics/yarn/qmr.js | 71 ++++++++++++++++++++ ambari-web/app/messages.js | 21 +++++- ambari-web/app/utils/ajax.js | 20 ++++++ ambari-web/app/views.js | 4 ++ .../app/views/main/service/info/summary.js | 12 ++-- 8 files changed, 312 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/92cceb87/ambari-web/ambari-web/app/views/main/service/info/metrics/yarn/allocated.js ---------------------------------------------------------------------- diff --git a/ambari-web/ambari-web/app/views/main/service/info/metrics/yarn/allocated.js b/ambari-web/ambari-web/app/views/main/service/info/metrics/yarn/allocated.js new file mode 100644 index 0000000..035f3ad --- /dev/null +++ b/ambari-web/ambari-web/app/views/main/service/info/metrics/yarn/allocated.js @@ -0,0 +1,61 @@ +/** + * 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. + */ + +var App = require('app'); + +/** + * @class + * + * This is a view for showing cluster CPU metrics + * + * @extends App.ChartLinearTimeView + * @extends Ember.Object + * @extends Ember.View + */ +App.ChartServiceMetricsYARN_AllocatedMemory = App.ChartLinearTimeView.extend({ + id: "service-metrics-yarn-queue-allocated", + title: Em.I18n.t('services.service.info.metrics.yarn.allocated.memory'), + renderer: 'line', + ajaxIndex: 'service.metrics.yarn.queue.allocated', + + transformToSeries: function (jsonData) { + var seriesArray = []; + if (jsonData && jsonData.metrics && jsonData.metrics.yarn.Queue) { + for (var name in jsonData.metrics.yarn.Queue) { + var displayName; + var seriesData = jsonData.metrics.yarn.Queue[name]; + switch (name) { + case "AvailableMB": + displayName = Em.I18n.t('services.service.info.metrics.yarn.allocated.memory.displayNames.available'); + break; + case "PendingMB": + displayName = Em.I18n.t('services.service.info.metrics.yarn.allocated.memory.displayNames.pending'); + break; + case "AllocatedMB": + displayName = Em.I18n.t('services.service.info.metrics.yarn.allocated.memory.displayNames.allocated'); + break; + default: + break; + } + if (seriesData) { + seriesArray.push(this.transformData(seriesData, displayName)); + } + } + } + return seriesArray; + } +}); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/92cceb87/ambari-web/ambari-web/app/views/main/service/info/metrics/yarn/allocated_container.js ---------------------------------------------------------------------- diff --git a/ambari-web/ambari-web/app/views/main/service/info/metrics/yarn/allocated_container.js b/ambari-web/ambari-web/app/views/main/service/info/metrics/yarn/allocated_container.js new file mode 100644 index 0000000..cfdef64 --- /dev/null +++ b/ambari-web/ambari-web/app/views/main/service/info/metrics/yarn/allocated_container.js @@ -0,0 +1,61 @@ +/** + * 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. + */ + +var App = require('app'); + +/** + * @class + * + * This is a view for showing cluster CPU metrics + * + * @extends App.ChartLinearTimeView + * @extends Ember.Object + * @extends Ember.View + */ +App.ChartServiceMetricsYARN_AllocatedContainer = App.ChartLinearTimeView.extend({ + id: "service-metrics-yarn-queue-allocated-container", + title: Em.I18n.t('services.service.info.metrics.yarn.allocated.container'), + renderer: 'line', + ajaxIndex: 'service.metrics.yarn.queue.allocated.container', + + transformToSeries: function (jsonData) { + var seriesArray = []; + if (jsonData && jsonData.metrics && jsonData.metrics.yarn.Queue.root) { + for (var name in jsonData.metrics.yarn.Queue.root) { + var displayName; + var seriesData = jsonData.metrics.yarn.Queue.root[name]; + switch (name) { + case "ReservedContainers": + displayName = Em.I18n.t('services.service.info.metrics.yarn.allocated.container.displayNames.reserved'); + break; + case "PendingContainers": + displayName = Em.I18n.t('services.service.info.metrics.yarn.allocated.container.displayNames.pending'); + break; + case "AllocatedContainers": + displayName = Em.I18n.t('services.service.info.metrics.yarn.allocated.container.displayNames.allocated'); + break; + default: + break; + } + if (seriesData) { + seriesArray.push(this.transformData(seriesData, displayName)); + } + } + } + return seriesArray; + } +}); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/92cceb87/ambari-web/ambari-web/app/views/main/service/info/metrics/yarn/nms.js ---------------------------------------------------------------------- diff --git a/ambari-web/ambari-web/app/views/main/service/info/metrics/yarn/nms.js b/ambari-web/ambari-web/app/views/main/service/info/metrics/yarn/nms.js new file mode 100644 index 0000000..4421570 --- /dev/null +++ b/ambari-web/ambari-web/app/views/main/service/info/metrics/yarn/nms.js @@ -0,0 +1,67 @@ +/** + * 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. + */ + +var App = require('app'); + +/** + * @class + * + * This is a view for showing cluster CPU metrics + * + * @extends App.ChartLinearTimeView + * @extends Ember.Object + * @extends Ember.View + */ +App.ChartServiceMetricsYARN_NMS = App.ChartLinearTimeView.extend({ + id: "service-metrics-yarn-node-manager-statuses", + title: Em.I18n.t('services.service.info.metrics.yarn.nodemanager.statuses'), + renderer: 'line', + ajaxIndex: 'service.metrics.yarn.node.manager.statuses', + + transformToSeries: function (jsonData) { + var seriesArray = []; + if (jsonData && jsonData.metrics && jsonData.metrics.yarn && jsonData.metrics.yarn.ClusterMetrics) { + for (var name in jsonData.metrics.yarn.ClusterMetrics) { + var displayName; + var seriesData = jsonData.metrics.yarn.ClusterMetrics[name]; + switch (name) { + case "NumActiveNMs": + displayName = Em.I18n.t('services.service.info.metrics.yarn.nodemanager.statuses.displayNames.active'); + break; + case "NumDecommissionedNMs": + displayName = Em.I18n.t('services.service.info.metrics.yarn.nodemanager.statuses.displayNames.decommissioned'); + break; + case "NumLostNMs": + displayName = Em.I18n.t('services.service.info.metrics.yarn.nodemanager.statuses.displayNames.lost'); + break; + case "NumRebootedNMs": + displayName = Em.I18n.t('services.service.info.metrics.yarn.nodemanager.statuses.displayNames.rebooted'); + break; + case "NumUnhealthyNMs": + displayName = Em.I18n.t('services.service.info.metrics.yarn.nodemanager.statuses.displayNames.unhealthy'); + break; + default: + break; + } + if (seriesData) { + seriesArray.push(this.transformData(seriesData, displayName)); + } + } + } + return seriesArray; + } +}); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/92cceb87/ambari-web/ambari-web/app/views/main/service/info/metrics/yarn/qmr.js ---------------------------------------------------------------------- diff --git a/ambari-web/ambari-web/app/views/main/service/info/metrics/yarn/qmr.js b/ambari-web/ambari-web/app/views/main/service/info/metrics/yarn/qmr.js new file mode 100644 index 0000000..3dfe929 --- /dev/null +++ b/ambari-web/ambari-web/app/views/main/service/info/metrics/yarn/qmr.js @@ -0,0 +1,71 @@ +/** + * 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. + */ + +var App = require('app'); + +/** + * @class + * + * This is a view for showing cluster CPU metrics + * + * @extends App.ChartLinearTimeView + * @extends Ember.Object + * @extends Ember.View + */ +App.ChartServiceMetricsYARN_QMR = App.ChartLinearTimeView.extend({ + id: "service-metrics-yarn-queue-memory-resource", + title: Em.I18n.t('services.service.info.metrics.yarn.queueMemoryResource'), + renderer: 'line', + ajaxIndex: 'service.metrics.yarn.queue.memory.resource', + + transformToSeries: function (jsonData) { + var seriesArray = []; + if (jsonData && jsonData.metrics && jsonData.metrics.yarn.Queue.root) { + for (var name in jsonData.metrics.yarn.Queue.root) { + var displayName; + var seriesData = jsonData.metrics.yarn.Queue.root[name]; + switch (name) { + case "AllocatedMB": + displayName = Em.I18n.t('services.service.info.metrics.yarn.queueMemoryResource.displayNames.allocated'); + break; + case "AvailableMB": + displayName = Em.I18n.t('services.service.info.metrics.yarn.queueMemoryResource.displayNames.available'); + break; + default: + for (var name in jsonData.metrics.yarn.Queue.root.default) { + seriesData = jsonData.metrics.yarn.Queue.root.default[name]; + switch (name) { + case "AllocatedMB": + displayName = Em.I18n.t('services.service.info.metrics.yarn.queueMemoryResource.displayNames.allocated.default'); + break; + case "AvailableMB": + displayName = Em.I18n.t('services.service.info.metrics.yarn.queueMemoryResource.displayNames.available.default'); + break; + default: + break; + } + } + break; + } + if (seriesData) { + seriesArray.push(this.transformData(seriesData, displayName)); + } + } + } + return seriesArray; + } +}); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/92cceb87/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index e225e19..9f4517d 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -902,7 +902,26 @@ Em.I18n.translations = { 'services.service.info.metrics.yarn.gc': 'Garbage Collection', 'services.service.info.metrics.yarn.gc.displayNames.gcTimeMillis':'Time', - + 'services.service.info.metrics.yarn.allocated.memory': 'Allocated Memory', + 'services.service.info.metrics.yarn.allocated.memory.displayNames.allocated': 'Allocated', + 'services.service.info.metrics.yarn.allocated.memory.displayNames.available': 'Available', + 'services.service.info.metrics.yarn.allocated.memory.displayNames.pending': 'Pending', + 'services.service.info.metrics.yarn.allocated.container': 'Allocated Container', + 'services.service.info.metrics.yarn.allocated.container.displayNames.allocated': 'Allocated', + 'services.service.info.metrics.yarn.allocated.container.displayNames.reserved': 'Reserved', + 'services.service.info.metrics.yarn.allocated.container.displayNames.pending': 'Pending', + 'services.service.info.metrics.yarn.nodemanager.statuses':'Nodemanager statuses', + 'services.service.info.metrics.yarn.nodemanager.statuses.displayNames.active':'Active Nodemanagers', + 'services.service.info.metrics.yarn.nodemanager.statuses.displayNames.decommissioned':'Decommissioned Nodemanagers', + 'services.service.info.metrics.yarn.nodemanager.statuses.displayNames.lost':'Lost Nodemanagers', + 'services.service.info.metrics.yarn.nodemanager.statuses.displayNames.rebooted':'Rebooted Nodemanagers', + 'services.service.info.metrics.yarn.nodemanager.statuses.displayNames.unhealthy':'Unhealthy Nodemanagers', + 'services.service.info.metrics.yarn.queueMemoryResource':'Queue memory resource', + 'services.service.info.metrics.yarn.queueMemoryResource.displayNames.allocated':'Allocated', + 'services.service.info.metrics.yarn.queueMemoryResource.displayNames.available':'Available', + 'services.service.info.metrics.yarn.queueMemoryResource.displayNames.allocated.default':'Allocated default', + 'services.service.info.metrics.yarn.queueMemoryResource.displayNames.available.default':'Available default', + 'services.service.info.menu.summary':'Summary', 'services.service.info.menu.configs':'Configs', 'services.service.info.summary.hostsRunningMonitor':'{0}/{1}', http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/92cceb87/ambari-web/app/utils/ajax.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/ajax.js b/ambari-web/app/utils/ajax.js index d52acc9..b36343a 100644 --- a/ambari-web/app/utils/ajax.js +++ b/ambari-web/app/utils/ajax.js @@ -426,6 +426,26 @@ var urls = { 'mock': '/data/services/metrics/yarn/jvm_heap.json', 'testInProduction': true }, + 'service.metrics.yarn.queue.allocated': { + 'real': '/clusters/{clusterName}/hosts/{resourceManager}/host_components/RESOURCEMANAGER?fields=metrics/yarn/Queue/AvailableMB[{fromSeconds},{toSeconds},{stepSeconds}],metrics/yarn/Queue/PendingMB[{fromSeconds},{toSeconds},{stepSeconds}],metrics/yarn/Queue/AllocatedMB[{fromSeconds},{toSeconds},{stepSeconds}]', + 'mock': '', + 'testInProduction': true + }, + 'service.metrics.yarn.queue.allocated.container': { + 'real': '/clusters/{clusterName}/hosts/{resourceManager}/host_components/RESOURCEMANAGER?fields=metrics/yarn/Queue/AllocatedContainers[{fromSeconds},{toSeconds},{stepSeconds}],metrics/yarn/Queue/ReservedContainers[{fromSeconds},{toSeconds},{stepSeconds}],metrics/yarn/Queue/PendingContainers[{fromSeconds},{toSeconds},{stepSeconds}]', + 'mock': '', + 'testInProduction': true + }, + 'service.metrics.yarn.node.manager.statuses': { + 'real': '/clusters/{clusterName}/hosts/{resourceManager}/host_components/RESOURCEMANAGER?fields=metrics/yarn/ClusterMetrics/NumActiveNMs[{fromSeconds},{toSeconds},{stepSeconds}],metrics/yarn/ClusterMetrics/NumDecommissionedNMs[{fromSeconds},{toSeconds},{stepSeconds}],metrics/yarn/ClusterMetrics/NumLostNMs[{fromSeconds},{toSeconds},{stepSeconds}],metrics/yarn/ClusterMetrics/NumRebootedNMs[{fromSeconds},{toSeconds},{stepSeconds}],metrics/yarn/ClusterMetrics/NumUnhealthyNMs[{fromSeconds},{toSeconds},{stepSeconds}]', + 'mock': '', + 'testInProduction': true + }, + 'service.metrics.yarn.queue.memory.resource': { + 'real': '/clusters/{clusterName}/hosts/{resourceManager}/host_components/RESOURCEMANAGER?fields=metrics/yarn/Queue/root/AllocatedMB[{fromSeconds},{toSeconds},{stepSeconds}],metrics/yarn/Queue/root/AvailableMB[{fromSeconds},{toSeconds},{stepSeconds}],metrics/yarn/Queue/root/default/AllocatedMB[{fromSeconds},{toSeconds},{stepSeconds}],metrics/yarn/Queue/root/default/AvailableMB[{fromSeconds},{toSeconds},{stepSeconds}]', + 'mock': '', + 'testInProduction': true + }, 'dashboard.cluster_metrics.cpu': { 'real': '/clusters/{clusterName}/?fields=metrics/cpu[{fromSeconds},{toSeconds},{stepSeconds}]', 'mock': '/data/cluster_metrics/cpu_1hr.json', http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/92cceb87/ambari-web/app/views.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js index 12b52f0..9fd247f 100644 --- a/ambari-web/app/views.js +++ b/ambari-web/app/views.js @@ -146,6 +146,10 @@ require('views/main/service/info/metrics/yarn/tasks_running_waiting'); require('views/main/service/info/metrics/yarn/jobs_status'); require('views/main/service/info/metrics/yarn/map_slots'); require('views/main/service/info/metrics/yarn/reduce_slots'); +require('views/main/service/info/metrics/yarn/allocated'); +require('views/main/service/info/metrics/yarn/allocated_container'); +require('views/main/service/info/metrics/yarn/nms'); +require('views/main/service/info/metrics/yarn/qmr'); require('views/main/service/info/metrics/mapreduce/gc'); require('views/main/service/info/metrics/mapreduce/jvm_threads'); require('views/main/service/info/metrics/mapreduce/jvm_heap'); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/92cceb87/ambari-web/app/views/main/service/info/summary.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/info/summary.js b/ambari-web/app/views/main/service/info/summary.js index 34a776c..4c7beae 100644 --- a/ambari-web/app/views/main/service/info/summary.js +++ b/ambari-web/app/views/main/service/info/summary.js @@ -330,14 +330,18 @@ App.MainServiceInfoSummaryView = Em.View.extend({ App.ChartServiceMetricsHDFS_JVMThreads.extend()]]; break; case 'yarn': - graphs = [ /*[App.ChartServiceMetricsYARN_JobsStatus.extend(), + graphs = /*[[App.ChartServiceMetricsYARN_JobsStatus.extend(), App.ChartServiceMetricsYARN_TasksRunningWaiting.extend(), App.ChartServiceMetricsYARN_MapSlots.extend(), - App.ChartServiceMetricsYARN_ReduceSlots.extend()],*/ - [App.ChartServiceMetricsYARN_RPC.extend(), + App.ChartServiceMetricsYARN_ReduceSlots.extend()]*/ + [[App.ChartServiceMetricsYARN_RPC.extend(), App.ChartServiceMetricsYARN_GC.extend(), App.ChartServiceMetricsYARN_JVMHeap.extend(), - App.ChartServiceMetricsYARN_JVMThreads.extend()]]; + App.ChartServiceMetricsYARN_JVMThreads.extend()], + [App.ChartServiceMetricsYARN_AllocatedMemory.extend(), + App.ChartServiceMetricsYARN_AllocatedContainer.extend(), + App.ChartServiceMetricsYARN_NMS.extend(), + App.ChartServiceMetricsYARN_QMR.extend()]]; break; case 'mapreduce': graphs = [ [App.ChartServiceMetricsMapReduce_JobsStatus.extend(),
