Repository: ambari Updated Branches: refs/heads/branch-2.2 69d42f732 -> 0903f2e0f
AMBARI-14941 Convert Storm and Kafka to use enhanced dashboard widgets. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0903f2e0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0903f2e0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0903f2e0 Branch: refs/heads/branch-2.2 Commit: 0903f2e0fc4a31cd027a24830ef567f1aec19b24 Parents: 69d42f7 Author: Andrii Tkach <atk...@hortonworks.com> Authored: Fri Feb 5 17:15:14 2016 +0200 Committer: Andrii Tkach <atk...@hortonworks.com> Committed: Mon Feb 8 13:23:30 2016 +0200 ---------------------------------------------------------------------- .../stacks/HDP/2.3/services/KAFKA/widgets.json | 182 +++++++++++++++++++ .../stacks/HDP/2.3/services/STORM/widgets.json | 127 +++++++++++++ ambari-web/app/assets/test/tests.js | 1 - ambari-web/app/data/service_graph_config.js | 15 -- ambari-web/app/messages.js | 28 --- .../mixins/common/chart/storm_linear_time.js | 74 -------- .../app/mixins/common/widgets/widget_mixin.js | 2 +- ambari-web/app/views.js | 9 - .../app/views/common/chart/linear_time.js | 20 -- .../service/info/metrics/kafka/broker_topic.js | 50 ----- .../info/metrics/kafka/controller_status.js | 49 ----- .../info/metrics/kafka/kafka_controller.js | 41 ----- .../info/metrics/kafka/replica_fetcher.js | 41 ----- .../info/metrics/kafka/replica_manager.js | 46 ----- .../info/metrics/storm/executors_metric.js | 34 ---- .../info/metrics/storm/slots_number_metric.js | 42 ----- .../service/info/metrics/storm/tasks_metric.js | 34 ---- .../info/metrics/storm/topologies_metric.js | 34 ---- .../common/chart/storm_linear_time_test.js | 80 -------- 19 files changed, 310 insertions(+), 599 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/0903f2e0/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/widgets.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/widgets.json b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/widgets.json new file mode 100644 index 0000000..7237236 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/widgets.json @@ -0,0 +1,182 @@ +{ + "layouts": [ + { + "layout_name": "default_kafka_dashboard", + "display_name": "Standard Kafka Dashboard", + "section_name": "KAFKA_SUMMARY", + "widgetLayoutInfo": [ + { + "widget_name": "Broker Topics", + "description": "Broker Topics", + "widget_type": "GRAPH", + "is_visible": true, + "metrics": [ + { + "name": "kafka.server.BrokerTopicMetrics.BytesInPerSec.1MinuteRate", + "metric_path": "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesInPerSec/1MinuteRate", + "service_name": "KAFKA", + "component_name": "KAFKA_BROKER" + }, + { + "name": "kafka.server.BrokerTopicMetrics.BytesOutPerSec.1MinuteRate", + "metric_path": "metrics/kafka/server/BrokerTopicMetrics/AllTopicsBytesOutPerSec/1MinuteRate", + "service_name": "KAFKA", + "component_name": "KAFKA_BROKER" + }, + { + "name": "kafka.server.BrokerTopicMetrics.MessagesInPerSec.1MinuteRate", + "metric_path": "metrics/kafka/server/BrokerTopicMetrics/AllTopicsMessagesInPerSec/1MinuteRate", + "service_name": "KAFKA", + "component_name": "KAFKA_BROKER" + } + ], + "values": [ + { + "name": "Bytes In", + "value": "${kafka.server.BrokerTopicMetrics.BytesInPerSec.1MinuteRate}" + }, + { + "name": "Bytes Out", + "value": "${kafka.server.BrokerTopicMetrics.BytesOutPerSec.1MinuteRate}" + }, + { + "name": "Messages In", + "value": "${kafka.server.BrokerTopicMetrics.MessagesInPerSec.1MinuteRate}" + } + ], + "properties": { + "graph_type": "LINE", + "time_range": "1" + } + }, + { + "widget_name": "Active Controller Count", + "description": "Active Controller Count", + "widget_type": "GRAPH", + "is_visible": true, + "metrics": [ + { + "name": "kafka.controller.KafkaController.ActiveControllerCount", + "metric_path": "metrics/kafka/controller/KafkaController/ActiveControllerCount", + "service_name": "KAFKA", + "component_name": "KAFKA_BROKER" + } + ], + "values": [ + { + "name": "Active Controller Count", + "value": "${kafka.controller.KafkaController.ActiveControllerCount}" + } + ], + "properties": { + "graph_type": "LINE", + "time_range": "1" + } + }, + { + "widget_name": "Controller Status", + "description": "Controller Status", + "widget_type": "GRAPH", + "is_visible": true, + "metrics": [ + { + "name": "kafka.controller.ControllerStats.LeaderElectionRateAndTimeMs.1MinuteRate", + "metric_path": "metrics/kafka/controller/ControllerStats/LeaderElectionRateAndTimeMs/1MinuteRate", + "service_name": "KAFKA", + "component_name": "KAFKA_BROKER" + }, + { + "name": "kafka.controller.ControllerStats.UncleanLeaderElectionsPerSec.1MinuteRate", + "metric_path": "metrics/kafka/controller/ControllerStats/UncleanLeaderElectionsPerSec/1MinuteRate", + "service_name": "KAFKA", + "component_name": "KAFKA_BROKER" + } + ], + "values": [ + { + "name": "Leader Election Rate And Time", + "value": "${kafka.controller.ControllerStats.LeaderElectionRateAndTimeMs.1MinuteRate}" + }, + { + "name": "Unclean Leader Election", + "value": "${kafka.controller.ControllerStats.UncleanLeaderElectionsPerSec.1MinuteRate}" + } + ], + "properties": { + "graph_type": "LINE", + "time_range": "1" + } + }, + { + "widget_name": "Replica MaxLag", + "description": "Replica MaxLag", + "widget_type": "GRAPH", + "is_visible": true, + "metrics": [ + { + "name": "kafka.server.ReplicaFetcherManager.MaxLag.clientId.Replica", + "metric_path": "metrics/kafka/server/ReplicaFetcherManager/Replica-MaxLag", + "service_name": "KAFKA", + "component_name": "KAFKA_BROKER" + } + ], + "values": [ + { + "name": "Replica MaxLag", + "value": "${kafka.server.ReplicaFetcherManager.MaxLag.clientId.Replica}" + } + ], + "properties": { + "graph_type": "LINE", + "time_range": "1" + } + }, + { + "widget_name": "Replica Manager", + "description": "Replica Manager", + "widget_type": "GRAPH", + "is_visible": true, + "metrics": [ + { + "name": "kafka.server.ReplicaManager.PartitionCount", + "metric_path": "metrics/kafka/server/ReplicaManager/PartitionCount", + "service_name": "KAFKA", + "component_name": "KAFKA_BROKER" + }, + { + "name": "kafka.server.ReplicaManager.UnderReplicatedPartitions", + "metric_path": "metrics/kafka/server/ReplicaManager/UnderReplicatedPartitions", + "service_name": "KAFKA", + "component_name": "KAFKA_BROKER" + }, + { + "name": "kafka.server.ReplicaManager.LeaderCount", + "metric_path": "metrics/kafka/server/ReplicaManager/LeaderCount", + "service_name": "KAFKA", + "component_name": "KAFKA_BROKER" + } + ], + "values": [ + { + "name": "Partitions count", + "value": "${kafka.server.ReplicaManager.PartitionCount}" + }, + { + "name": "Under Replicated Partitions", + "value": "${kafka.server.ReplicaManager.UnderReplicatedPartitions}" + }, + { + "name": "Leader Count", + "value": "${kafka.server.ReplicaManager.LeaderCount}" + } + ], + "properties": { + "graph_type": "LINE", + "time_range": "1" + } + } + + ] + } + ] +} http://git-wip-us.apache.org/repos/asf/ambari/blob/0903f2e0/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/widgets.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/widgets.json b/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/widgets.json new file mode 100644 index 0000000..d22a1ed --- /dev/null +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/widgets.json @@ -0,0 +1,127 @@ +{ + "layouts": [ + { + "layout_name": "default_storm_dashboard", + "display_name": "Standard Storm Dashboard", + "section_name": "STORM_SUMMARY", + "widgetLayoutInfo": [ + { + "widget_name": "Number of Slots", + "description": "Number of Slots", + "widget_type": "GRAPH", + "is_visible": true, + "metrics": [ + { + "name": "Used Slots", + "metric_path": "metrics/storm/nimbus/usedslots", + "service_name": "STORM", + "component_name": "NIMBUS" + }, + { + "name": "Free Slots", + "metric_path": "metrics/storm/nimbus/freeslots", + "service_name": "STORM", + "component_name": "NIMBUS" + }, + { + "name": "Total Slots", + "metric_path": "metrics/storm/nimbus/totalslots", + "service_name": "STORM", + "component_name": "NIMBUS" + } + ], + "values": [ + { + "name": "Used slots", + "value": "${Used Slots}" + }, + { + "name": "Free slots", + "value": "${Free Slots}" + }, + { + "name": "Total slots", + "value": "${Total Slots}" + } + ], + "properties": { + "graph_type": "LINE", + "time_range": "1" + } + }, + { + "widget_name": "Number of executors", + "description": "Number of executors", + "widget_type": "GRAPH", + "is_visible": true, + "metrics": [ + { + "name": "Total Executors", + "metric_path": "metrics/storm/nimbus/totalexecutors", + "service_name": "STORM", + "component_name": "NIMBUS" + } + ], + "values": [ + { + "name": "Total executors", + "value": "${Total Executors}" + } + ], + "properties": { + "graph_type": "LINE", + "time_range": "1" + } + }, + { + "widget_name": "Number of topologies", + "description": "Number of topologies", + "widget_type": "GRAPH", + "is_visible": true, + "metrics": [ + { + "name": "Topologies", + "metric_path": "metrics/storm/nimbus/topologies", + "service_name": "STORM", + "component_name": "NIMBUS" + } + ], + "values": [ + { + "name": "Total topologies", + "value": "${Topologies}" + } + ], + "properties": { + "graph_type": "LINE", + "time_range": "1" + } + }, + { + "widget_name": "Number of tasks", + "description": "Number of tasks", + "widget_type": "GRAPH", + "is_visible": true, + "metrics": [ + { + "name": "Total Tasks", + "metric_path": "metrics/storm/nimbus/totaltasks", + "service_name": "STORM", + "component_name": "NIMBUS" + } + ], + "values": [ + { + "name": "Total tasks", + "value": "${Total Tasks}" + } + ], + "properties": { + "graph_type": "LINE", + "time_range": "1" + } + } + ] + } + ] +} http://git-wip-us.apache.org/repos/asf/ambari/blob/0903f2e0/ambari-web/app/assets/test/tests.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js index e710de2..9d5cbc1 100644 --- a/ambari-web/app/assets/test/tests.js +++ b/ambari-web/app/assets/test/tests.js @@ -144,7 +144,6 @@ var files = ['test/init_model_test', 'test/mixins/common/configs/enhanced_configs_test', 'test/mixins/common/configs/configs_saver_test', 'test/mixins/common/configs/toggle_isrequired_test', - 'test/mixins/common/chart/storm_linear_time_test', 'test/mixins/common/widgets/export_metrics_mixin_test', 'test/mixins/common/widgets/time_range_mixin_test', 'test/mixins/common/widgets/widget_section_test', http://git-wip-us.apache.org/repos/asf/ambari/blob/0903f2e0/ambari-web/app/data/service_graph_config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/service_graph_config.js b/ambari-web/app/data/service_graph_config.js index 1ae4a03..0d9fa9d 100644 --- a/ambari-web/app/data/service_graph_config.js +++ b/ambari-web/app/data/service_graph_config.js @@ -44,20 +44,5 @@ module.exports = { 'Flume_IncommingSum', 'Flume_OutgoingMMA', 'Flume_OutgoingSum' - ], - - 'storm': [ - 'STORM_SlotsNumber', - 'STORM_Executors', - 'STORM_Topologies', - 'STORM_Tasks' - ], - - 'kafka': [ - 'Kafka_BrokerTopicMetrics', - 'Kafka_Controller', - 'Kafka_ControllerStatus', - 'Kafka_ReplicaManager', - 'Kafka_ReplicaFetcher' ] }; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/0903f2e0/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 8240e1e..4bea211 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -452,16 +452,6 @@ Em.I18n.translations = { 'services.tez.description':'Tez is the next generation Hadoop Query Processing framework written on top of YARN', 'services.falcon.description': 'Falcon mirroring engine', 'services.storm.description': 'Apache Hadoop Stream processing framework', - 'services.storm.slots.metrics.title': 'Number of slots', - 'services.storm.slots.metrics.free': 'Free slots', - 'services.storm.slots.metrics.total': 'Total slots', - 'services.storm.slots.metrics.used': 'Used slots', - 'services.storm.executors.metrics.title': 'Number of executors', - 'services.storm.executors.metrics.total': 'Total executors', - 'services.storm.topology.metrics.title': 'Number of topologies', - 'services.storm.topology.metrics.total': 'Total topologies', - 'services.storm.tasks.metrics.title': 'Number of tasks', - 'services.storm.tasks.metrics.total': 'Total tasks', 'services.storm.configs.range-plugin-enable.dialog.title': 'Enable Ranger for STORM', 'services.storm.configs.range-plugin-enable.dialog.message': 'Enabling Ranger plugin for STORM is effective only on a secured cluster.', @@ -1838,24 +1828,6 @@ Em.I18n.translations = { 'services.service.info.metrics.yarn.apps.states.running': 'Running', 'services.service.info.metrics.yarn.apps.states.submitted': 'Submitted', - 'services.service.info.metrics.kafka.server.brokerTopic.title': 'Broker Topics', - 'services.service.info.metrics.kafka.server.brokerTopic.displayNames.AllTopicsBytesOutPerSec': 'Bytes Out', - 'services.service.info.metrics.kafka.server.brokerTopic.displayNames.AllTopicsBytesInPerSec': 'Bytes In', - 'services.service.info.metrics.kafka.server.brokerTopic.displayNames.AllTopicsMessagesInPerSec': 'Messages In', - 'services.service.info.metrics.kafka.server.ReplicaManager.title': 'Replica Manager', - 'services.service.info.metrics.kafka.server.ReplicaManager.displayNames.PartitionCount': 'Partitions count', - 'services.service.info.metrics.kafka.server.ReplicaManager.displayNames.UnderReplicatedPartitions': 'Under Replicated Partitions', - 'services.service.info.metrics.kafka.server.ReplicaManager.displayNames.LeaderCount': 'Leader Count', - 'services.service.info.metrics.kafka.controller.ControllerStats.title': 'Controller Status', - 'services.service.info.metrics.kafka.controller.ControllerStats.displayNames.LeaderElectionRateAndTimeMs': 'Leader Election Rate And Time', - 'services.service.info.metrics.kafka.controller.ControllerStats.displayNames.UncleanLeaderElectionsPerSec': 'Unclean Leader Election', - 'services.service.info.metrics.kafka.controller.KafkaController.title': 'Active Controller Count', - 'services.service.info.metrics.kafka.controller.KafkaController.displayNames.ActiveControllerCount': 'Active Controller Count', - 'services.service.info.metrics.kafka.log.LogFlushStats.title': 'Log Flush Status', - 'services.service.info.metrics.kafka.log.LogFlushStats.displayNames.LogFlushRateAndTimeMs': 'Log Flush Rate amd Time', - 'services.service.info.metrics.kafka.server.ReplicaFetcherManager.title': 'Replica MaxLag', - 'services.service.info.metrics.kafka.server.ReplicaFetcherManager.displayNames.Replica-MaxLag': 'Replica MaxLag', - 'services.service.info.menu.summary':'Summary', 'services.service.info.menu.configs':'Configs', 'services.service.info.menu.heatmaps':'Heatmaps', http://git-wip-us.apache.org/repos/asf/ambari/blob/0903f2e0/ambari-web/app/mixins/common/chart/storm_linear_time.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mixins/common/chart/storm_linear_time.js b/ambari-web/app/mixins/common/chart/storm_linear_time.js deleted file mode 100644 index 616f470..0000000 --- a/ambari-web/app/mixins/common/chart/storm_linear_time.js +++ /dev/null @@ -1,74 +0,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. - */ - - -var App = require('app'); - -App.StormLinearTimeChartMixin = Em.Mixin.create({ - ajaxIndex: 'service.metrics.storm.nimbus', - metricsTemplate: 'metrics/storm/nimbus/{0}[{1},{2},{3}]', - - getDataForAjaxRequest: function() { - var fromSeconds, - toSeconds, - index = this.get('isPopup') ? this.get('currentTimeIndex') : this.get('parentView.currentTimeRangeIndex'), - customStartTime = this.get('isPopup') ? this.get('customStartTime') : this.get('parentView.customStartTime'), - customEndTime = this.get('isPopup') ? this.get('customEndTime') : this.get('parentView.customEndTime'); - if (index === 8 && !Em.isNone(customStartTime) && !Em.isNone(customEndTime)) { - // Custom start and end time is specified by user - fromSeconds = customStartTime / 1000; - toSeconds = customEndTime / 1000; - } else { - // Preset time range is specified by user - toSeconds = Math.round(App.dateTime() / 1000); - fromSeconds = toSeconds - this.get('timeUnitSeconds') - } - var metricTemplate = []; - this.get('stormChartDefinition').forEach(function(chartInfo) { - metricTemplate.push( - this.get('metricsTemplate').format(chartInfo.field, fromSeconds, toSeconds, 15) - ); - }, this); - return { - metricsTemplate: metricTemplate.join(',') - }; - }, - - getData: function (jsonData) { - var dataArray = [], - pathKeys = ['metrics','storm','nimbus'], - validPath = true; - pathKeys.forEach(function(key) { - if (!jsonData[key]) { - validPath = false; - } else { - jsonData = jsonData[key]; - } - }); - if (!validPath) { - return dataArray; - } - this.get('stormChartDefinition').forEach(function(chart){ - dataArray.push({ - name: chart.name, - data: jsonData[chart.field] - }); - }, this); - return dataArray; - } -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/0903f2e0/ambari-web/app/mixins/common/widgets/widget_mixin.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mixins/common/widgets/widget_mixin.js b/ambari-web/app/mixins/common/widgets/widget_mixin.js index 97cf386..a6b13f2 100644 --- a/ambari-web/app/mixins/common/widgets/widget_mixin.js +++ b/ambari-web/app/mixins/common/widgets/widget_mixin.js @@ -42,7 +42,7 @@ App.WidgetMixin = Ember.Mixin.create({ * @type {RegExp} * @const */ - VALUE_NAME_REGEX: /[\w\.\,\:\=\[\]]+/g, + VALUE_NAME_REGEX: /(\w+\s+\w+)?[\w\.\,\:\=\[\]]+/g, /** * @type {string} http://git-wip-us.apache.org/repos/asf/ambari/blob/0903f2e0/ambari-web/app/views.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js index 2737425..7e461f9 100644 --- a/ambari-web/app/views.js +++ b/ambari-web/app/views.js @@ -286,15 +286,6 @@ require('views/main/service/info/metrics/flume/jvm_threads_runnable'); require('views/main/service/info/metrics/flume/cpu_user'); require('views/main/service/info/metrics/flume/flume_metric_graph'); require('views/main/service/info/metrics/flume/flume_metric_graphs'); -require('views/main/service/info/metrics/storm/slots_number_metric'); -require('views/main/service/info/metrics/storm/executors_metric'); -require('views/main/service/info/metrics/storm/tasks_metric'); -require('views/main/service/info/metrics/storm/topologies_metric'); -require('views/main/service/info/metrics/kafka/broker_topic'); -require('views/main/service/info/metrics/kafka/kafka_controller'); -require('views/main/service/info/metrics/kafka/controller_status'); -require('views/main/service/info/metrics/kafka/replica_manager'); -require('views/main/service/info/metrics/kafka/replica_fetcher'); require('views/main/service/add_view'); require('views/main/service/reassign_view'); http://git-wip-us.apache.org/repos/asf/ambari/blob/0903f2e0/ambari-web/app/views/common/chart/linear_time.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/chart/linear_time.js b/ambari-web/app/views/common/chart/linear_time.js index afd6a47..c4a7b81 100644 --- a/ambari-web/app/views/common/chart/linear_time.js +++ b/ambari-web/app/views/common/chart/linear_time.js @@ -265,26 +265,6 @@ App.ChartLinearTimeView = Ember.View.extend(App.ExportMetricsMixin, { }, /** - * Maps server data for Kafka Broker Topic and Controller Status metrics - * into series format ready for export to graph and JSON formats - * @param jsonData - * @returns {Array} - */ - getKafkaData: function (jsonData) { - var dataArray = [], - template = this.get('seriesTemplate'), - data = Em.get(jsonData, template.path); - for (var name in data) { - var displayName = template.displayName(name); - dataArray.push({ - name: displayName, - data: Em.get(data, name + '.1MinuteRate') - }); - } - return dataArray; - }, - - /** * Function to map data into graph series * @param jsonData * @returns {Array} http://git-wip-us.apache.org/repos/asf/ambari/blob/0903f2e0/ambari-web/app/views/main/service/info/metrics/kafka/broker_topic.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/info/metrics/kafka/broker_topic.js b/ambari-web/app/views/main/service/info/metrics/kafka/broker_topic.js deleted file mode 100644 index d584181..0000000 --- a/ambari-web/app/views/main/service/info/metrics/kafka/broker_topic.js +++ /dev/null @@ -1,50 +0,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. - */ - -var App = require('app'); - -/** - * @class - * - * This is a view for showing Kafka_BrokerTopicMetrics - * - * @extends App.ChartLinearTimeView - * @extends Ember.Object - * @extends Ember.View - */ -App.ChartServiceMetricsKafka_BrokerTopicMetrics = App.ChartLinearTimeView.extend({ - id: "service-metrics-kafka-broker-topic-metrics", - title: Em.I18n.t('services.service.info.metrics.kafka.server.brokerTopic.title'), - renderer: 'line', - ajaxIndex: 'service.metrics.kafka.broker.topic', - - seriesTemplate: { - path: 'metrics.kafka.server.BrokerTopicMetrics', - displayName: function (name) { - var displayNameMap = { - AllTopicsBytesOutPerSec: Em.I18n.t('services.service.info.metrics.kafka.server.brokerTopic.displayNames.AllTopicsBytesOutPerSec'), - AllTopicsBytesInPerSec: Em.I18n.t('services.service.info.metrics.kafka.server.brokerTopic.displayNames.AllTopicsBytesInPerSec'), - AllTopicsMessagesInPerSec: Em.I18n.t('services.service.info.metrics.kafka.server.brokerTopic.displayNames.AllTopicsMessagesInPerSec') - }; - return displayNameMap[name]; - } - }, - - getData: function (jsonData) { - return this.getKafkaData(jsonData); - } -}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/0903f2e0/ambari-web/app/views/main/service/info/metrics/kafka/controller_status.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/info/metrics/kafka/controller_status.js b/ambari-web/app/views/main/service/info/metrics/kafka/controller_status.js deleted file mode 100644 index 8610968..0000000 --- a/ambari-web/app/views/main/service/info/metrics/kafka/controller_status.js +++ /dev/null @@ -1,49 +0,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. - */ - -var App = require('app'); - -/** - * @class - * - * This is a view for showing Kafka_ControllerStatus - * - * @extends App.ChartLinearTimeView - * @extends Ember.Object - * @extends Ember.View - */ -App.ChartServiceMetricsKafka_ControllerStatus = App.ChartLinearTimeView.extend({ - id: "service-metrics-kafka-controler-status-metrics", - title: Em.I18n.t('services.service.info.metrics.kafka.controller.ControllerStats.title'), - renderer: 'line', - ajaxIndex: 'service.metrics.kafka.controller.ControllerStats', - - seriesTemplate: { - path: 'metrics.kafka.controller.ControllerStats', - displayName: function (name) { - var displayNameMap = { - LeaderElectionRateAndTimeMs: Em.I18n.t('services.service.info.metrics.kafka.controller.ControllerStats.displayNames.LeaderElectionRateAndTimeMs'), - UncleanLeaderElectionsPerSec: Em.I18n.t('services.service.info.metrics.kafka.controller.ControllerStats.displayNames.UncleanLeaderElectionsPerSec') - }; - return displayNameMap[name]; - } - }, - - getData: function (jsonData) { - return this.getKafkaData(jsonData); - } -}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/0903f2e0/ambari-web/app/views/main/service/info/metrics/kafka/kafka_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/info/metrics/kafka/kafka_controller.js b/ambari-web/app/views/main/service/info/metrics/kafka/kafka_controller.js deleted file mode 100644 index 2f4fdd1..0000000 --- a/ambari-web/app/views/main/service/info/metrics/kafka/kafka_controller.js +++ /dev/null @@ -1,41 +0,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. - */ - -var App = require('app'); - -/** - * @class - * - * This is a view for showing Kafka_Controller - * - * @extends App.ChartLinearTimeView - * @extends Ember.Object - * @extends Ember.View - */ -App.ChartServiceMetricsKafka_Controller = App.ChartLinearTimeView.extend({ - id: "service-metrics-kafka-controller-metrics", - title: Em.I18n.t('services.service.info.metrics.kafka.controller.KafkaController.title'), - renderer: 'line', - ajaxIndex: 'service.metrics.kafka.controller.KafkaController', - - seriesTemplate: { - path: 'metrics.kafka.controller.KafkaController', - displayName: function () { - return Em.I18n.t('services.service.info.metrics.kafka.controller.KafkaController.displayNames.ActiveControllerCount'); - } - } -}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/0903f2e0/ambari-web/app/views/main/service/info/metrics/kafka/replica_fetcher.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/info/metrics/kafka/replica_fetcher.js b/ambari-web/app/views/main/service/info/metrics/kafka/replica_fetcher.js deleted file mode 100644 index 7068c17..0000000 --- a/ambari-web/app/views/main/service/info/metrics/kafka/replica_fetcher.js +++ /dev/null @@ -1,41 +0,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. - */ - -var App = require('app'); - -/** - * @class - * - * This is a view for showing Kafka_ReplicaFetcher - * - * @extends App.ChartLinearTimeView - * @extends Ember.Object - * @extends Ember.View - */ -App.ChartServiceMetricsKafka_ReplicaFetcher = App.ChartLinearTimeView.extend({ - id: "service-metrics-kafka-replica-fetcher-metrics", - title: Em.I18n.t('services.service.info.metrics.kafka.server.ReplicaFetcherManager.title'), - renderer: 'line', - ajaxIndex: 'service.metrics.kafka.server.ReplicaFetcherManager', - - seriesTemplate: { - path: 'metrics.kafka.server.ReplicaFetcherManager', - displayName: function () { - return Em.I18n.t('services.service.info.metrics.kafka.server.ReplicaFetcherManager.displayNames.Replica-MaxLag'); - } - } -}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/0903f2e0/ambari-web/app/views/main/service/info/metrics/kafka/replica_manager.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/info/metrics/kafka/replica_manager.js b/ambari-web/app/views/main/service/info/metrics/kafka/replica_manager.js deleted file mode 100644 index 7452718..0000000 --- a/ambari-web/app/views/main/service/info/metrics/kafka/replica_manager.js +++ /dev/null @@ -1,46 +0,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. - */ - -var App = require('app'); - -/** - * @class - * - * This is a view for showing Kafka_BrokerTopicMetrics - * - * @extends App.ChartLinearTimeView - * @extends Ember.Object - * @extends Ember.View - */ -App.ChartServiceMetricsKafka_ReplicaManager = App.ChartLinearTimeView.extend({ - id: "service-metrics-kafka-replica-manager-metrics", - title: Em.I18n.t('services.service.info.metrics.kafka.server.ReplicaManager.title'), - renderer: 'line', - ajaxIndex: 'service.metrics.kafka.server.ReplicaManager', - - seriesTemplate: { - path: 'metrics.kafka.server.ReplicaManager', - displayName: function (name) { - var displayNameMap = { - LeaderCount: Em.I18n.t('services.service.info.metrics.kafka.server.ReplicaManager.displayNames.LeaderCount'), - UnderReplicatedPartitions: Em.I18n.t('services.service.info.metrics.kafka.server.ReplicaManager.displayNames.UnderReplicatedPartitions'), - PartitionCount: Em.I18n.t('services.service.info.metrics.kafka.server.ReplicaManager.displayNames.PartitionCount') - }; - return displayNameMap[name]; - } - } -}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/0903f2e0/ambari-web/app/views/main/service/info/metrics/storm/executors_metric.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/info/metrics/storm/executors_metric.js b/ambari-web/app/views/main/service/info/metrics/storm/executors_metric.js deleted file mode 100644 index 8eea33a..0000000 --- a/ambari-web/app/views/main/service/info/metrics/storm/executors_metric.js +++ /dev/null @@ -1,34 +0,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. - */ - -var App = require('app'); -require('mixins/common/chart/storm_linear_time'); - -App.ChartServiceMetricsSTORM_Executors = App.ChartLinearTimeView.extend(App.StormLinearTimeChartMixin, { - id: "service-metrics-storm-executors", - title: Em.I18n.t('services.storm.executors.metrics.title'), - renderer: 'line', - yAxisFormatter: App.ChartLinearTimeView.DefaultFormatter, - - stormChartDefinition: [ - { - name: Em.I18n.t('services.storm.executors.metrics.total'), - field: 'totalexecutors' - } - ] - -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/0903f2e0/ambari-web/app/views/main/service/info/metrics/storm/slots_number_metric.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/info/metrics/storm/slots_number_metric.js b/ambari-web/app/views/main/service/info/metrics/storm/slots_number_metric.js deleted file mode 100644 index 543508b..0000000 --- a/ambari-web/app/views/main/service/info/metrics/storm/slots_number_metric.js +++ /dev/null @@ -1,42 +0,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. - */ - -var App = require('app'); -require('mixins/common/chart/storm_linear_time'); - -App.ChartServiceMetricsSTORM_SlotsNumber = App.ChartLinearTimeView.extend(App.StormLinearTimeChartMixin, { - id: "service-metrics-storm-supervisor-allocated", - title: Em.I18n.t('services.storm.slots.metrics.title'), - renderer: 'line', - yAxisFormatter: App.ChartLinearTimeView.DefaultFormatter, - - stormChartDefinition: [ - { - name: Em.I18n.t('services.storm.slots.metrics.total'), - field: 'totalslots' - }, - { - name: Em.I18n.t('services.storm.slots.metrics.free'), - field: 'freeslots' - }, - { - name: Em.I18n.t('services.storm.slots.metrics.used'), - field: 'usedslots' - } - ] - -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/0903f2e0/ambari-web/app/views/main/service/info/metrics/storm/tasks_metric.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/info/metrics/storm/tasks_metric.js b/ambari-web/app/views/main/service/info/metrics/storm/tasks_metric.js deleted file mode 100644 index a70d358..0000000 --- a/ambari-web/app/views/main/service/info/metrics/storm/tasks_metric.js +++ /dev/null @@ -1,34 +0,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. - */ - -var App = require('app'); -require('mixins/common/chart/storm_linear_time'); - -App.ChartServiceMetricsSTORM_Tasks = App.ChartLinearTimeView.extend(App.StormLinearTimeChartMixin, { - id: "service-metrics-storm-tasks", - title: Em.I18n.t('services.storm.tasks.metrics.title'), - renderer: 'line', - yAxisFormatter: App.ChartLinearTimeView.DefaultFormatter, - - stormChartDefinition: [ - { - name: Em.I18n.t('services.storm.tasks.metrics.total'), - field: 'totaltasks' - } - ] - -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/0903f2e0/ambari-web/app/views/main/service/info/metrics/storm/topologies_metric.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/service/info/metrics/storm/topologies_metric.js b/ambari-web/app/views/main/service/info/metrics/storm/topologies_metric.js deleted file mode 100644 index d831453..0000000 --- a/ambari-web/app/views/main/service/info/metrics/storm/topologies_metric.js +++ /dev/null @@ -1,34 +0,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. - */ - -var App = require('app'); -require('mixins/common/chart/storm_linear_time'); - -App.ChartServiceMetricsSTORM_Topologies = App.ChartLinearTimeView.extend(App.StormLinearTimeChartMixin, { - id: "service-metrics-storm-topologies", - title: Em.I18n.t('services.storm.topology.metrics.title'), - renderer: 'line', - yAxisFormatter: App.ChartLinearTimeView.DefaultFormatter, - - stormChartDefinition: [ - { - name: Em.I18n.t('services.storm.topology.metrics.total'), - field: 'topologies' - } - ] - -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/0903f2e0/ambari-web/test/mixins/common/chart/storm_linear_time_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/mixins/common/chart/storm_linear_time_test.js b/ambari-web/test/mixins/common/chart/storm_linear_time_test.js deleted file mode 100644 index 9a573a4..0000000 --- a/ambari-web/test/mixins/common/chart/storm_linear_time_test.js +++ /dev/null @@ -1,80 +0,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. - */ - -var App = require('app'); - -require('mixins/common/chart/storm_linear_time'); - -var slt, - template, - series, - jsonDataFalse = { - metrics: { - id: 'metrics' - } - }, - jsonDataTrue = { - metrics: { - storm: { - nimbus: { - name: 'nimbus' - } - } - } - }; - -describe('App.StormLinearTimeChartMixin', function () { - - beforeEach(function () { - slt = Em.Object.create(App.StormLinearTimeChartMixin, { - stormChartDefinition: [ - { - field: 'name', - name: 'nimbus' - } - ] - }); - }); - - describe('#getDataForAjaxRequest', function () { - it('should take data from stormChartDefinition', function () { - template = slt.getDataForAjaxRequest().metricsTemplate; - expect(template).to.contain('metrics'); - expect(template).to.contain('storm'); - expect(template).to.contain('nimbus'); - }); - }); - - describe('#getData', function () { - it('should be empty', function () { - expect(slt.getData(jsonDataFalse)).to.be.empty; - }); - it('should take one element from data', function () { - slt.set('transformData', function (data, name) { - return name + ': ' + JSON.stringify(data); - }); - series = slt.getData(jsonDataTrue); - expect(series).to.have.length(1); - expect(series[0]).to.eql({ - name: 'nimbus', - data: 'nimbus' - }); - }); - }); - -});