Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7810C17A4A for ; Sat, 11 Apr 2015 00:48:29 +0000 (UTC) Received: (qmail 86911 invoked by uid 500); 11 Apr 2015 00:48:29 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 86862 invoked by uid 500); 11 Apr 2015 00:48:29 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 86852 invoked by uid 99); 11 Apr 2015 00:48:29 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Apr 2015 00:48:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2F151E04D8; Sat, 11 Apr 2015 00:48:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jaimin@apache.org To: commits@ambari.apache.org Date: Sat, 11 Apr 2015 00:48:29 -0000 Message-Id: <7cbfb4d8eaac4770a1519f506f3d6829@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/3] ambari git commit: AMBARI-10427. Display service specific Heatmap in the respective service page. (jaimin) Repository: ambari Updated Branches: refs/heads/trunk 5dad81c3d -> dba8f6569 http://git-wip-us.apache.org/repos/asf/ambari/blob/dba8f656/ambari-web/app/controllers.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js index 816dbf5..68ff5d1 100644 --- a/ambari-web/app/controllers.js +++ b/ambari-web/app/controllers.js @@ -137,6 +137,7 @@ require('controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_compaction require('controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_regions'); require('controllers/main/charts/heatmap_metrics/heatmap_metric_hbase_memstoresize'); require('controllers/main/charts/heatmap'); +require('controllers/main/service/info/heatmap'); require('controllers/main/views_controller'); require('controllers/main/views/details_controller'); require('controllers/wizard/slave_component_groups_controller'); http://git-wip-us.apache.org/repos/asf/ambari/blob/dba8f656/ambari-web/app/controllers/main/charts/heatmap.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/charts/heatmap.js b/ambari-web/app/controllers/main/charts/heatmap.js index ecc57b3..02ccbed 100644 --- a/ambari-web/app/controllers/main/charts/heatmap.js +++ b/ambari-web/app/controllers/main/charts/heatmap.js @@ -22,6 +22,7 @@ App.MainChartsHeatmapController = Em.Controller.extend({ rackMap: [], modelRacks: [], rackViews: [], + loadRacksUrlParams: 'fields=Hosts/rack_info,Hosts/host_name,Hosts/public_host_name,Hosts/os_type,Hosts/ip,host_components,metrics/disk,metrics/cpu/cpu_system,metrics/cpu/cpu_user,metrics/memory/mem_total,metrics/memory/mem_free&minimal_response=true', racks: function () { return this.get('modelRacks'); @@ -33,10 +34,13 @@ App.MainChartsHeatmapController = Em.Controller.extend({ loadRacks: function () { this.get('modelRacks').clear(); this.get('rackMap').clear(); + var urlParams = this.get('loadRacksUrlParams'); App.ajax.send({ name: 'hosts.heatmaps', sender: this, - data: {}, + data: { + urlParams: urlParams + }, success: 'getHostsSuccessCallback' }); }, @@ -108,64 +112,13 @@ App.MainChartsHeatmapController = Em.Controller.extend({ // Display host heatmaps if the stack definition has a host metrics service to display it. if(App.get('services.hostMetrics').length) { - metrics.push( - Em.Object.create({ - label: Em.I18n.t('charts.heatmap.category.host'), - category: 'host', - items: [ - App.MainChartHeatmapDiskSpaceUsedMetric.create(), - App.MainChartHeatmapMemoryUsedMetric.create(), - App.MainChartHeatmapCpuWaitIOMetric.create() - /*, App.MainChartHeatmapProcessRunMetric.create()*/ - ] - }) - ); + metrics.pushObjects([ + App.MainChartHeatmapDiskSpaceUsedMetric.create(), + App.MainChartHeatmapMemoryUsedMetric.create(), + App.MainChartHeatmapCpuWaitIOMetric.create() + ]); } - if(App.HDFSService.find().get('length')) { - metrics.push( - Em.Object.create({ - label: Em.I18n.t('charts.heatmap.category.hdfs'), - category: 'hdfs', - items: [ - App.MainChartHeatmapDFSBytesReadMetric.create(), - App.MainChartHeatmapDFSBytesWrittenMetric.create(), - App.MainChartHeatmapDFSGCTimeMillisMetric.create(), - App.MainChartHeatmapDFSMemHeapUsedMetric.create() - ] - }) - ); - } - - 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(), - App.MainChartHeatmapYarnResourceUsedMetric.create() - ] - }) - ); - } - - if (App.HBaseService.find().get('length')) { - metrics.push( - Em.Object.create({ - label: Em.I18n.t('charts.heatmap.category.hbase'), - category: 'hbase', - items: [ - App.MainChartHeatmapHbaseReadReqCount.create(), - App.MainChartHeatmapHbaseWriteReqCount.create(), - App.MainChartHeatmapHbaseCompactionQueueSize.create(), - App.MainChartHeatmapHbaseRegions.create(), - App.MainChartHeatmapHbaseMemStoreSize.create() - ] - }) - ); - } return metrics; }.property(), @@ -213,7 +166,6 @@ App.MainChartsHeatmapController = Em.Controller.extend({ loadMetrics: function () { var selectedMetric = this.get('selectedMetric'); var hostNames = []; - if (selectedMetric && this.get('racks').everyProperty('isLoaded', true)) { this.get('racks').forEach(function (rack) { hostNames = hostNames.concat(rack.hosts.mapProperty('hostName')); http://git-wip-us.apache.org/repos/asf/ambari/blob/dba8f656/ambari-web/app/controllers/main/service/info/heatmap.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/info/heatmap.js b/ambari-web/app/controllers/main/service/info/heatmap.js new file mode 100644 index 0000000..467b8d7 --- /dev/null +++ b/ambari-web/app/controllers/main/service/info/heatmap.js @@ -0,0 +1,52 @@ +/** + * 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.MainServiceInfoHeatmapController = App.MainChartsHeatmapController.extend({ + name: 'mainServiceInfoHeatmapController', + allMetrics: function () { + var metrics = []; + var serviceName = this.get('content.serviceName'); + switch (serviceName) { + case 'HDFS': + metrics.pushObjects([ + App.MainChartHeatmapDFSBytesReadMetric.create(), + App.MainChartHeatmapDFSBytesWrittenMetric.create(), + App.MainChartHeatmapDFSGCTimeMillisMetric.create(), + App.MainChartHeatmapDFSMemHeapUsedMetric.create() + ]); + break; + case 'YARN': + metrics.pushObjects([ + App.MainChartHeatmapYarnGCTimeMillisMetric.create(), + App.MainChartHeatmapYarnMemHeapUsedMetric.create(), + App.MainChartHeatmapYarnResourceUsedMetric.create() + ]); + break; + case 'HBASE': + metrics.pushObjects([ + App.MainChartHeatmapHbaseReadReqCount.create(), + App.MainChartHeatmapHbaseWriteReqCount.create(), + App.MainChartHeatmapHbaseCompactionQueueSize.create(), + App.MainChartHeatmapHbaseRegions.create(), + App.MainChartHeatmapHbaseMemStoreSize.create() + ]); + break; + } + return metrics; + }.property('content.serviceName') +}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/dba8f656/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 4d7a811..38cf9a9 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -1660,6 +1660,7 @@ Em.I18n.translations = { 'services.service.info.menu.summary':'Summary', 'services.service.info.menu.configs':'Configs', + 'services.service.info.menu.heatmaps':'Heatmaps', 'services.service.info.summary.hostsRunningMonitor':'{0}/{1}', 'services.service.info.summary.serversHostCount':'{0} more', http://git-wip-us.apache.org/repos/asf/ambari/blob/dba8f656/ambari-web/app/models/stack_service.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/stack_service.js b/ambari-web/app/models/stack_service.js index 39995bb..e35f021 100644 --- a/ambari-web/app/models/stack_service.js +++ b/ambari-web/app/models/stack_service.js @@ -102,7 +102,7 @@ App.StackService = DS.Model.extend({ // Is the service required for reporting host metrics isHostMetricsService: function () { - var services = ['GANGLIA']; + var services = ['GANGLIA', 'AMBARI_METRICS']; return services.contains(this.get('serviceName')); }.property('serviceName'), @@ -155,6 +155,10 @@ App.StackService = DS.Model.extend({ return App.StackService.reviewPageHandlers[this.get('serviceName')]; }.property('serviceName'), + hasHeatmapSection: function() { + return ['HDFS', 'YARN', 'HBASE'].contains(this.get('serviceName')); + }.property('serviceName'), + /** * configCategories are fetched from App.StackService.configCategories. * Also configCategories that does not match any serviceComponent of a service and not included in the permissible default pattern are omitted http://git-wip-us.apache.org/repos/asf/ambari/blob/dba8f656/ambari-web/app/routes/main.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js index 5083549..f1e10f1 100644 --- a/ambari-web/app/routes/main.js +++ b/ambari-web/app/routes/main.js @@ -657,6 +657,18 @@ module.exports = Em.Route.extend(App.RouterRedirections, { } } }), + heatmaps: Em.Route.extend({ + route: '/heatmaps', + connectOutlets: function (router, context) { + var item = router.get('mainServiceItemController.content'); + if (item.get('isLoaded')) { + router.get('mainController').dataLoading().done(function () { + router.get('mainServiceInfoHeatmapController').loadRacks(); + router.get('mainServiceItemController').connectOutlet('mainServiceInfoHeatmap', item); + }); + } + } + }), audit: Em.Route.extend({ route: '/audit', connectOutlets: function (router, context) { http://git-wip-us.apache.org/repos/asf/ambari/blob/dba8f656/ambari-web/app/styles/application.less ---------------------------------------------------------------------- diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less index d4725f1..cd404dd 100644 --- a/ambari-web/app/styles/application.less +++ b/ambari-web/app/styles/application.less @@ -3964,6 +3964,14 @@ ul.filter { #heatmap-metric-title { margin-left: 23px; } + + #select-metric-btn-group { + margin-top:5px; + } + + li.heatmap-metrics-dropdown-links{ + cursor: pointer; + } .rack.rack-5-2 { .hosts { height: 86px; http://git-wip-us.apache.org/repos/asf/ambari/blob/dba8f656/ambari-web/app/templates/main/charts/heatmap.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/charts/heatmap.hbs b/ambari-web/app/templates/main/charts/heatmap.hbs index e1942bd..89a9a37 100644 --- a/ambari-web/app/templates/main/charts/heatmap.hbs +++ b/ambari-web/app/templates/main/charts/heatmap.hbs @@ -21,23 +21,16 @@
-
+
@@ -61,9 +54,15 @@

- {{controller.selectedMetric.name}} + + {{controller.selectedMetric.name}}   + {{#if controller.selectedMetric.loading}} + + {{/if}} +

+ {{#each rack in controller.racks}}
{{view App.MainChartsHeatmapRackView rackBinding="rack" }} http://git-wip-us.apache.org/repos/asf/ambari/blob/dba8f656/ambari-web/app/templates/main/service/item.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/main/service/item.hbs b/ambari-web/app/templates/main/service/item.hbs index eed34f2..f61bc1a 100644 --- a/ambari-web/app/templates/main/service/item.hbs +++ b/ambari-web/app/templates/main/service/item.hbs @@ -16,7 +16,7 @@ * limitations under the License. }} -{{view App.MainServiceInfoMenuView configTabBinding="view.hasConfigTab"}} +{{view App.MainServiceInfoMenuView configTabBinding="view.hasConfigTab" heatmapTabBinding="view.hasHeatmapTab"}}