You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sr...@apache.org on 2013/06/06 23:17:08 UTC
svn commit: r1490445 - in
/incubator/ambari/branches/branch-1.4.0/ambari-web/app: ./
controllers/main/charts/ controllers/main/charts/heatmap_metrics/
Author: srimanth
Date: Thu Jun 6 21:17:07 2013
New Revision: 1490445
URL: http://svn.apache.org/r1490445
Log:
AMBARI-2304. Provide YARN heatmaps. (srimanth)
Added:
incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn.js (with props)
incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_gctime.js (with props)
incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_memHeapUsed.js (with props)
Modified:
incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers.js
incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap.js
incubator/ambari/branches/branch-1.4.0/ambari-web/app/messages.js
Modified: incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers.js?rev=1490445&r1=1490444&r2=1490445&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers.js (original)
+++ incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers.js Thu Jun 6 21:17:07 2013
@@ -68,6 +68,9 @@ require('controllers/main/charts/heatmap
require('controllers/main/charts/heatmap_metrics/heatmap_metric_mapreduce_mapsRunning');
require('controllers/main/charts/heatmap_metrics/heatmap_metric_mapreduce_reducesRunning');
require('controllers/main/charts/heatmap_metrics/heatmap_metric_mapreduce_memHeapUsed');
+require('controllers/main/charts/heatmap_metrics/heatmap_metric_yarn');
+require('controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_gctime');
+require('controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_memHeapUsed');
require('controllers/main/charts/heatmap_metrics/heatmap_metric_hbase');
require('controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_readrequest');
require('controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_writerequest');
Modified: incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap.js?rev=1490445&r1=1490444&r2=1490445&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap.js (original)
+++ incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap.js Thu Jun 6 21:17:07 2013
@@ -61,6 +61,19 @@ App.MainChartsHeatmapController = Em.Con
);
}
+ if (App.YARNService.find().get('length')) {
+ metrics.push(
+ Em.Object.create({
+ label: Em.I18n.t('charts.heatmap.category.yarn'),
+ category: 'yarn',
+ items: [
+ App.MainChartHeatmapYarnGCTimeMillisMetric.create(),
+ App.MainChartHeatmapYarnMemHeapUsedMetric.create()
+ ]
+ })
+ );
+ }
+
if (App.HBaseService.find().get('length')) {
metrics.push(
Em.Object.create({
Added: incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn.js?rev=1490445&view=auto
==============================================================================
--- incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn.js (added)
+++ incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn.js Thu Jun 6 21:17:07 2013
@@ -0,0 +1,63 @@
+/**
+ * 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');
+
+/**
+ * Base class for any YARN metric.
+ */
+App.MainChartHeatmapYarnMetrics = App.MainChartHeatmapMetric.extend({
+ metricUrlTemplate: "/clusters/{clusterName}/services/YARN/components/NODEMANAGER?fields=host_components/{metricName}",
+
+ /**
+ * Custom mapper for DFS metrics
+ */
+ metricMapper: function (json) {
+ var hostToValueMap = {};
+ var metricName = this.get('defaultMetric');
+ if (json.host_components) {
+ var props = metricName.split('.');
+ transformValueFunction = this.get('transformValue');
+ json.host_components.forEach(function (hc) {
+ var value = hc;
+ props.forEach(function (prop) {
+ if (value != null && prop in value) {
+ value = value[prop];
+ } else {
+ value = null;
+ }
+ });
+ if (value != null) {
+ if (transformValueFunction) {
+ value = transformValueFunction(value);
+ }
+ var hostName = hc.HostRoles.host_name;
+ hostToValueMap[hostName] = value;
+ }
+ });
+ }
+ return hostToValueMap;
+ },
+
+ /**
+ * Utility function which allows extending classes to transform the value
+ * assigned to a host.
+ *
+ * @type Function
+ */
+ tranformValue: null
+});
Propchange: incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn.js
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_gctime.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_gctime.js?rev=1490445&view=auto
==============================================================================
--- incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_gctime.js (added)
+++ incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_gctime.js Thu Jun 6 21:17:07 2013
@@ -0,0 +1,29 @@
+/**
+ * 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');
+
+/**
+ *
+ */
+App.MainChartHeatmapYarnGCTimeMillisMetric = App.MainChartHeatmapYarnMetrics.extend({
+ name: Em.I18n.t('charts.heatmap.metrics.YarnGCTime'),
+ maximumValue: 10000,
+ defaultMetric: 'metrics.jvm.gcTimeMillis',
+ units: ' ms',
+ slotDefinitionLabelSuffix: ' ms'
+});
Propchange: incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_gctime.js
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_memHeapUsed.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_memHeapUsed.js?rev=1490445&view=auto
==============================================================================
--- incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_memHeapUsed.js (added)
+++ incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_memHeapUsed.js Thu Jun 6 21:17:07 2013
@@ -0,0 +1,29 @@
+/**
+ * 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');
+
+/**
+ *
+ */
+App.MainChartHeatmapYarnMemHeapUsedMetric = App.MainChartHeatmapYarnMetrics.extend({
+ name: Em.I18n.t('charts.heatmap.metrics.YarnMemHeapUsed'),
+ maximumValue: 512,
+ defaultMetric: 'metrics.jvm.memHeapUsedM',
+ units: 'MB',
+ slotDefinitionLabelSuffix: 'MB'
+});
Propchange: incubator/ambari/branches/branch-1.4.0/ambari-web/app/controllers/main/charts/heatmap_metrics/heatmap_metric_yarn_memHeapUsed.js
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/ambari/branches/branch-1.4.0/ambari-web/app/messages.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.4.0/ambari-web/app/messages.js?rev=1490445&r1=1490444&r2=1490445&view=diff
==============================================================================
--- incubator/ambari/branches/branch-1.4.0/ambari-web/app/messages.js (original)
+++ incubator/ambari/branches/branch-1.4.0/ambari-web/app/messages.js Thu Jun 6 21:17:07 2013
@@ -922,6 +922,7 @@ Em.I18n.translations = {
'charts.heatmap.item.host.process':'Total Running Processes',
'charts.heatmap.category.hdfs':'HDFS',
'charts.heatmap.category.mapreduce': 'MapReduce',
+ 'charts.heatmap.category.yarn': 'YARN',
'charts.heatmap.category.hbase': 'HBase',
'charts.heatmap.unknown': 'Unknown',
'charts.heatmap.label.notApplicable' :'Not Applicable',
@@ -932,8 +933,10 @@ Em.I18n.translations = {
'charts.heatmap.metrics.DFSMemHeapUsed' :'HDFS JVM Heap Memory Used',
'charts.heatmap.metrics.diskSpaceUsed' :'Host Disk Space Used %',
'charts.heatmap.metrics.MapReduceGCTime' :'MapReduce Garbage Collection Time',
+ 'charts.heatmap.metrics.YarnGCTime' :'YARN Garbage Collection Time',
'charts.heatmap.metrics.mapsRunning' :'MapReduce Maps Running',
'charts.heatmap.metrics.MRMemHeapUsed' :'MapReduce JVM Heap Memory Used',
+ 'charts.heatmap.metrics.YarnMemHeapUsed' :'YARN JVM Heap Memory Used',
'charts.heatmap.metrics.reducesRunning' :'MapReduce Reduces Running',
'charts.heatmap.metrics.memoryUsed' :'Host Memory Used %',
'charts.heatmap.metrics.processRun' :'Total Running Processes',