You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eagle.apache.org by jj...@apache.org on 2017/02/22 06:28:50 UTC
[1/4] eagle git commit: [EAGLE-900] Only show left navigation item
(HDFS, HBase) when we install the JMX application
Repository: eagle
Updated Branches:
refs/heads/master c0198a0ce -> c32b71525
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-metric/pom.xml b/eagle-metric/pom.xml
new file mode 100644
index 0000000..6bdf434
--- /dev/null
+++ b/eagle-metric/pom.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>eagle-parent</artifactId>
+ <groupId>org.apache.eagle</groupId>
+ <version>0.5.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>eagle-metric-parent</artifactId>
+ <name>Eagle::App::HadoopMetric</name>
+ <packaging>pom</packaging>
+ <modules>
+ <module>eagle-hadoop-metric</module>
+ <module>eagle-hdfs-web</module>
+ <module>eagle-hbase-web</module>
+ </modules>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.eagle</groupId>
+ <artifactId>eagle-app-base</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.ow2.asm</groupId>
+ <artifactId>asm</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.eagle</groupId>
+ <artifactId>eagle-topology-app</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <configuration>
+ <failOnViolation>true</failOnViolation>
+ <failsOnError>true</failsOnError>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-server/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-server/pom.xml b/eagle-server/pom.xml
index 6bb9fbd..c2cefcd 100644
--- a/eagle-server/pom.xml
+++ b/eagle-server/pom.xml
@@ -336,6 +336,17 @@
<artifactId>eagle-hadoop-metric</artifactId>
<version>${project.version}</version>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.eagle</groupId>
+ <artifactId>eagle-hdfs-web</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.eagle</groupId>
+ <artifactId>eagle-hbase-web</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
</profile>
</profiles>
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-topology-assembly/src/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
----------------------------------------------------------------------
diff --git a/eagle-topology-assembly/src/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider b/eagle-topology-assembly/src/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
index f50fc1d..54650bd 100644
--- a/eagle-topology-assembly/src/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
+++ b/eagle-topology-assembly/src/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
@@ -28,4 +28,8 @@ org.apache.eagle.jpm.aggregation.AggregationApplicationProvider
org.apache.eagle.hadoop.queue.HadoopQueueRunningAppProvider
org.apache.eagle.topology.TopologyCheckAppProvider
org.apache.eagle.metric.HadoopMetricMonitorAppProdiver
-org.apache.eagle.jpm.spark.history.SparkHistoryJobAppProvider
\ No newline at end of file
+org.apache.eagle.jpm.spark.history.SparkHistoryJobAppProvider
+
+## Metric
+org.apache.eagle.metric.HdfsMetricWebApplicationProvider
+org.apache.eagle.metric.HBaseMetricWebApplicationProvider
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a47309f..daa24a2 100755
--- a/pom.xml
+++ b/pom.xml
@@ -131,7 +131,7 @@
<module>eagle-topology-assembly</module>
<module>eagle-examples</module>
<module>eagle-gc</module>
- <module>eagle-hadoop-metric</module>
+ <module>eagle-metric</module>
<module>eagle-server</module>
<module>eagle-jpm</module>
<module>eagle-server-assembly</module>
[3/4] eagle git commit: [EAGLE-900] Only show left navigation item
(HDFS, HBase) when we install the JMX application
Posted by jj...@apache.org.
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/region/regionList.html
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/region/regionList.html b/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/region/regionList.html
deleted file mode 100644
index d1a7440..0000000
--- a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/region/regionList.html
+++ /dev/null
@@ -1,53 +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.
- -->
-<div class="box box-primary">
- <div class="box-header with-border">
- <h3 class="box-title">
- <span ng-show="!regionserverList._done || isSorting" class="fa fa-refresh fa-spin no-animate"></span>
- </h3>
- </div>
- <div class="box-body">
- <div id="regionserverList" sort-table="regionserverList" is-sorting="isSorting"
- search-path-list="searchPathList"
- scope="tableScope">
- <table class="table table-bordered">
- <thead>
- <tr>
- <th sortpath="tags.hostname">RegionServer</th>
- <th sortpath="tags.rack">Rack</th>
- <th sortpath="tags.site">SiteId</th>
- <th sortpath="status">Status</th>
- </tr>
- </thead>
- <tbody>
- <tr ng-repeat="item in regionserverList">
- <td>
- <a ui-sref="regionDetail({siteId: site, hostname: item.tags.hostname})">{{item.tags.hostname}}</a>
- </td>
- <td>{{item.tags.rack}}</td>
- <td>{{item.tags.site}}</td>
- <td>
- <span ng-if="item.status===live" class="label label-success">Healthy</span>
- <span ng-if="item.status===dead" class="label label-danger">UnHealthy</span>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
-</div>
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/style/index.css
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/style/index.css b/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/style/index.css
deleted file mode 100644
index aa215ab..0000000
--- a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/style/index.css
+++ /dev/null
@@ -1,88 +0,0 @@
-@CHARSET "UTF-8";
-/*
- * 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.
- */
-
-.hadoopMetric-chart {
- position: relative;
- margin-bottom: 15px;
-}
-
-.hadoopMetric-chart h3 {
- font-size: 20px;
- margin: 10px 0 0 0;
-}
-
-.hadoopMetric-chart .hadoopMetric-chart-container {
- height: 300px;
- position: relative;
-}
-
-.hadoopMetric-chart .hadoopMetric-no-chart-data {
- position:absolute;
- left: 38%;
- top: 40%;
- font-size: 20px;
- color: #999;
-}
-
-.with-border .hadoopMetric-chart {
- padding-bottom: 15px;
- margin-bottom: 15px;
- border-bottom: 1px solid #f4f4f4;
-}
-
-.with-border .hadoopMetric-chart:last-child {
- padding-bottom: 0;
- margin-bottom: 0;
- border-bottom: 0;
-}
-
-.hadoopMetric-widget {
- width: 100%;
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
- border-radius: 2px;
- padding: 10px;
-}
-
-.hadoopMetric-widget h3 {
- margin: 0;
- padding: 0;
-}
-
-.hadoopMetric-widget .hadoopMetric-chart-container {
- height: 100px;
-}
-
-.hadoopMetric-summary-a {
- color: #fff;
-}
-
-.small-box.hadoopMetric-widget {
- margin: 0;
- height: 100%;
- min-height: 110px;
-}
-
-.hadoopMetric-widget-detail {
- margin-left: 12px;
- margin-top: 10px;
-}
-
-.hadoopMetric-table {
- text-align: right;
-}
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/widgets/availabilityChart.js
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/widgets/availabilityChart.js b/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/widgets/availabilityChart.js
deleted file mode 100644
index 2359c59..0000000
--- a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/widgets/availabilityChart.js
+++ /dev/null
@@ -1,145 +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.
- */
-
-(function () {
- /**
- * `register` without params will load the module which using require
- */
- register(function (hadoopMetricApp) {
- var COLOR_MAPPING = {
- HDFS: 'orange',
- HBase: 'yellow',
- Yarn: 'green'
- };
-
- hadoopMetricApp.directive("hadoopMetricWidget", function () {
- return {
- restrict: 'AE',
- controller: function ($scope, $attrs, METRIC, Application, $interval, Site, $wrapState) {
- // Get site
- var site = $scope.site;
- var refreshInterval;
-
- if(!site) {
- $scope.list = $.map(Application.find("HADOOP_METRIC_MONITOR"), function (app) {
- return {
- siteId: app.site.siteId,
- siteName: app.site.siteName || app.site.siteId
- };
- });
- } else {
- $scope.list = [{
- siteId: site.siteId,
- siteName: site.siteName || site.siteId
- }];
- }
- // Get type
- $scope.type = $attrs.type;
-
- // Customize chart color
- $scope.bgColor = COLOR_MAPPING[$scope.type];
-
- function countHBaseRole(site, status, role, groups, filed, limit) {
- var jobCond = {
- site: site,
- status: status,
- role: role
- };
- return METRIC.aggHBaseInstance(jobCond, groups, filed, limit);
- }
-
- // Ref: jpm widget if need keep refresh the widget
-
- function refresh() {
- $.each($scope.list, function (i, site) {
-
- countHBaseRole(site.siteId, "active", "hmaster", ["site"], "count")._promise.then(function (res) {
- $.map(res, function (data) {
- $scope.hmasteractivenum = data.value[0];
- });
- });
- countHBaseRole(site.siteId, "standby", "hmaster", ["site"], "count")._promise.then(function (res) {
- $.map(res, function (data) {
- $scope.hmasterstandbynum = data.value[0];
- });
- });
- countHBaseRole(site.siteId, "live", "regionserver", ["site"], "count")._promise.then(function (res) {
- $.map(res, function (data) {
- $scope.regionserverhealtynum = data.value[0];
- });
- });
- countHBaseRole(site.siteId, "dead", "regionserver", ["site"], "count")._promise.then(function (res) {
- $.map(res, function (data) {
- $scope.regionserverunhealtynum = data.value[0];
- });
- });
- });
- }
-
- refresh();
- refreshInterval = $interval(refresh, 30 * 1000);
-
- $scope.$on('$destroy', function () {
- $interval.cancel(refreshInterval);
- });
- },
- template:
- '<div class="small-box hadoopMetric-widget bg-{{bgColor}}">' +
- '<div class="inner">' +
- '<h3>{{type}}</h3>' +
- '<div ng-show="hmasteractivenum" class="hadoopMetric-widget-detail">' +
- '<a ui-sref="HadoopMetric({siteId: site.siteId})">' +
- '<span>{{hmasteractivenum+hmasterstandbynum}}</span> Masters (' +
- '<span ng-show="hmasteractivenum">{{hmasteractivenum}}</span><span ng-show="!hmasteractivenum">0</span> Active / ' +
- '<span ng-show="hmasterstandbynum">{{hmasterstandbynum}}</span><span ng-show="!hmasterstandbynum">0</span> Standby)' +
- '</a>' +
- '</div>' +
- '<div ng-show="!hmasteractivenum" class="hadoopMetric-widget-detail">' +
- '<span class="fa fa-question-circle"></span><span> NO DATA</span>' +
- '</div>' +
- '<div ng-show="hmasteractivenum" class="hadoopMetric-widget-detail">' +
- '<a ui-sref="regionList({siteId: site.siteId})">' +
- '<span>{{regionserverhealtynum+regionserverunhealtynum}}</span> RegionServers (' +
- '<span ng-show="regionserverhealtynum">{{regionserverhealtynum}}</span><span ng-show="!regionserverhealtynum">0</span> Healthy / ' +
- '<span ng-show="regionserverunhealtynum">{{regionserverunhealtynum}}</span><span ng-show="!regionserverunhealtynum">0</span> Unhealthy)' +
- '</a>' +
- '</div>' +
- '</div>' +
- '<div class="icon">' +
- '<i class="fa fa-taxi"></i>' +
- '</div>' +
- '</div>',
- replace: true
- };
- });
-
- function withType(serviceType) {
- /**
- * Customize the widget content. Return false will prevent auto compile.
- * @param {{}} $element
- * @param {function} $element.append
- */
- return function registerWidget($element) {
- $element.append(
- $("<div hadoop-metric-widget data-type='" + serviceType + "'>")
- );
- };
- }
- hadoopMetricApp.widget("availabilityHBaseChart", withType('HBase'), true);
- });
-})();
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/webapp/app/apps/index.html
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/webapp/app/apps/index.html b/eagle-hadoop-metric/src/main/webapp/app/apps/index.html
deleted file mode 100644
index 191ea15..0000000
--- a/eagle-hadoop-metric/src/main/webapp/app/apps/index.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<htm>
- <body>
- <h1>Hadoop Metric Monitor Application!</h1>
- <i><b>url</b>: /apps/hadoop_metric</i>
- </body>
-</htm>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/HadoopMetricMonitorAppDebug.java
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/HadoopMetricMonitorAppDebug.java b/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/HadoopMetricMonitorAppDebug.java
deleted file mode 100644
index 03ba4ee..0000000
--- a/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/HadoopMetricMonitorAppDebug.java
+++ /dev/null
@@ -1,23 +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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.
- */
-package org.apache.eagle.metric;
-
-public class HadoopMetricMonitorAppDebug {
- public static void main(String[] args) {
- new HadoopMetricMonitorApp().run(args);
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/HadoopMetricMonitorAppProviderTest.java
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/HadoopMetricMonitorAppProviderTest.java b/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/HadoopMetricMonitorAppProviderTest.java
deleted file mode 100644
index 94e1b82..0000000
--- a/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/HadoopMetricMonitorAppProviderTest.java
+++ /dev/null
@@ -1,89 +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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.
- */
-package org.apache.eagle.metric;
-
-
-import com.google.inject.Inject;
-import org.apache.eagle.app.resource.ApplicationResource;
-import org.apache.eagle.app.service.ApplicationOperations;
-import org.apache.eagle.app.test.ApplicationSimulator;
-import org.apache.eagle.app.test.ApplicationTestBase;
-import org.apache.eagle.metadata.model.ApplicationEntity;
-import org.apache.eagle.metadata.model.SiteEntity;
-import org.apache.eagle.metadata.resource.SiteResource;
-import org.apache.eagle.metadata.service.ApplicationStatusUpdateService;
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class HadoopMetricMonitorAppProviderTest extends ApplicationTestBase {
-
- @Inject
- private SiteResource siteResource;
- @Inject
- private ApplicationResource applicationResource;
- @Inject
- private ApplicationSimulator simulator;
- @Inject
- ApplicationStatusUpdateService statusUpdateService;
-
- @Test
- public void testApplicationLifecycle() throws InterruptedException {
- // Create local site
- SiteEntity siteEntity = new SiteEntity();
- siteEntity.setSiteId("test_site");
- siteEntity.setSiteName("Test Site");
- siteEntity.setDescription("Test Site for HADOOP_METRIC_MONITOR");
- siteResource.createSite(siteEntity);
- Assert.assertNotNull(siteEntity.getUuid());
-
- ApplicationOperations.InstallOperation installOperation = new ApplicationOperations.InstallOperation("test_site", "HADOOP_METRIC_MONITOR", ApplicationEntity.Mode.LOCAL);
- installOperation.setConfiguration(getConf());
-
- //Install dependency
- ApplicationOperations.InstallOperation installOperationDependency = new ApplicationOperations.InstallOperation("test_site", "TOPOLOGY_HEALTH_CHECK_APP", ApplicationEntity.Mode.LOCAL);
- applicationResource.installApplication(installOperationDependency);
-
- // Install application
- ApplicationEntity applicationEntity = applicationResource.installApplication(installOperation).getData();
- // Uninstall application
- applicationResource.uninstallApplication(new ApplicationOperations.UninstallOperation(applicationEntity.getUuid()));
- try {
- applicationResource.getApplicationEntityByUUID(applicationEntity.getUuid());
- Assert.fail("Application instance (UUID: " + applicationEntity.getUuid() + ") should have been uninstalled");
- } catch (Exception ex) {
- // Expected exception
- }
- }
-
- private Map<String, Object> getConf() {
- Map<String, Object> conf = new HashMap<>();
- conf.put("dataSinkConfig.topic", "testTopic");
- conf.put("dataSinkConfig.brokerList", "broker");
- conf.put("dataSinkConfig.serializerClass", "serializerClass");
- conf.put("dataSinkConfig.keySerializerClass", "keySerializerClass");
- conf.put("dataSinkConfig.producerType", "async");
- conf.put("dataSinkConfig.numBatchMessages", 4096);
- conf.put("dataSinkConfig.maxQueueBufferMs", 5000);
- conf.put("dataSinkConfig.requestRequiredAcks", 0);
- conf.put("spoutNum", 2);
- conf.put("mode", "LOCAL");
- return conf;
- }
-}
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/SendSampleDataToKafka.java
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/SendSampleDataToKafka.java b/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/SendSampleDataToKafka.java
deleted file mode 100644
index 026f60b..0000000
--- a/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/SendSampleDataToKafka.java
+++ /dev/null
@@ -1,56 +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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.
- */
-package org.apache.eagle.metric;
-
-import com.typesafe.config.ConfigFactory;
-import kafka.producer.KeyedMessage;
-import kafka.producer.ProducerConfig;
-import org.apache.eagle.app.messaging.KafkaStreamProvider;
-import org.apache.eagle.app.messaging.KafkaStreamSinkConfig;
-
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.util.Properties;
-
-public class SendSampleDataToKafka {
- public static void main(String[] args) throws URISyntaxException, IOException {
- String data = "{" +
- "\"host\":\"localhost\", " +
- "\"timestamp\": 1480319109000, " +
- "\"metric\": \"hadoop.cpu.usage\", " +
- "\"component\": \"namenode\", " +
- "\"site\": \"test\", " +
- "\"value\": 0.98}";
- KafkaStreamSinkConfig config = new KafkaStreamProvider().getSinkConfig("HADOOP_JMX_METRIC_STREAM",ConfigFactory.load());
- Properties properties = new Properties();
- properties.put("metadata.broker.list", config.getBrokerList());
- properties.put("serializer.class", config.getSerializerClass());
- properties.put("key.serializer.class", config.getKeySerializerClass());
- // new added properties for async producer
- properties.put("producer.type", config.getProducerType());
- properties.put("batch.num.messages", config.getNumBatchMessages());
- properties.put("request.required.acks", config.getRequestRequiredAcks());
- properties.put("queue.buffering.max.ms", config.getMaxQueueBufferMs());
- ProducerConfig producerConfig = new ProducerConfig(properties);
- kafka.javaapi.producer.Producer producer = new kafka.javaapi.producer.Producer(producerConfig);
- try {
- producer.send(new KeyedMessage(config.getTopicId(), data));
- } finally {
- producer.close();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/test/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/test/resources/application.conf b/eagle-hadoop-metric/src/test/resources/application.conf
deleted file mode 100644
index 8ff6016..0000000
--- a/eagle-hadoop-metric/src/test/resources/application.conf
+++ /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.
-
-
-
-
-{
- service {
- env = "testing"
- host = "localhost"
- port = 9090
- username = "admin"
- password = "secret"
- readTimeOutSeconds = 60
- context = "/rest"
- timezone = "UTC"
- }
-
- "appId" : "HadoopJmxAppForTest",
- "mode" : "LOCAL",
- "siteId" : "testsite",
- "dataSourceConfig": {
- "topic" : "hadoop_jmx_metric",
- "zkConnection" : "localhost:2181",
- "txZkServers" : "localhost:2181"
- }
- "dataSinkConfig": {
- "topic" : "hadoop_jmx_metric",
- "brokerList" : "localhost:6667",
- "serializerClass" : "kafka.serializer.StringEncoder",
- "keySerializerClass" : "kafka.serializer.StringEncoder"
- "producerType" : "async",
- "numBatchMessages" : "4096",
- "maxQueueBufferMs" : "5000",
- "requestRequiredAcks" : "0"
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/test/resources/hadoop_jmx_metric_sample.json
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/test/resources/hadoop_jmx_metric_sample.json b/eagle-hadoop-metric/src/test/resources/hadoop_jmx_metric_sample.json
deleted file mode 100644
index 68472a0..0000000
--- a/eagle-hadoop-metric/src/test/resources/hadoop_jmx_metric_sample.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "host":"localhost",
- "timestamp": 1480319107000,
- "metric": "hadoop.cpu.usage",
- "component": "namenode",
- "site": "test",
- "value": 0.96
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/test/resources/integrate_test_policy.json
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/test/resources/integrate_test_policy.json b/eagle-hadoop-metric/src/test/resources/integrate_test_policy.json
deleted file mode 100644
index e9de11c..0000000
--- a/eagle-hadoop-metric/src/test/resources/integrate_test_policy.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "name": "TEST_POLICY",
- "description": "from HADOOP_JMX_METRIC_STREAM_SANDBOX[site==\"test\"] insert into ALERT_STREAM;",
- "inputStreams": [
- "HADOOP_JMX_METRIC_STREAM_SANDBOX"
- ],
- "outputStreams": [
- "ALERT_STREAM"
- ],
- "definition": {
- "type": "siddhi",
- "value": "from HADOOP_JMX_METRIC_STREAM_SANDBOX[site==\"test\"] select component,value, name insert into ALERT_STREAM;",
- "handlerClass": null,
- "properties": {},
- "inputStreams": [],
- "outputStreams": []
- },
- "stateDefinition": null,
- "policyStatus": "ENABLED",
- "alertDefinition": {
- "templateType": "TEXT",
- "subject": "$component Disk Usage $value",
- "body": "#set($usage_percentage = $value * 100)\r\n\r\nDisk Usage (<strong>$metric<strong>) reached <span style=\"color:red\">$usage_percentage %</span> (Threshold: 90%) on <strong>$component</strong> of cluster: <strong>$site</strong> on:\r\n<ul>\r\n <li><strong>Hostname</strong>: $host</li>\r\n <li><strong>When</strong>: $ALERT_TIME</li>\r\n <li><strong>Root Cause</strong>: UNKNOWN</li>\r\n <li><strong>Action Required</strong>: N/A</li>\r\n</ul>",
- "severity": "CRITICAL",
- "category": "HDFS"
- },
- "partitionSpec": [
- {
- "streamId": "HADOOP_JMX_METRIC_STREAM_SANDBOX",
- "type": "SHUFFLE",
- "columns": [],
- "sortSpec": null
- }
- ],
- "dedicated": false,
- "parallelismHint": 5
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hadoop-metric/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hadoop-metric/pom.xml b/eagle-metric/eagle-hadoop-metric/pom.xml
new file mode 100644
index 0000000..21c351c
--- /dev/null
+++ b/eagle-metric/eagle-hadoop-metric/pom.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>eagle-metric-parent</artifactId>
+ <groupId>org.apache.eagle</groupId>
+ <version>0.5.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>eagle-hadoop-metric</artifactId>
+ <name>Eagle::App::HadoopMetric</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.eagle</groupId>
+ <artifactId>eagle-app-base</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hadoop-metric/src/main/java/org/apache/eagle/metric/HadoopMetricMonitorApp.java
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hadoop-metric/src/main/java/org/apache/eagle/metric/HadoopMetricMonitorApp.java b/eagle-metric/eagle-hadoop-metric/src/main/java/org/apache/eagle/metric/HadoopMetricMonitorApp.java
new file mode 100644
index 0000000..304e500
--- /dev/null
+++ b/eagle-metric/eagle-hadoop-metric/src/main/java/org/apache/eagle/metric/HadoopMetricMonitorApp.java
@@ -0,0 +1,41 @@
+/*
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.apache.eagle.metric;
+
+import backtype.storm.generated.StormTopology;
+import com.typesafe.config.Config;
+import org.apache.eagle.app.StormApplication;
+import org.apache.eagle.app.environment.builder.MetricDefinition;
+import org.apache.eagle.app.environment.impl.StormEnvironment;
+
+import java.util.Calendar;
+
+public class HadoopMetricMonitorApp extends StormApplication {
+ @Override
+ public StormTopology execute(Config config, StormEnvironment environment) {
+ return environment.newApp(config)
+ .fromStream("HADOOP_JMX_METRIC_STREAM")
+ .saveAsMetric(MetricDefinition
+ .metricType("HADOOP_JMX_METRICS")
+ .namedByField("metric")
+ .eventTimeByField("timestamp")
+ .dimensionFields("host","component","site")
+ .granularity(Calendar.MINUTE)
+ .valueField("value"))
+ .toTopology();
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hadoop-metric/src/main/java/org/apache/eagle/metric/HadoopMetricMonitorAppProdiver.java
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hadoop-metric/src/main/java/org/apache/eagle/metric/HadoopMetricMonitorAppProdiver.java b/eagle-metric/eagle-hadoop-metric/src/main/java/org/apache/eagle/metric/HadoopMetricMonitorAppProdiver.java
new file mode 100644
index 0000000..dc7ea97
--- /dev/null
+++ b/eagle-metric/eagle-hadoop-metric/src/main/java/org/apache/eagle/metric/HadoopMetricMonitorAppProdiver.java
@@ -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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.apache.eagle.metric;
+
+import org.apache.eagle.app.spi.AbstractApplicationProvider;
+
+/**
+ * Metadata: META-INF/providers/org.apache.eagle.metric.HadoopMetricMonitorAppProdiver.xml.
+ */
+public class HadoopMetricMonitorAppProdiver extends AbstractApplicationProvider<HadoopMetricMonitorApp> {
+ @Override
+ public HadoopMetricMonitorApp getApplication() {
+ return new HadoopMetricMonitorApp();
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hadoop-metric/src/main/resources/META-INF/providers/org.apache.eagle.metric.HadoopMetricMonitorAppProdiver.xml
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hadoop-metric/src/main/resources/META-INF/providers/org.apache.eagle.metric.HadoopMetricMonitorAppProdiver.xml b/eagle-metric/eagle-hadoop-metric/src/main/resources/META-INF/providers/org.apache.eagle.metric.HadoopMetricMonitorAppProdiver.xml
new file mode 100644
index 0000000..9c34b1f
--- /dev/null
+++ b/eagle-metric/eagle-hadoop-metric/src/main/resources/META-INF/providers/org.apache.eagle.metric.HadoopMetricMonitorAppProdiver.xml
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ ~ 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.
+ -->
+
+<application>
+ <type>HADOOP_METRIC_MONITOR</type>
+ <name>Hadoop Metrics Monitor</name>
+ <configuration>
+ <!-- data fromStream configurations -->
+ <property>
+ <name>dataSinkConfig.HADOOP_JMX_METRIC_STREAM.topic</name>
+ <displayName>JMX Metric Kafka Topic</displayName>
+ <value>hadoop_jmx_metric_${siteId}</value>
+ <description>Hadoop JMX metric kafka topic name for stream: HADOOP_JMX_METRIC_STREAM</description>
+ <required>true</required>
+ </property>
+ <property>
+ <name>dataSinkConfig.brokerList</name>
+ <displayName>Kafka Brokers</displayName>
+ <value>localhost:6667</value>
+ <description>Sourced Kafka Brokers like broker1,broker2,...</description>
+ <required>true</required>
+ </property>
+ <property>
+ <name>dataSourceConfig.zkConnection</name>
+ <displayName>Zookeeper Quorum</displayName>
+ <value>localhost:2181</value>
+ <description>Kafka Zookeeper Quorum</description>
+ <required>true</required>
+ </property>
+ <property>
+ <name>dataSourceConfig.fetchSize</name>
+ <displayName>Kafka Fetch Size</displayName>
+ <value>1048576</value>
+ <description>Kafka Fetch Size</description>
+ <required>false</required>
+ </property>
+ <property>
+ <name>dataSourceConfig.transactionZKRoot</name>
+ <displayName>Kafka Transaction Root Path</displayName>
+ <value>/consumers</value>
+ <description>Kafka Transaction Root Path</description>
+ <required>false</required>
+ </property>
+ <property>
+ <name>dataSourceConfig.consumerGroupId</name>
+ <displayName>Kafka Consumer Group ID</displayName>
+ <value>eagleConsumer</value>
+ <description>Kafka Consumer Group ID</description>
+ <required>false</required>
+ </property>
+ <property>
+ <name>dataSourceConfig.brokerZkPath</name>
+ <displayName>Kafka Broker ZkPath</displayName>
+ <description>Kafka Broker ZkPath</description>
+ <required>false</required>
+ </property>
+ <property>
+ <name>dataSourceConfig.txZkServers</name>
+ <displayName>Kafka Transaction Zookeeper Servers</displayName>
+ <description>Kafka Transaction Zookeeper Servers</description>
+ <value>localhost:2181</value>
+ <required>true</required>
+ </property>
+ <property>
+ <name>dataSourceConfig.transactionStateUpdateMS</name>
+ <value>2000</value>
+ <displayName>Kafka Transaction Status Update MS</displayName>
+ <description>Kafka Transaction Status Update MS</description>
+ <required>false</required>
+ </property>
+ <property>
+ <name>service.host</name>
+ <displayName>Eagle Service Host</displayName>
+ <description>Set additional eagle service host, default: using current host</description>
+ </property>
+ <property>
+ <name>service.port</name>
+ <displayName>Eagle Service Port</displayName>
+ <description>Set additional eagle service port, default: using current port</description>
+ </property>
+ </configuration>
+ <streams>
+ <stream>
+ <streamId>HADOOP_JMX_METRIC_STREAM</streamId>
+ <description>Hadoop JMX Metric Stream including name node, resource manager, etc.</description>
+ <columns>
+ <column>
+ <name>host</name>
+ <type>string</type>
+ </column>
+ <column>
+ <name>timestamp</name>
+ <type>long</type>
+ </column>
+ <column>
+ <name>metric</name>
+ <type>string</type>
+ </column>
+ <column>
+ <name>component</name>
+ <type>string</type>
+ </column>
+ <column>
+ <name>site</name>
+ <type>string</type>
+ </column>
+ <column>
+ <name>value</name>
+ <type>double</type>
+ <defaultValue>0.0</defaultValue>
+ </column>
+ </columns>
+ </stream>
+ </streams>
+ <docs>
+ <install>
+ <b>How to Install</b>
+ <ol>
+ <li>Create a kafka topic named <code>hadoop_jmx_metric_{SITE_ID}</code></li>
+ <li>Setup metric collector for monitored Hadoop/HBase using <a target="_blank" href="https://github.com/apache/incubator-eagle/tree/master/eagle-external/hadoop_jmx_collector">hadoop_jmx_collector</a></li>
+ <li>Setup <code>Kafka Topic Name</code> and <code>Kafka Broker List </code> in <code>Settings</code> tab</li>
+ <li>Click "Install" button then you will see the <code>HADOOP_JMX_METRIC_STREAM_{SITE_ID}</code> in <a href="/#/alert/streamList">Streams</a></li>
+ </ol>
+ </install>
+ <uninstall>
+ <b>How to Uninstall</b>
+ <ol>
+ <li>Stop and remove installed <code>hadoop_jmx_collector</code></li>
+ <li>Remove kafka topic <code>hadoop_jmx_metric_{SITE_ID}</code></li>
+ <li>Click "Uninstall" button which will remove stream <code>HADOOP_JMX_METRIC_STREAM_{SITE_ID}</code></li>
+ </ol>
+ </uninstall>
+ </docs>
+</application>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hadoop-metric/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hadoop-metric/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider b/eagle-metric/eagle-hadoop-metric/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
new file mode 100644
index 0000000..25d911d
--- /dev/null
+++ b/eagle-metric/eagle-hadoop-metric/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
@@ -0,0 +1,16 @@
+# 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.
+
+org.apache.eagle.metric.HadoopMetricMonitorAppProdiver
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hadoop-metric/src/main/resources/datasources.json
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hadoop-metric/src/main/resources/datasources.json b/eagle-metric/eagle-hadoop-metric/src/main/resources/datasources.json
new file mode 100644
index 0000000..5c10696
--- /dev/null
+++ b/eagle-metric/eagle-hadoop-metric/src/main/resources/datasources.json
@@ -0,0 +1,19 @@
+[
+ {
+ "name": "hadoop_jmx_datasource",
+ "type": "KAFKA",
+ "properties": {
+ },
+ "topic": "hadoop_jmx_metrics",
+ "schemeCls": "org.apache.eagle.alert.engine.scheme.JsonScheme",
+ "codec": {
+ "streamNameSelectorProp": {
+ "userProvidedStreamName" : "hadoopJmxMetricEventStream",
+ "streamNameFormat":"%s"
+ },
+ "streamNameSelectorCls":"org.apache.eagle.alert.engine.scheme.JsonStringStreamNameSelector",
+ "timestampColumn": "timestamp",
+ "timestampFormat": ""
+ }
+ }
+]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hadoop-metric/src/main/resources/policies.json
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hadoop-metric/src/main/resources/policies.json b/eagle-metric/eagle-hadoop-metric/src/main/resources/policies.json
new file mode 100644
index 0000000..811ffb0
--- /dev/null
+++ b/eagle-metric/eagle-hadoop-metric/src/main/resources/policies.json
@@ -0,0 +1,169 @@
+[
+ {
+ "name": "haStatePolicy",
+ "description": "ha state check for hadoop name node",
+ "definition": {
+ "inputStreams": [
+ "hadoopJmxMetricEventStream"
+ ],
+ "outputStreams": [
+ "tmp"
+ ],
+ "type": "siddhi",
+ "value": " from every a = hadoopJmxMetricEventStream[metric==\"hadoop.namenode.fsnamesystem.hastate\"] -> b = hadoopJmxMetricEventStream[metric==a.metric and b.host == a.host and (convert(a.value, \"long\\\") != convert(value, \"long\"))] within 10 min select a.host, a.value as oldHaState, b.value as newHaState, b.timestamp as timestamp, b.metric as metric, b.component as component, b.site as site insert into tmp; "
+ },
+ "partitionSpec": [
+ {
+ "streamId": "hadoopJmxMetricEventStream",
+ "type": "GROUPBY",
+ "columns": [
+ "host"
+ ]
+ }
+ ]
+ },
+
+ {
+ "name": "capacityUsedPolicy",
+ "description": "capacity usage check for hadoop cluster",
+ "definition": {
+ "inputStreams": [
+ "hadoopJmxMetricEventStream"
+ ],
+ "outputStreams": [
+ "tmp"
+ ],
+ "type": "siddhi",
+ "value": " from hadoopJmxMetricEventStream[metric == \"hadoop.namenode.fsnamesystemstate.capacityused\" and convert(value, \"long\") > 0]#window.externalTime(timestamp ,10 min) select metric, host, value, timestamp, component, site insert into tmp; "
+ },
+ "partitionSpec": [
+ {
+ "streamId": "hadoopJmxMetricEventStream",
+ "type": "GROUPBY",
+ "columns": [
+ "host"
+ ]
+ }
+ ]
+ },
+
+ {
+ "name": "lastCheckPointTimePolicy",
+ "description": "last check point interval check for hadoop name node pair",
+ "definition": {
+ "inputStreams": [
+ "hadoopJmxMetricEventStream"
+ ],
+ "outputStreams": [
+ "tmp"
+ ],
+ "type": "siddhi",
+ "value": " from hadoopJmxMetricEventStream[metric == \"hadoop.namenode.dfs.lastcheckpointtime\" and (convert(value, \"long\") + 18000000) < timestamp]#window.externalTime(timestamp ,10 min) select metric, host, value, timestamp, component, site insert into tmp; "
+ },
+ "partitionSpec": [
+ {
+ "streamId": "hadoopJmxMetricEventStream",
+ "type": "GROUPBY",
+ "columns": [
+ "host"
+ ]
+ }
+ ]
+ },
+
+ {
+ "name": "missingBlockPolicy",
+ "description": "missing block number check for hadoop cluster",
+ "definition": {
+ "inputStreams": [
+ "hadoopJmxMetricEventStream"
+ ],
+ "outputStreams": [
+ "tmp"
+ ],
+ "type": "siddhi",
+ "value": " from hadoopJmxMetricEventStream[metric == \"hadoop.namenode.dfs.missingblocks\" and convert(value, \"long\") > 0]#window.externalTime(timestamp ,10 min) select metric, host, value, timestamp, component, site insert into tmp; "
+ },
+ "partitionSpec": [
+ {
+ "streamId": "hadoopJmxMetricEventStream",
+ "type": "GROUPBY",
+ "columns": [
+ "host"
+ ]
+ }
+ ]
+ },
+
+ {
+ "name": "namenodeTxLagPolicy",
+ "description": "name node tx log lag check",
+ "definition": {
+ "inputStreams": [
+ "hadoopJmxMetricEventStream"
+ ],
+ "outputStreams": [
+ "tmp"
+ ],
+ "type": "siddhi",
+ "value": " from every a = hadoopJmxMetricEventStream[metric==\"hadoop.namenode.journaltransaction.lastappliedorwrittentxid\"] -> b = hadoopJmxMetricEventStream[metric==a.metric and b.host != a.host and (max(convert(a.value, \"long\")) + 100) <= max(convert(value, \"long\"))] within 5 min select a.host as hostA, a.value as transactIdA, b.host as hostB, b.value as transactIdB insert into tmp; "
+ },
+ "partitionSpec": [
+ {
+ "streamId": "hadoopJmxMetricEventStream",
+ "type": "GROUPBY",
+ "columns": [
+ "host"
+ ]
+ }
+ ]
+ },
+
+ {
+ "name": "nodecountPolicy",
+ "description": "data node number check for hadoop cluster",
+ "definition": {
+ "inputStreams": [
+ "hadoopJmxMetricEventStream"
+ ],
+ "outputStreams": [
+ "tmp"
+ ],
+ "type": "siddhi",
+ "value": " from every (e1 = hadoopJmxMetricEventStream[metric == \"hadoop.namenode.fsnamesystemstate.numlivedatanodes\" ]) -> e2 = hadoopJmxMetricEventStream[metric == e1.metric and host == e1.host and (convert(e1.value, \"long\") - 5) >= convert(value, \"long\") ] within 5 min select e1.metric, e1.host, e1.value as highNum, e1.timestamp as start, e2.value as lowNum, e2.timestamp as end insert into tmp; "
+ },
+ "partitionSpec": [
+ {
+ "streamId": "hadoopJmxMetricEventStream",
+ "type": "GROUPBY",
+ "columns": [
+ "host"
+ ]
+ }
+ ]
+ },
+
+ {
+ "name": "nameNodeSafeModeCheckPolicy",
+ "description": "safe mode check for name node",
+ "definition": {
+ "inputStreams": [
+ "hadoopJmxMetricEventStream"
+ ],
+ "outputStreams": [
+ "tmp"
+ ],
+ "type": "siddhi",
+ "value": " from hadoopJmxMetricEventStream[component==\"namenode\" and metric == \"hadoop.namenode.fsnamesystemstate.fsstate\" and convert(value, \"long\") > 0]#window.externalTime(timestamp ,10 min) select metric, host, value, timestamp, component, site insert into tmp; "
+ },
+ "partitionSpec": [
+ {
+ "streamId": "hadoopJmxMetricEventStream",
+ "type": "GROUPBY",
+ "columns": [
+ "host"
+ ]
+ }
+ ]
+ }
+]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hadoop-metric/src/main/resources/publishments.json
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hadoop-metric/src/main/resources/publishments.json b/eagle-metric/eagle-hadoop-metric/src/main/resources/publishments.json
new file mode 100644
index 0000000..10d16a4
--- /dev/null
+++ b/eagle-metric/eagle-hadoop-metric/src/main/resources/publishments.json
@@ -0,0 +1,33 @@
+[
+ {
+ "name":"jmxStreamOutput_email",
+ "type":"org.apache.eagle.alert.engine.publisher.impl.AlertEmailPublisher",
+ "policyIds": [
+ "perfmon_cpu_host_check", "perfmon_cpu_pool_check"
+ ],
+ "properties": {
+ "subject":"Hadoop Jmx Metrics Alert",
+ "template":"",
+ "sender": "sender@corp.com",
+ "recipients": "services@corp.com",
+ "smtp.server":"smtp.mailhost.com",
+ "connection": "plaintext",
+ "smtp.port": "25"
+ },
+ "dedupIntervalMin" : "PT1M",
+ "serializer" : "org.apache.eagle.alert.engine.publisher.impl.StringEventSerializer"
+ },
+ {
+ "type": "org.apache.eagle.alert.engine.publisher.impl.AlertKafkaPublisher",
+ "name":"jmxStreamOutput_kafka",
+ "policyIds": [
+ "perfmon_cpu_host_check"
+ ],
+ "dedupIntervalMin": "PT1M",
+ "properties":{
+ "kafka_broker":"localhost:9092",
+ "topic":"jmx_alerts"
+ },
+ "serializer" : "org.apache.eagle.alert.engine.publisher.impl.StringEventSerializer"
+ }
+]
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hadoop-metric/src/main/resources/streamdefinitions.json
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hadoop-metric/src/main/resources/streamdefinitions.json b/eagle-metric/eagle-hadoop-metric/src/main/resources/streamdefinitions.json
new file mode 100644
index 0000000..66a2c98
--- /dev/null
+++ b/eagle-metric/eagle-hadoop-metric/src/main/resources/streamdefinitions.json
@@ -0,0 +1,47 @@
+[
+ {
+ "streamId": "hadoopJmxMetricEventStream",
+ "dataSource": "hadoop_jmx_datasource",
+ "description": "the data stream for hadoop jmx metrics",
+ "validate": false,
+ "timeseries": false,
+ "columns": [
+ {
+ "name": "host",
+ "type": "STRING",
+ "defaultValue": "",
+ "required": true
+ },
+ {
+ "name": "timestamp",
+ "type": "LONG",
+ "defaultValue": 0,
+ "required": true
+ },
+ {
+ "name": "metric",
+ "type": "STRING",
+ "defaultValue": "default_hadoop_jmx_metric_name",
+ "required": true
+ },
+ {
+ "name": "component",
+ "type": "STRING",
+ "defaultValue": "namenode",
+ "required": true
+ },
+ {
+ "name": "site",
+ "type": "STRING",
+ "defaultValue": "hadoop",
+ "required": true
+ },
+ {
+ "name": "value",
+ "type": "DOUBLE",
+ "defaultValue": 0.0,
+ "required": true
+ }
+ ]
+ }
+]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/HadoopMetricMonitorAppDebug.java
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/HadoopMetricMonitorAppDebug.java b/eagle-metric/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/HadoopMetricMonitorAppDebug.java
new file mode 100644
index 0000000..e4589b7
--- /dev/null
+++ b/eagle-metric/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/HadoopMetricMonitorAppDebug.java
@@ -0,0 +1,23 @@
+/*
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.apache.eagle.metric;
+
+public class HadoopMetricMonitorAppDebug {
+ public static void main(String[] args) {
+ new HadoopMetricMonitorApp().run(args);
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/HadoopMetricMonitorAppProviderTest.java
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/HadoopMetricMonitorAppProviderTest.java b/eagle-metric/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/HadoopMetricMonitorAppProviderTest.java
new file mode 100644
index 0000000..94e1b82
--- /dev/null
+++ b/eagle-metric/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/HadoopMetricMonitorAppProviderTest.java
@@ -0,0 +1,89 @@
+/*
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.apache.eagle.metric;
+
+
+import com.google.inject.Inject;
+import org.apache.eagle.app.resource.ApplicationResource;
+import org.apache.eagle.app.service.ApplicationOperations;
+import org.apache.eagle.app.test.ApplicationSimulator;
+import org.apache.eagle.app.test.ApplicationTestBase;
+import org.apache.eagle.metadata.model.ApplicationEntity;
+import org.apache.eagle.metadata.model.SiteEntity;
+import org.apache.eagle.metadata.resource.SiteResource;
+import org.apache.eagle.metadata.service.ApplicationStatusUpdateService;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class HadoopMetricMonitorAppProviderTest extends ApplicationTestBase {
+
+ @Inject
+ private SiteResource siteResource;
+ @Inject
+ private ApplicationResource applicationResource;
+ @Inject
+ private ApplicationSimulator simulator;
+ @Inject
+ ApplicationStatusUpdateService statusUpdateService;
+
+ @Test
+ public void testApplicationLifecycle() throws InterruptedException {
+ // Create local site
+ SiteEntity siteEntity = new SiteEntity();
+ siteEntity.setSiteId("test_site");
+ siteEntity.setSiteName("Test Site");
+ siteEntity.setDescription("Test Site for HADOOP_METRIC_MONITOR");
+ siteResource.createSite(siteEntity);
+ Assert.assertNotNull(siteEntity.getUuid());
+
+ ApplicationOperations.InstallOperation installOperation = new ApplicationOperations.InstallOperation("test_site", "HADOOP_METRIC_MONITOR", ApplicationEntity.Mode.LOCAL);
+ installOperation.setConfiguration(getConf());
+
+ //Install dependency
+ ApplicationOperations.InstallOperation installOperationDependency = new ApplicationOperations.InstallOperation("test_site", "TOPOLOGY_HEALTH_CHECK_APP", ApplicationEntity.Mode.LOCAL);
+ applicationResource.installApplication(installOperationDependency);
+
+ // Install application
+ ApplicationEntity applicationEntity = applicationResource.installApplication(installOperation).getData();
+ // Uninstall application
+ applicationResource.uninstallApplication(new ApplicationOperations.UninstallOperation(applicationEntity.getUuid()));
+ try {
+ applicationResource.getApplicationEntityByUUID(applicationEntity.getUuid());
+ Assert.fail("Application instance (UUID: " + applicationEntity.getUuid() + ") should have been uninstalled");
+ } catch (Exception ex) {
+ // Expected exception
+ }
+ }
+
+ private Map<String, Object> getConf() {
+ Map<String, Object> conf = new HashMap<>();
+ conf.put("dataSinkConfig.topic", "testTopic");
+ conf.put("dataSinkConfig.brokerList", "broker");
+ conf.put("dataSinkConfig.serializerClass", "serializerClass");
+ conf.put("dataSinkConfig.keySerializerClass", "keySerializerClass");
+ conf.put("dataSinkConfig.producerType", "async");
+ conf.put("dataSinkConfig.numBatchMessages", 4096);
+ conf.put("dataSinkConfig.maxQueueBufferMs", 5000);
+ conf.put("dataSinkConfig.requestRequiredAcks", 0);
+ conf.put("spoutNum", 2);
+ conf.put("mode", "LOCAL");
+ return conf;
+ }
+}
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/SendSampleDataToKafka.java
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/SendSampleDataToKafka.java b/eagle-metric/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/SendSampleDataToKafka.java
new file mode 100644
index 0000000..c53dfe3
--- /dev/null
+++ b/eagle-metric/eagle-hadoop-metric/src/test/java/org/apache/eagle/metric/SendSampleDataToKafka.java
@@ -0,0 +1,56 @@
+/*
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.
+ */
+package org.apache.eagle.metric;
+
+import com.typesafe.config.ConfigFactory;
+import kafka.producer.KeyedMessage;
+import kafka.producer.ProducerConfig;
+import org.apache.eagle.app.messaging.KafkaStreamProvider;
+import org.apache.eagle.app.messaging.KafkaStreamSinkConfig;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.Properties;
+
+public class SendSampleDataToKafka {
+ public static void main(String[] args) throws URISyntaxException, IOException {
+ String data = "{" +
+ "\"host\":\"localhost\", " +
+ "\"timestamp\": 1480319109000, " +
+ "\"metric\": \"hadoop.cpu.usage\", " +
+ "\"component\": \"namenode\", " +
+ "\"site\": \"test\", " +
+ "\"value\": 0.98}";
+ KafkaStreamSinkConfig config = new KafkaStreamProvider().getSinkConfig("HADOOP_JMX_METRIC_STREAM",ConfigFactory.load());
+ Properties properties = new Properties();
+ properties.put("metadata.broker.list", config.getBrokerList());
+ properties.put("serializer.class", config.getSerializerClass());
+ properties.put("key.serializer.class", config.getKeySerializerClass());
+ // new added properties for async producer
+ properties.put("producer.type", config.getProducerType());
+ properties.put("batch.num.messages", config.getNumBatchMessages());
+ properties.put("request.required.acks", config.getRequestRequiredAcks());
+ properties.put("queue.buffering.max.ms", config.getMaxQueueBufferMs());
+ ProducerConfig producerConfig = new ProducerConfig(properties);
+ kafka.javaapi.producer.Producer producer = new kafka.javaapi.producer.Producer(producerConfig);
+ try {
+ producer.send(new KeyedMessage(config.getTopicId(), data));
+ } finally {
+ producer.close();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hadoop-metric/src/test/resources/application.conf
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hadoop-metric/src/test/resources/application.conf b/eagle-metric/eagle-hadoop-metric/src/test/resources/application.conf
new file mode 100644
index 0000000..4d74666
--- /dev/null
+++ b/eagle-metric/eagle-hadoop-metric/src/test/resources/application.conf
@@ -0,0 +1,49 @@
+# 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.
+
+
+
+
+{
+ service {
+ env = "testing"
+ host = "localhost"
+ port = 9090
+ username = "admin"
+ password = "secret"
+ readTimeOutSeconds = 60
+ context = "/rest"
+ timezone = "UTC"
+ }
+
+ "appId" : "HadoopJmxAppForTest",
+ "mode" : "LOCAL",
+ "siteId" : "testsite",
+ "dataSourceConfig": {
+ "topic" : "hadoop_jmx_metric",
+ "zkConnection" : "localhost:2181",
+ "txZkServers" : "localhost:2181"
+ }
+ "dataSinkConfig": {
+ "topic" : "hadoop_jmx_metric",
+ "brokerList" : "localhost:6667",
+ "serializerClass" : "kafka.serializer.StringEncoder",
+ "keySerializerClass" : "kafka.serializer.StringEncoder"
+ "producerType" : "async",
+ "numBatchMessages" : "4096",
+ "maxQueueBufferMs" : "5000",
+ "requestRequiredAcks" : "0"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hadoop-metric/src/test/resources/hadoop_jmx_metric_sample.json
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hadoop-metric/src/test/resources/hadoop_jmx_metric_sample.json b/eagle-metric/eagle-hadoop-metric/src/test/resources/hadoop_jmx_metric_sample.json
new file mode 100644
index 0000000..74852d0
--- /dev/null
+++ b/eagle-metric/eagle-hadoop-metric/src/test/resources/hadoop_jmx_metric_sample.json
@@ -0,0 +1,8 @@
+{
+ "host":"localhost",
+ "timestamp": 1480319107000,
+ "metric": "hadoop.cpu.usage",
+ "component": "namenode",
+ "site": "test",
+ "value": 0.96
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hadoop-metric/src/test/resources/integrate_test_policy.json
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hadoop-metric/src/test/resources/integrate_test_policy.json b/eagle-metric/eagle-hadoop-metric/src/test/resources/integrate_test_policy.json
new file mode 100644
index 0000000..5146ffa
--- /dev/null
+++ b/eagle-metric/eagle-hadoop-metric/src/test/resources/integrate_test_policy.json
@@ -0,0 +1,37 @@
+{
+ "name": "TEST_POLICY",
+ "description": "from HADOOP_JMX_METRIC_STREAM_SANDBOX[site==\"test\"] insert into ALERT_STREAM;",
+ "inputStreams": [
+ "HADOOP_JMX_METRIC_STREAM_SANDBOX"
+ ],
+ "outputStreams": [
+ "ALERT_STREAM"
+ ],
+ "definition": {
+ "type": "siddhi",
+ "value": "from HADOOP_JMX_METRIC_STREAM_SANDBOX[site==\"test\"] select component,value, name insert into ALERT_STREAM;",
+ "handlerClass": null,
+ "properties": {},
+ "inputStreams": [],
+ "outputStreams": []
+ },
+ "stateDefinition": null,
+ "policyStatus": "ENABLED",
+ "alertDefinition": {
+ "templateType": "TEXT",
+ "subject": "$component Disk Usage $value",
+ "body": "#set($usage_percentage = $value * 100)\r\n\r\nDisk Usage (<strong>$metric<strong>) reached <span style=\"color:red\">$usage_percentage %</span> (Threshold: 90%) on <strong>$component</strong> of cluster: <strong>$site</strong> on:\r\n<ul>\r\n <li><strong>Hostname</strong>: $host</li>\r\n <li><strong>When</strong>: $ALERT_TIME</li>\r\n <li><strong>Root Cause</strong>: UNKNOWN</li>\r\n <li><strong>Action Required</strong>: N/A</li>\r\n</ul>",
+ "severity": "CRITICAL",
+ "category": "HDFS"
+ },
+ "partitionSpec": [
+ {
+ "streamId": "HADOOP_JMX_METRIC_STREAM_SANDBOX",
+ "type": "SHUFFLE",
+ "columns": [],
+ "sortSpec": null
+ }
+ ],
+ "dedicated": false,
+ "parallelismHint": 5
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hbase-web/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/pom.xml b/eagle-metric/eagle-hbase-web/pom.xml
new file mode 100644
index 0000000..9e61433
--- /dev/null
+++ b/eagle-metric/eagle-hbase-web/pom.xml
@@ -0,0 +1,57 @@
+<!--
+ ~ 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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>eagle-metric-parent</artifactId>
+ <groupId>org.apache.eagle</groupId>
+ <version>0.5.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>eagle-hbase-web</artifactId>
+ <name>Eagle::App::HadoopMetric::HBase::WebUI</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.eagle</groupId>
+ <artifactId>eagle-app-base</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.eagle</groupId>
+ <artifactId>eagle-hadoop-metric</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.eagle</groupId>
+ <artifactId>eagle-topology-app</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/webapp/app</directory>
+ <targetPath>assets/</targetPath>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+ </build>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hbase-web/src/main/java/org/apache/eagle/metric/HBaseMetricWebApplicationProvider.java
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/java/org/apache/eagle/metric/HBaseMetricWebApplicationProvider.java b/eagle-metric/eagle-hbase-web/src/main/java/org/apache/eagle/metric/HBaseMetricWebApplicationProvider.java
new file mode 100644
index 0000000..6f53afa
--- /dev/null
+++ b/eagle-metric/eagle-hbase-web/src/main/java/org/apache/eagle/metric/HBaseMetricWebApplicationProvider.java
@@ -0,0 +1,23 @@
+/*
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ */
+package org.apache.eagle.metric;
+
+import org.apache.eagle.app.StaticApplicationProvider;
+
+public class HBaseMetricWebApplicationProvider extends StaticApplicationProvider {
+ // HBaseWebApplicationProvider SPI Interface
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hbase-web/src/main/resources/META-INF/providers/org.apache.eagle.metric.HBaseMetricWebApplicationProvider.xml
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/resources/META-INF/providers/org.apache.eagle.metric.HBaseMetricWebApplicationProvider.xml b/eagle-metric/eagle-hbase-web/src/main/resources/META-INF/providers/org.apache.eagle.metric.HBaseMetricWebApplicationProvider.xml
new file mode 100644
index 0000000..564ce44
--- /dev/null
+++ b/eagle-metric/eagle-hbase-web/src/main/resources/META-INF/providers/org.apache.eagle.metric.HBaseMetricWebApplicationProvider.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ ~ 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.
+ -->
+
+<application>
+ <type>HBASE_METRIC_WEB_APP</type>
+ <name>HBase Metric Monitoring Web </name>
+ <viewPath>/apps/hbase</viewPath>
+ <description>HBase Metric Monitoring Web</description>
+ <dependencies>
+ <dependency>
+ <type>HADOOP_METRIC_MONITOR</type>
+ <required>true</required>
+ </dependency>
+ <dependency>
+ <type>TOPOLOGY_HEALTH_CHECK_APP</type>
+ <required>true</required>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <property>
+ <name>service.host</name>
+ <displayName>Eagle Service Host</displayName>
+ <description>Set additional eagle service host, default: using current host</description>
+ </property>
+ <property>
+ <name>service.port</name>
+ <displayName>Eagle Service Port</displayName>
+ <description>Set additional eagle service port, default: using current port</description>
+ </property>
+ </configuration>
+</application>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hbase-web/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider b/eagle-metric/eagle-hbase-web/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
new file mode 100644
index 0000000..dcbdb63
--- /dev/null
+++ b/eagle-metric/eagle-hbase-web/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
@@ -0,0 +1,16 @@
+# 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.
+
+org.apache.eagle.metric.HBaseMetricWebApplicationProvider
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/config.json
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/config.json b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/config.json
new file mode 100644
index 0000000..88b14f6
--- /dev/null
+++ b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/config.json
@@ -0,0 +1,68 @@
+{
+ "master": {
+ "nonheap": "hadoop.memory.nonheapmemoryusage.used",
+ "heap": "hadoop.memory.heapmemoryusage.used",
+ "averageload": "hadoop.hbase.master.server.averageload",
+ "ritcount": "hadoop.hbase.master.assignmentmanger.ritcount",
+ "ritcountoverthreshold": "hadoop.hbase.master.assignmentmanger.ritcountoverthreshold",
+ "AssignNumOps": "hadoop.hbase.master.assignmentmanger.assign_num_ops",
+ "AssignMin": "hadoop.hbase.master.assignmentmanger.assign_min",
+ "AssignMax": "hadoop.hbase.master.assignmentmanger.assign_max",
+ "AssignPercentile75th": "hadoop.hbase.master.assignmentmanger.assign_75th_percentile",
+ "AssignPercentile95th": "hadoop.hbase.master.assignmentmanger.assign_95th_percentile",
+ "AssignPercentile99th": "hadoop.hbase.master.assignmentmanger.assign_99th_percentile",
+ "BulkAssignNum_ops": "hadoop.hbase.master.assignmentmanger.bulkassign_num_ops",
+ "BulkAssignMin": "hadoop.hbase.master.assignmentmanger.bulkassign_min",
+ "BulkAssignMax": "hadoop.hbase.master.assignmentmanger.bulkassign_max",
+ "BulkAssignPercentile75th": "hadoop.hbase.master.assignmentmanger.bulkassign_75th_percentile",
+ "BulkAssignPercentile95th": "hadoop.hbase.master.assignmentmanger.bulkassign_95th_percentile",
+ "BulkAssignPercentile99th": "hadoop.hbase.master.assignmentmanger.bulkassign_99th_percentile",
+ "BalancerClusterNum_ops": "hadoop.hbase.master.balancer.balancercluster_num_ops",
+ "BalancerClusterMin": "hadoop.hbase.master.balancer.balancercluster_min",
+ "BalancerClusterMax": "hadoop.hbase.master.balancer.balancercluster_max",
+ "BalancerClusterPercentile75th": "hadoop.hbase.master.balancer.balancercluster_75th_percentile",
+ "BalancerClusterPercentile95th": "hadoop.hbase.master.balancer.balancercluster_95th_percentile",
+ "BalancerClusterPercentile99th": "hadoop.hbase.master.balancer.balancercluster_99th_percentile",
+ "HlogSplitTimeMin": "hadoop.hbase.master.filesystem.hlogsplittime_min",
+ "HlogSplitTimeMax": "hadoop.hbase.master.filesystem.hlogsplittime_max",
+ "HlogSplitTimePercentile75th": "hadoop.hbase.master.filesystem.hlogsplittime_75th_percentile",
+ "HlogSplitTimePercentile95th": "hadoop.hbase.master.filesystem.hlogsplittime_95th_percentile",
+ "HlogSplitTimePercentile99th": "hadoop.hbase.master.filesystem.hlogsplittime_99th_percentile",
+ "HlogSplitSizeMin": "hadoop.hbase.master.filesystem.hlogsplitsize_min",
+ "HlogSplitSizeMax": "hadoop.hbase.master.filesystem.hlogsplitsize_max",
+ "MetaHlogSplitTimeMin": "hadoop.hbase.master.filesystem.metahlogsplittime_min",
+ "MetaHlogSplitTimeMax": "hadoop.hbase.master.filesystem.metahlogsplittime_max",
+ "MetaHlogSplitTimePercentile75th": "hadoop.hbase.master.filesystem.metahlogsplittime_75th_percentile",
+ "MetaHlogSplitTimePercentile95th": "hadoop.hbase.master.filesystem.metahlogsplittime_95th_percentile",
+ "MetaHlogSplitTimePercentile99th": "hadoop.hbase.master.filesystem.metahlogsplittime_99th_percentile",
+ "MetaHlogSplitSizeMin": "hadoop.hbase.master.filesystem.metahlogsplitsize_min",
+ "MetaHlogSplitSizeMax": "hadoop.hbase.master.filesystem.metahlogsplitsize_max"
+ },
+ "regionserver": {
+ "nonheap" : "hadoop.memory.nonheapmemoryusage.used",
+ "heap" : "hadoop.memory.heapmemoryusage.used",
+ "directmemory" : "hadoop.bufferpool.direct.memoryused",
+ "GCCount" : "hadoop.hbase.jvm.gccount",
+ "GCTimeMillis" : "hadoop.hbase.jvm.gctimemillis",
+ "QueueSize" : "hadoop.hbase.regionserver.ipc.queuesize",
+ "NumCallsInGeneralQueue" : "hadoop.hbase.regionserver.ipc.numcallsingeneralqueue",
+ "NumActiveHandler" : "hadoop.hbase.regionserver.ipc.numactivehandler",
+ "IPCQueueTime99th" : "hadoop.hbase.regionserver.ipc.queuecalltime_99th_percentile",
+ "IPCProcessTime99th" : "hadoop.hbase.regionserver.ipc.processcalltime_99th_percentile",
+ "QueueCallTime_num_ops" : "hadoop.hbase.regionserver.ipc.queuecalltime_num_ops",
+ "ProcessCallTime_num_ops" : "hadoop.hbase.regionserver.ipc.processcalltime_num_ops",
+ "RegionCount" : "hadoop.hbase.regionserver.server.regioncount",
+ "StoreCount" : "hadoop.hbase.regionserver.server.storecount",
+ "MemStoreSize" : "hadoop.hbase.regionserver.server.memstoresize",
+ "StoreFileSize" : "hadoop.hbase.regionserver.server.storefilesize",
+ "TotalRequestCount" : "hadoop.hbase.regionserver.server.totalrequestcount",
+ "ReadRequestCount" : "hadoop.hbase.regionserver.server.readrequestcount",
+ "WriteRequestCount" : "hadoop.hbase.regionserver.server.writerequestcount",
+ "SlitQueueLength" : "hadoop.hbase.regionserver.server.splitqueuelength",
+ "CompactionQueueLength" : "hadoop.hbase.regionserver.server.compactionqueuelength",
+ "FlushQueueLength" : "hadoop.hbase.regionserver.server.flushqueuelength",
+ "BlockCacheSize" : "hadoop.hbase.regionserver.server.blockcachesize",
+ "BlockCacheHitCount" : "hadoop.hbase.regionserver.server.blockcachehitcount",
+ "BlockCacheCountHitPercent" : "hadoop.hbase.regionserver.server.blockcounthitpercent"
+ }
+}
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/backupMasterListCtrl.js
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/backupMasterListCtrl.js b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/backupMasterListCtrl.js
new file mode 100644
index 0000000..ca6c47e
--- /dev/null
+++ b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/backupMasterListCtrl.js
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+(function () {
+ /**
+ * `register` without params will load the module which using require
+ */
+ register(function (hadoopMetricApp) {
+
+ hadoopMetricApp.controller("backupMasterListCtrl", function ($wrapState, $scope, PageConfig, METRIC) {
+
+ // Initialization
+ PageConfig.title = "HBASE BackupMasters";
+ $scope.tableScope = {};
+ $scope.site = $wrapState.param.siteId;
+ $scope.searchPathList = [["tags", "hostname"], ["tags", "rack"], ["tags", "site"], ["status"]];
+ $scope.backupMasterList = METRIC.hbaseMaster($scope.site, "standby", 1000);
+ });
+ });
+})();
[2/4] eagle git commit: [EAGLE-900] Only show left navigation item
(HDFS, HBase) when we install the JMX application
Posted by jj...@apache.org.
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/overview.js
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/overview.js b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/overview.js
new file mode 100644
index 0000000..6e7df0b
--- /dev/null
+++ b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/overview.js
@@ -0,0 +1,298 @@
+/*
+ * 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.
+ */
+
+(function () {
+ /**
+ * `register` without params will load the module which using require
+ */
+ register(function (hadoopMetricApp) {
+ hadoopMetricApp.controller("overviewCtrl", function ($q, $wrapState, $scope, PageConfig, METRIC, Time) {
+ var cache = {};
+ $scope.site = $wrapState.param.siteId;
+ var activeMasterInfo = METRIC.hbaseMaster($scope.site, "active", 1);
+
+ PageConfig.title = 'HBase';
+ var storageOption = {
+ animation: false,
+ tooltip: {
+ formatter: function (points) {
+ return points[0].name + "<br/>" +
+ $.map(points, function (point) {
+ return '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + point.color + '"></span> ' +
+ point.seriesName + ": " +
+ common.number.abbr(point.value, true, 0);
+ }).reverse().join("<br/>");
+ }
+ },
+ yAxis: [{
+ axisLabel: {
+ formatter: function (value) {
+ return common.number.abbr(value, true);
+ }
+ }
+ }]
+ };
+
+
+ function generateHbaseMetric(name, flag) {
+ var startTime = Time.startTime();
+ var endTime = Time.endTime();
+ var interval = Time.diffInterval(startTime, endTime);
+ var intervalMin = interval / 1000 / 60;
+ var trendStartTime = Time.align(startTime, interval);
+ var trendEndTime = Time.align(endTime, interval);
+
+ $scope.site = $wrapState.param.siteId;
+ var result = cache[name] || activeMasterInfo._promise.then(function (res) {
+ var hostname = cache[hostname] = cache[hostname] || res[0].tags.hostname;
+ $scope.defaultHostname = $wrapState.param.hostname || hostname;
+
+ var jobCond = {
+ site: $scope.site,
+ component: "hbasemaster",
+ host: $scope.defaultHostname
+ };
+ return METRIC.aggMetricsToEntities(METRIC.hbaseMetricsAggregation(jobCond, name, ["site"], "avg(value)", intervalMin, trendStartTime, trendEndTime), flag)
+ ._promise.then(function (list) {
+ var metricFlag = $.map(list, function (metrics) {
+ return metrics[0].flag;
+ });
+ return [metricFlag, list];
+ });
+ });
+ return result;
+ }
+
+ function mergeMetricToOneSeries(metricTitle, metrics, legendName, dataOption, option) {
+ var series = [];
+
+ $.each(metrics, function (i, metricMap) {
+ if (typeof metricMap !== 'undefined') {
+ series.push(METRIC.metricsToSeries(legendName[i], metricMap[0], option));
+ }
+ });
+ return {
+ title: metricTitle,
+ series: series,
+ option: dataOption || {},
+ loading: false
+ };
+ }
+
+ function countHBaseRole(site, status, role, groups, filed, limit) {
+ var jobCond = {
+ site: site,
+ status: status,
+ role: role
+ };
+ return METRIC.aggHBaseInstance(jobCond, groups, filed, limit);
+ }
+
+ function sumAllRegions(site, role, groups, filed, limit) {
+ var jobCond = {
+ site: site,
+ role: role
+ };
+ return METRIC.aggHBaseInstance(jobCond, groups, filed, limit);
+ }
+
+ // TODO: Optimize the chart count
+ // TODO: ECharts dynamic refresh series bug: https://github.com/ecomfe/echarts/issues/4033
+ $scope.chartList = [
+ {
+ name: "MemoryUsage",
+ metrics: ["nonheap", "heap"],
+ linename: ["nonheap", "heap"],
+ option: storageOption
+ },
+ {
+ name: "Master Averageload",
+ metrics: ["averageload"],
+ linename: ["averageload"],
+ option: {}
+ },
+ {
+ name: "Ritcount",
+ metrics: ["ritcount", "ritcountoverthreshold"],
+ linename: ["ritcount", "ritcountoverthreshold"],
+ option: {}
+ },
+ {
+ name: "AssignOpsNum",
+ metrics: ["AssignNumOps"],
+ linename: ["numOps"],
+ option: {}
+ },
+ {
+ name: "Assign",
+ metrics: ["AssignMin", "AssignMax", "AssignPercentile75th", "AssignPercentile95th", "AssignPercentile99th"],
+ linename: ["min", "max", "75th", "95th", "99th"],
+ option: {}
+ },
+ {
+ name: "BulkAssignOpsNum",
+ metrics: ["BulkAssignNum_ops"],
+ linename: ["num_ops"],
+ option: {}
+ },
+ {
+ name: "BulkAssign",
+ metrics: ["BulkAssignMin", "BulkAssignMax", "BulkAssignPercentile75th", "BulkAssignPercentile95th", "BulkAssignPercentile99th"],
+ linename: ["min", "max", "75th", "95th", "99th"],
+ option: {}
+ },
+ {
+ name: "BalancerClusterOpsNum",
+ metrics: ["BalancerClusterNum_ops"],
+ linename: ["num_ops"],
+ option: {}
+ },
+ {
+ name: "BalancerCluster",
+ metrics: ["BalancerClusterMin", "BalancerClusterMax", "BalancerClusterPercentile75th", "BalancerClusterPercentile95th", "BalancerClusterPercentile99th"],
+ linename: ["min", "max", "75th", "95th", "99th"],
+ option: {}
+ },
+ {
+ name: "HlogSplitTime",
+ metrics: ["HlogSplitTimeMin", "HlogSplitTimeMax"],
+ linename: ["HlogSplitTime_min", "HlogSplitTime_max"],
+ option: {}
+ },
+ {
+ name: "HlogSplitTime Percentile",
+ metrics: ["HlogSplitTimePercentile75th", "HlogSplitTimePercentile95th", "HlogSplitTimePercentile99th"],
+ linename: ["75th", "95th", "99th"],
+ option: {}
+ },
+ {
+ name: "HlogSplitSize",
+ metrics: ["HlogSplitSizeMin","HlogSplitSizeMax"],
+ linename: ["Min", "Max"],
+ option: {}
+ },
+ {
+ name: "MetaHlogSplitTime",
+ metrics: ["MetaHlogSplitTimeMin", "MetaHlogSplitTimeMax"],
+ linename: ["Min", "Max"],
+ option: {}
+ },
+ {
+ name: "MetaHlogSplitTime Percentile",
+ metrics: ["MetaHlogSplitTimePercentile75th", "MetaHlogSplitTimePercentile95th", "MetaHlogSplitTimePercentile99th"],
+ linename: ["75th", "95th", "99th"],
+ option: {}
+ },
+ {
+ name: "MetaHlogSplitSize",
+ metrics: ["MetaHlogSplitSizeMin", "MetaHlogSplitSizeMax"],
+ linename: ["Min", "Max"],
+ option: {}
+ }
+ ];
+ $scope.metricList = [];
+ $.each($scope.chartList, function (i) {
+ var chart = $scope.chartList[i];
+ var chartname = chart.name;
+ $scope.metricList[chartname] = {
+ title: chartname,
+ series: {},
+ option: {},
+ loading: true,
+ promises: []
+ };
+ });
+ $scope.refresh = function () {
+
+ METRIC.getMetricObj().then(function (res) {
+ var masterMetricList = res.master;
+ $.each($scope.chartList, function (i) {
+ var chart = $scope.chartList[i];
+ var metricList = chart.metrics;
+ $.each(metricList, function (j) {
+ var metricKey = metricList[j];
+ var metricspromies = generateHbaseMetric(masterMetricList[metricKey], metricKey);
+ var chartname = chart.name;
+ $scope.metricList[chartname].promises.push(metricspromies);
+ });
+ });
+
+ $.each($scope.chartList, function (k) {
+ var chart = $scope.chartList[k];
+ var chartname = chart.name;
+ $q.all($scope.metricList[chartname].promises).then(function (resp) {
+ var series = [];
+ for (var r = 0; r < resp.length; r += 1) {
+ var rs = resp[r][1];
+ if (rs.length > 0) {
+ series.push(rs);
+ }
+ }
+ $scope.metricList[chartname] = mergeMetricToOneSeries(chartname, series, chart.linename, chart.option);
+ });
+ });
+ });
+
+ countHBaseRole($scope.site, "active", "hmaster", ["site"], "count")._promise.then(function (res) {
+ $.map(res, function (data) {
+ $scope.hmasteractivenum = data.value[0];
+ });
+ });
+ countHBaseRole($scope.site, "standby", "hmaster", ["site"], "count")._promise.then(function (res) {
+ $.map(res, function (data) {
+ $scope.hmasterstandbynum = data.value[0];
+ });
+ });
+
+ countHBaseRole($scope.site, "live", "regionserver", ["site"], "count")._promise.then(function (res) {
+ $.map(res, function (data) {
+ $scope.regionserverhealtynum = data.value[0];
+ });
+ });
+ countHBaseRole($scope.site, "dead", "regionserver", ["site"], "count")._promise.then(function (res) {
+ $.map(res, function (data) {
+ $scope.regionserverunhealtynum = data.value[0];
+ });
+ });
+ sumAllRegions($scope.site, "regionserver", ["site"], "sum(numRegions)")._promise.then(function (res) {
+ $.map(res, function (data) {
+ $scope.regionsnum = data.value[0];
+ });
+ });
+
+ activeMasterInfo._promise.then(function (res) {
+ var hostname = cache[hostname] = cache[hostname] || res[0].tags.hostname;
+ $scope.defaultHostname = $wrapState.param.hostname || hostname;
+ var jobCond = {
+ site: $scope.site,
+ component: "hbasemaster",
+ host: $scope.defaultHostname
+ };
+ METRIC.hbaseMomentMetric(jobCond, "hadoop.hbase.master.server.averageload", 1).then(function (res) {
+ $scope.hmasteraverageload = (typeof res.data.obj[0] !== 'undefined') ? res.data.obj[0].value[0] : "-1";
+ });
+ });
+ };
+ Time.onReload(function () {
+ cache = {};
+ $scope.refresh();
+ }, $scope);
+ $scope.refresh();
+ });
+ });
+})();
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/regionDetailCtrl.js
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/regionDetailCtrl.js b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/regionDetailCtrl.js
new file mode 100644
index 0000000..838b3a2
--- /dev/null
+++ b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/regionDetailCtrl.js
@@ -0,0 +1,306 @@
+/*
+ * 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.
+ */
+
+(function () {
+ /**
+ * `register` without params will load the module which using require
+ */
+ register(function (hadoopMetricApp) {
+ hadoopMetricApp.controller("regionDetailCtrl", function ($q, $wrapState, $scope, PageConfig, Time, METRIC) {
+ var cache = {};
+ $scope.site = $wrapState.param.siteId;
+ $scope.hostname = $wrapState.param.hostname;
+ PageConfig.title = 'RegionServer ' + "(" + $scope.hostname + ")";
+ Time.autoRefresh = false;
+
+ var sizeoption = {
+ animation: false,
+ tooltip: {
+ formatter: function (points) {
+ return points[0].name + "<br/>" +
+ $.map(points, function (point) {
+ return '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + point.color + '"></span> ' +
+ point.seriesName + ": " +
+ common.number.abbr(point.value, true);
+ }).reverse().join("<br/>");
+ }
+ },
+ legend: {
+ x: 'center', y: 'bottom'
+ },
+ areaStyle: {normal: {}},
+ yAxis: [{
+ axisLabel: {
+ formatter: function (value) {
+ return common.number.abbr(value, true);
+ }
+ }
+ }]
+ };
+ var digitalOption = {
+ animation: false,
+ tooltip: {
+ formatter: function (points) {
+ return points[0].name + "<br/>" +
+ $.map(points, function (point) {
+ return '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + point.color + '"></span> ' +
+ point.seriesName + ": " +
+ common.number.abbr(point.value, false, 0);
+ }).reverse().join("<br/>");
+ }
+ },
+ yAxis: [{
+ axisLabel: {
+ formatter: function (value) {
+ return common.number.abbr(value, false);
+ }
+ }
+ }]
+ };
+
+ var gctimeoption = {
+ legend: {
+ x: 'center', y: 'bottom'
+ },
+ yAxis: [{
+ axisLabel: {
+ formatter: function (value) {
+ return value / 1000 + ' S';
+ }
+ }
+ }]
+ };
+ $scope.chartList = [
+ {
+ name: "Memory Usage",
+ metrics: ["nonheap", "heap"],
+ option: sizeoption
+ },
+ {
+ name: "Direct Memory Usage",
+ metrics: ["directmemory"],
+ option: sizeoption
+ },
+ {
+ name: "GC count",
+ metrics: ["GCCount"],
+ option: {}
+ },
+ {
+ name: "GC TimeMillis",
+ metrics: ["GCTimeMillis"],
+ option: gctimeoption
+ },
+ {
+ name: "QueueSize",
+ metrics: ["QueueSize"],
+ option: {}
+ },
+ {
+ name: "NumCallsInGeneralQueue",
+ metrics: ["NumCallsInGeneralQueue"],
+ option: {}
+ },
+ {
+ name: "NumActiveHandler",
+ metrics: ["NumActiveHandler"],
+ option: {}
+ },
+ {
+ name: "IPC Queue Time (99th)",
+ metrics: ["IPCQueueTime99th"],
+ option: {}
+ },
+ {
+ name: "IPC Process Time (99th)",
+ metrics: ["IPCProcessTime99th"],
+ option: {}
+ },
+ {
+ name: "QueueCallTime_num_ops",
+ metrics: ["QueueCallTime_num_ops"],
+ option: digitalOption
+ },
+ {
+ name: "ProcessCallTime_num_ops",
+ metrics: ["ProcessCallTime_num_ops"],
+ option: digitalOption
+ },
+ {
+ name: "RegionCount",
+ metrics: ["RegionCount"],
+ option: {}
+ },
+ {
+ name: "StoreCount",
+ metrics: ["StoreCount"],
+ option: {}
+ },
+ {
+ name: "MemStoreSize",
+ metrics: ["MemStoreSize"],
+ option: sizeoption
+ },
+ {
+ name: "StoreFileSize",
+ metrics: ["StoreFileSize"],
+ option: sizeoption
+ },
+ {
+ name: "SlitQueueLength",
+ metrics: ["SlitQueueLength"],
+ option: {}
+ },
+ {
+ name: "CompactionQueueLength",
+ metrics: ["CompactionQueueLength"],
+ option: {}
+ },
+ {
+ name: "FlushQueueLength",
+ metrics: ["FlushQueueLength"],
+ option: {}
+ },
+ {
+ name: "BlockCacheSize",
+ metrics: ["BlockCacheSize"],
+ option: sizeoption
+ },
+ {
+ name: "BlockCacheHitCount",
+ metrics: ["BlockCacheHitCount"],
+ option: {}
+ },
+ {
+ name: "BlockCacheCountHitPercent",
+ metrics: ["BlockCacheCountHitPercent"],
+ option: digitalOption
+ },
+ {
+ name: "TotalRequestCount",
+ metrics: ["TotalRequestCount"],
+ option: digitalOption
+ },
+ {
+ name: "ReadRequestCount",
+ metrics: ["ReadRequestCount"],
+ option: digitalOption
+ },
+ {
+ name: "WriteRequestCount",
+ metrics: ["WriteRequestCount"],
+ option: digitalOption
+ }
+ ];
+
+ $scope.metricList = [];
+ $.each($scope.chartList, function (i) {
+ var chart = $scope.chartList[i];
+ var chartname = chart.name;
+ $scope.metricList[chartname] = {
+ title: chartname,
+ series: {},
+ option: {},
+ loading: true,
+ promises: []
+ };
+ });
+ $scope.refresh = function () {
+ var startTime = Time.startTime();
+ var endTime = Time.endTime();
+
+ METRIC.getMetricObj().then(function (res) {
+ var masterMetricList = res.regionserver;
+ $.each($scope.chartList, function (i) {
+ var chart = $scope.chartList[i];
+ var metricList = chart.metrics;
+ $.each(metricList, function (j) {
+ var metricKey = metricList[j];
+ var metricspromies = generateHbaseMetric(masterMetricList[metricKey], startTime, endTime, metricKey);
+ var chartname = chart.name;
+ $scope.metricList[chartname].promises.push(metricspromies);
+ });
+ });
+
+ $.each($scope.chartList, function (k) {
+ var chart = $scope.chartList[k];
+ var chartname = chart.name;
+ $q.all($scope.metricList[chartname].promises).then(function (resp) {
+ var series = [];
+ for (var r = 0; r < resp.length; r += 1) {
+ var rs = resp[r][1];
+ if (rs.length > 0) {
+ series.push(rs);
+ }
+ }
+ $scope.metricList[chartname] = mergeSeries(chartname, series, chart.metrics, chart.option);
+ });
+ });
+ });
+
+ METRIC.regionserverStatus($scope.hostname, $scope.site)._promise.then(function (res) {
+ $scope.regionstatus = res;
+ });
+ };
+ Time.onReload(function () {
+ cache = {};
+ $scope.refresh();
+ }, $scope);
+ $scope.refresh();
+
+
+ function generateHbaseMetric(name, startTime, endTime, flag) {
+ var interval = Time.diffInterval(startTime, endTime);
+ var intervalMin = interval / 1000 / 60;
+ var trendStartTime = Time.align(startTime, interval);
+ var trendEndTime = Time.align(endTime, interval);
+
+ var condition = {
+ site: $scope.site,
+ component: "regionserver",
+ host: $scope.hostname
+ };
+ return METRIC.aggMetricsToEntities(METRIC.hbaseMetricsAggregation(condition, name, ["site"], "avg(value)", intervalMin, trendStartTime, trendEndTime), flag)
+ ._promise.then(function (list) {
+ var metricFlag = $.map(list, function (metrics) {
+ return metrics[0].flag;
+ });
+ return [metricFlag, list];
+ });
+ }
+
+ function mergeSeries(title, metrics, linename, option) {
+ var series = [];
+ $.each(metrics, function (i, metricMap) {
+ $.map(metricMap, function (metric) {
+ if (typeof metric !== 'undefined') {
+ series.push(METRIC.metricsToSeries(linename[i], metric, option));
+ }
+ });
+ });
+ return {
+ title: title,
+ series: series,
+ option: option || {},
+ loading: false
+ };
+ }
+ });
+ });
+})
+();
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/regionListCtrl.js
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/regionListCtrl.js b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/regionListCtrl.js
new file mode 100644
index 0000000..1477e32
--- /dev/null
+++ b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/ctrls/regionListCtrl.js
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+(function () {
+ /**
+ * `register` without params will load the module which using require
+ */
+ register(function (hadoopMetricApp) {
+
+ hadoopMetricApp.controller("regionListCtrl", function ($wrapState, $scope, PageConfig, METRIC) {
+
+ // Initialization
+ PageConfig.title = "HBASE RegionServers";
+ $scope.tableScope = {};
+ $scope.live = METRIC.STATUS_LIVE;
+ $scope.dead = METRIC.STATUS_DEAD;
+ $scope.site = $wrapState.param.siteId;
+ $scope.searchPathList = [["tags", "hostname"], ["tags", "rack"], ["tags", "site"], ["status"]];
+ $scope.regionserverList = METRIC.regionserverList($scope.site);
+
+ });
+ });
+})();
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/index.html
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/index.html b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/index.html
new file mode 100644
index 0000000..454e3c6
--- /dev/null
+++ b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/index.html
@@ -0,0 +1,6 @@
+<htm>
+ <body>
+ <h1>HBase Metric Monitor Application!</h1>
+ <i><b>url</b>: /apps/hbase</i>
+ </body>
+</htm>
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/index.js
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/index.js b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/index.js
new file mode 100644
index 0000000..c6b5135
--- /dev/null
+++ b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/index.js
@@ -0,0 +1,329 @@
+/*
+ * 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.
+ */
+
+(function () {
+ /**
+ * `register` is global function that for application to set up 'controller', 'service', 'directive', 'route' in Eagle
+ */
+ var hadoopMetricApp = register(['ngRoute', 'ngAnimate', 'ui.router', 'eagle.service']);
+
+ hadoopMetricApp.route("HBaseMetric", {
+ url: "/hadoopService/HBase/overview?startTime&endTime",
+ site: true,
+ templateUrl: "partials/overview.html",
+ controller: "overviewCtrl",
+ resolve: {time: true}
+ }).route("regionDetail", {
+ url: "/hadoopService/HBase/regionDetail/:hostname",
+ site: true,
+ templateUrl: "partials/region/regionDetail.html",
+ controller: "regionDetailCtrl",
+ resolve: {time: true}
+ }).route("regionList", {
+ url: "/hadoopService/HBase/regionList",
+ site: true,
+ templateUrl: "partials/region/regionList.html",
+ controller: "regionListCtrl"
+ }).route("backupMasterList", {
+ url: "/hadoopService/HBase/backupMasterList",
+ site: true,
+ templateUrl: "partials/backupMasterList.html",
+ controller: "backupMasterListCtrl"
+ }).route("masterDetail", {
+ url: "/hadoopService/HBase/:hostname?startTime&endTime",
+ site: true,
+ reloadOnSearch: false,
+ templateUrl: "partials/overview.html",
+ controller: "overviewCtrl",
+ resolve: {time: true}
+ });
+
+ hadoopMetricApp.portal({
+ name: "Services", icon: "heartbeat", list: [
+ {name: "HBase", path: "hadoopService/HBase/overview"}
+ ]
+ }, true);
+
+ hadoopMetricApp.service("METRIC", function ($q, $http, Time, Site, Application) {
+ var METRIC = window._METRIC = {};
+ METRIC.STATUS_LIVE = "live";
+ METRIC.STATUS_DEAD = "dead";
+ METRIC.QUERY_HBASE_METRICS = '${baseURL}/rest/entities?query=GenericMetricService[${condition}]{*}&metricName=${metric}&pageSize=${limit}';
+ METRIC.QUERY_HBASE_METRICS_WITHTIME = '${baseURL}/rest/entities?query=GenericMetricService[${condition}]{*}&metricName=${metric}&pageSize=${limit}&startTime=${startTime}&endTime=${endTime}';
+ METRIC.QUERY_HBASE_INSTANCE = '${baseURL}/rest/entities?query=HbaseServiceInstance[${condition}]{*}&pageSize=${limit}';
+ METRIC.QUERY_HBASE_INSTANCE_AGG = "${baseURL}/rest/entities?query=HbaseServiceInstance[${condition}]<${groups}>{${field}}&pageSize=${limit}";
+ METRIC.QUERY_HBASE_METRICS_INTERVAL = '${baseURL}/rest/entities?query=GenericMetricService[${condition}]<${groups}>{${field}}${order}${top}&metricName=${metric}&pageSize=${limit}&startTime=${startTime}&endTime=${endTime}&intervalmin=${intervalMin}&timeSeries=true';
+ /**
+ * Fetch query content with current site application configuration
+ * @param {string} queryName
+ */
+ var getQuery = METRIC.getQuery = function (queryName, siteId) {
+ var baseURL;
+ siteId = siteId || Site.current().siteId;
+ var app = Application.find("HBASE_METRIC_WEB_APP", siteId)[0];
+ var host = app.configuration["service.host"];
+ var port = app.configuration["service.port"];
+
+ if (!host && !port) {
+ baseURL = "";
+ } else {
+ if (host === "localhost" || !host) {
+ host = location.hostname;
+ }
+ if (!port) {
+ port = location.port;
+ }
+ baseURL = "http://" + host + ":" + port;
+ }
+
+ return common.template(METRIC["QUERY_" + queryName], {baseURL: baseURL});
+ };
+
+ function wrapList(promise) {
+ var _list = [];
+ _list._done = false;
+
+ _list._promise = promise.then(
+ /**
+ * @param {{}} res
+ * @param {{}} res.data
+ * @param {{}} res.data.obj
+ */
+ function (res) {
+ _list.splice(0);
+ Array.prototype.push.apply(_list, res.data.obj);
+ _list._done = true;
+ return _list;
+ });
+ return _list;
+ }
+
+ function toFields(fields) {
+ return (fields || []).length > 0 ? $.map(fields, function (field) {
+ return "@" + field;
+ }).join(",") : "*";
+ }
+
+ METRIC.metricsToSeries = function (name, metrics, option, rawData) {
+ if (arguments.length === 4 && typeof rawData === "object") {
+ option = rawData;
+ rawData = false;
+ }
+
+ var data = $.map(metrics, function (metric) {
+ return rawData ? metric.value[0] : {
+ x: metric.timestamp,
+ y: metric.value[0]
+ };
+ });
+ return $.extend({
+ name: name,
+ showSymbol: false,
+ type: "line",
+ data: data
+ }, option || {});
+ };
+
+ METRIC.get = function (url, params) {
+ return $http({
+ url: url,
+ method: "GET",
+ params: params
+ });
+ };
+
+ METRIC.condition = function (condition) {
+ return $.map(condition, function (value, key) {
+ return "@" + key + '="' + value + '"';
+ }).join(" AND ");
+ };
+
+
+ METRIC.hbaseMetrics = function (condition, metric, startTime, endTime, limit) {
+ var config = {
+ condition: METRIC.condition(condition),
+ startTime: Time.format(startTime),
+ endTime: Time.format(endTime),
+ metric: metric,
+ limit: limit || 10000
+ };
+
+ var metrics_url = common.template(getQuery("HBASE_METRICS_WITHTIME"), config);
+ return wrapList(METRIC.get(metrics_url));
+ };
+
+ METRIC.hbaseMomentMetric = function (condition, metric, limit) {
+ var config = {
+ condition: METRIC.condition(condition),
+ metric: metric,
+ limit: limit || 10000
+ };
+
+ var metrics_url = common.template(getQuery("HBASE_METRICS"), config);
+ return METRIC.get(metrics_url);
+ };
+
+ METRIC.aggHBaseInstance = function (condition, groups, field, limit) {
+ var fields = field.split(/\s*,\s*/);
+ var fieldStr = $.map(fields, function (field, index) {
+ var matches = field.match(/^([^\s]*)(\s+.*)?$/);
+ if (matches[2]) {
+ orderId = index;
+ }
+ return matches[1];
+ }).join(", ");
+ var config = {
+ condition: METRIC.condition(condition),
+ groups: toFields(groups),
+ field: fieldStr,
+ limit: limit || 10000
+ };
+ var metrics_url = common.template(getQuery("HBASE_INSTANCE_AGG"), config);
+ return wrapList(METRIC.get(metrics_url));
+ };
+
+ METRIC.hbaseMetricsAggregation = function (condition, metric, groups, field, intervalMin, startTime, endTime, top, limit) {
+ var fields = field.split(/\s*,\s*/);
+ var orderId = -1;
+ var fieldStr = $.map(fields, function (field, index) {
+ var matches = field.match(/^([^\s]*)(\s+.*)?$/);
+ if (matches[2]) {
+ orderId = index;
+ }
+ return matches[1];
+ }).join(", ");
+
+
+ var config = {
+ condition: METRIC.condition(condition),
+ startTime: Time.format(startTime),
+ endTime: Time.format(endTime),
+ metric: metric,
+ groups: toFields(groups),
+ field: fieldStr,
+ order: orderId === -1 ? "" : ".{" + fields[orderId] + "}",
+ top: top ? "&top=" + top : "",
+ intervalMin: intervalMin,
+ limit: limit || 10000
+ };
+
+ var metrics_url = common.template(getQuery("HBASE_METRICS_INTERVAL"), config);
+ var _list = wrapList(METRIC.get(metrics_url));
+ _list._aggInfo = {
+ groups: groups,
+ startTime: Time(startTime).valueOf(),
+ interval: intervalMin * 60 * 1000
+ };
+ _list._promise.then(function () {
+ _list.reverse();
+ });
+ return _list;
+ };
+
+ METRIC.aggMetricsToEntities = function (list, param, flatten) {
+ var _list = [];
+ _list.done = false;
+ _list._promise = list._promise.then(function () {
+ var _startTime = list._aggInfo.startTime;
+ var _interval = list._aggInfo.interval;
+
+ $.each(list, function (i, obj) {
+ var tags = {};
+ $.each(list._aggInfo.groups, function (j, group) {
+ tags[group] = obj.key[j];
+ });
+
+ var _subList = $.map(obj.value[0], function (value, index) {
+ return {
+ timestamp: _startTime + index * _interval,
+ value: [value],
+ tags: tags,
+ flag: param
+ };
+ });
+
+ if (flatten) {
+ _list.push.apply(_list, _subList);
+ } else {
+ _list.push(_subList);
+ }
+ });
+ _list.done = true;
+ return _list;
+ });
+ return _list;
+ };
+
+
+ METRIC.hbasehostStatus = function (condition, limit) {
+ var config = {
+ condition: METRIC.condition(condition),
+ limit: limit || 10000
+ };
+
+ var metrics_url = common.template(getQuery("HBASE_INSTANCE"), config);
+ return wrapList(METRIC.get(metrics_url));
+ };
+
+ METRIC.hbaseMaster = function (siteId, status, limit) {
+ var condition = {
+ site: siteId,
+ role: "hmaster",
+ status: status
+ };
+ return METRIC.hbasehostStatus(condition, limit);
+ };
+
+ METRIC.regionserverStatus = function (hostname, siteid) {
+ var hoststateinfo;
+ var condition = {
+ site: siteid,
+ role: "regionserver",
+ hostname: hostname
+ };
+ hoststateinfo = METRIC.hbasehostStatus(condition, 1);
+ return hoststateinfo;
+ };
+
+ METRIC.regionserverList = function (siteid) {
+ var hoststateinfos;
+ var condition = {
+ site: siteid,
+ role: "regionserver"
+ };
+ hoststateinfos = METRIC.hbasehostStatus(condition);
+ return hoststateinfos;
+ };
+
+ METRIC.getMetricObj = function () {
+ var deferred = $q.defer();
+ $http.get("apps/hbase/config.json").success(function (resp) {
+ deferred.resolve(resp);
+ });
+ return deferred.promise;
+ };
+ return METRIC;
+ });
+
+ hadoopMetricApp.requireCSS("style/index.css");
+ hadoopMetricApp.require("widgets/availabilityChart.js");
+ hadoopMetricApp.require("ctrls/overview.js");
+ hadoopMetricApp.require("ctrls/regionDetailCtrl.js");
+ hadoopMetricApp.require("ctrls/regionListCtrl.js");
+ hadoopMetricApp.require("ctrls/backupMasterListCtrl.js");
+})();
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/backupMasterList.html
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/backupMasterList.html b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/backupMasterList.html
new file mode 100644
index 0000000..13e20c9
--- /dev/null
+++ b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/backupMasterList.html
@@ -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.
+ -->
+<div class="box box-primary">
+ <div class="box-header with-border">
+ <h3 class="box-title">
+ <span ng-show="!backupMasterList._done || isSorting" class="fa fa-refresh fa-spin no-animate"></span>
+ </h3>
+ </div>
+ <div class="box-body">
+ <div id="backupMasterList" sort-table="backupMasterList" is-sorting="isSorting"
+ search-path-list="searchPathList"
+ scope="tableScope">
+ <table class="table table-bordered">
+ <thead>
+ <tr>
+ <th sortpath="tags.hostname">Master</th>
+ <th sortpath="tags.rack">Rack</th>
+ <th sortpath="tags.site">SiteId</th>
+ <th sortpath="status">Status</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr ng-repeat="item in backupMasterList">
+ <td>
+ <a ui-sref="masterDetail({siteId: site, hostname: item.tags.hostname})">{{item.tags.hostname}}</a>
+ </td>
+ <td>{{item.tags.rack}}</td>
+ <td>{{item.tags.site}}</td>
+ <td>
+ <span>{{item.status}}</span>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+</div>
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/overview.html
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/overview.html b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/overview.html
new file mode 100644
index 0000000..0e194ef
--- /dev/null
+++ b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/overview.html
@@ -0,0 +1,111 @@
+<!--
+ 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.
+ -->
+
+<div class="box box-primary">
+ <div class="box-header with-border">
+ <span class="fa fa-television"></span>
+ <h3 class="box-title">
+ HBase Service Summary Information
+ </h3>
+ </div>
+ <div class="box-body">
+ <table class="table table-striped hadoopMetric-table">
+ <tr>
+ <td width="5%">
+ <span ng-show="hmasteractivenum">{{hmasteractivenum}}</span>
+ <span ng-show="!hmasteractivenum">N/A</span>
+ </td>
+ <th width="45%">Active HBase Master</th>
+ <td width="5%">
+ <span ng-show="regionsnum">{{regionsnum}}</span>
+ <span ng-show="!regionsnum">N/A</span>
+ </td>
+ <th width="45%">Regions
+ </th>
+ </tr>
+ <tr>
+ <td>
+ <a ui-sref="backupMasterList({siteId: site})">
+ <span ng-show="hmasterstandbynum">{{hmasterstandbynum}}</span></a>
+ <span ng-show="!hmasterstandbynum">0</span>
+ </td>
+ <th>Backup HBase Master</th>
+ <td>
+ <span ng-show="hmasteraverageload !== '-1'">{{common.number.format(hmasteraverageload, 0)}}</span>
+ <span ng-show="hmasteraverageload === '-1'">N/A</span>
+ </td>
+ <th>Average Load</th>
+ </tr>
+ <tr>
+ <td>
+ <a ui-sref="regionList({siteId: site})">
+ <span ng-show="regionserverhealtynum || regionserverunhealtynum">{{regionserverhealtynum+regionserverunhealtynum}}</span></a>
+ <span ng-show="!regionserverhealtynum && !regionserverunhealtynum">N/A</span>
+ </td>
+ <th>RegionServers:
+ <a ui-sref="regionList({siteId: site})">
+ <span ng-show="regionserverhealtynum">{{regionserverhealtynum}}</span></a>
+ <span ng-show="!regionserverhealtynum">0</span>
+ <span
+ class="label label-success">Good Health</span> /
+ <a ui-sref="regionList({siteId: site})">
+ <span ng-show="regionserverunhealtynum">{{regionserverunhealtynum}}</span></a>
+ <span ng-show="!regionserverunhealtynum">0</span>
+ <span class="label label-danger">Bad Health</span>
+ </th>
+ <td></td>
+ <th></th>
+ </tr>
+ </table>
+ </div>
+</div>
+
+<div class="box box-primary">
+ <div class="box-header with-border">
+ <span class="fa fa-line-chart"></span>
+ <h3 class="box-title">
+ Metrics
+ <span>({{defaultHostname}})</span>
+ </h3>
+ </div>
+ <div class="box-body no-padding">
+ <div class="row border-split">
+ <div class="col-sm-6 col-md-4 col-lg-6" ng-repeat="chart in chartList track by $index">
+ <div class="hadoopMetric-chart">
+ <h3>{{metricList[chart.name].title}}</h3>
+ <div ng-show="metricList[chart.name].loading" chart class="hadoopMetric-chart-container"></div>
+ <div ng-show="metricList[chart.name].loading" class="overlay-wrapper">
+ <div class="overlay">
+ <i class="fa fa-refresh fa-spin"></i>
+ </div>
+ </div>
+ <div ng-show="metricList[chart.name].series.length" chart class="hadoopMetric-chart-container"
+ series="metricList[chart.name].series"
+ option="metricList[chart.name].option"></div>
+ <div ng-show="!metricList[chart.name].series.length && !metricList[chart.name].loading" class="hadoopMetric-chart-container">
+ <div class="hadoopMetric-chart-container-withborder">
+ <div class="hadoopMetric-no-chart-data">
+ <span class="fa fa-question-circle"></span><span> NO DATA</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/region/regionDetail.html
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/region/regionDetail.html b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/region/regionDetail.html
new file mode 100644
index 0000000..63a895f
--- /dev/null
+++ b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/region/regionDetail.html
@@ -0,0 +1,117 @@
+<!--
+ 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.
+ -->
+
+<div class="box box-primary">
+ <div class="box-header with-border">
+ <span class="fa fa-television"></span>
+ <h3 class="box-title">
+ Summary
+ </h3>
+ </div>
+ <div class="box-body">
+ <table class="table table-striped">
+ <tbody ng-if="(regionstatus || []).length !== 0">
+ <tr>
+ <th>Status</th>
+ <td class="text-break">
+ <span ng-if="regionstatus[0].status==='live'" class="label label-success">Healthy</span>
+ <span ng-if="regionstatus[0].status!=='live'" class="label label-danger">UnHealthy</span>
+ </td>
+ </tr>
+ <tr>
+ <th>Rack</th>
+ <td class="text-break">{{regionstatus[0].tags.rack}}</td>
+ </tr>
+ <tr>
+ <th>MaxHeap</th>
+ <td class="text-break">{{regionstatus[0].maxHeapMB}} MB</td>
+ </tr>
+ <tr>
+ <th>UsedHeap</th>
+ <td class="text-break">{{regionstatus[0].usedHeapMB}} MB</td>
+ </tr>
+ <tr>
+ <th>NumRegions</th>
+ <td class="text-break">{{regionstatus[0].numRegions}}</td>
+ </tr>
+ <tr>
+ <th>NumRequests</th>
+ <td class="text-break">{{regionstatus[0].numRequests}}</td>
+ </tr>
+ </tbody>
+ <tbody ng-if="regionstatus.length === 0">
+ <tr>
+ <th>Status</th>
+ <td class="text-break"><span class="label label-danger">Unknow</span></td>
+ </tr>
+ <tr>
+ <th>Rack</th>
+ <td class="text-break"><span class="label label-danger">Unknow</span></td>
+ </tr>
+ <tr>
+ <th>MaxHeap</th>
+ <td class="text-break"><span class="label label-danger">Unknow</span></td>
+ </tr>
+ <tr>
+ <th>UsedHeap</th>
+ <td class="text-break"><span class="label label-danger">Unknow</span></td>
+ </tr>
+ <tr>
+ <th>NumRegions</th>
+ <td class="text-break"><span class="label label-danger">Unknow</span></td>
+ </tr>
+ <tr>
+ <th>NumRequests</th>
+ <td class="text-break"><span class="label label-danger">Unknow</span></td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+</div>
+
+<div class="box box-primary">
+ <div class="box-header with-border">
+ <span class="fa fa-line-chart"></span>
+ <h3 class="box-title">
+ Metrics
+ </h3>
+ </div>
+ <div class="box-body no-padding">
+ <div class="row border-split">
+ <div class="col-sm-6 hadoopMetric-col-md-6 col-lg-6" ng-repeat="chart in chartList track by $index">
+ <div class="hadoopMetric-chart">
+ <h3>{{metricList[chart.name].title}}</h3>
+ <div ng-show="metricList[chart.name].loading" class="hadoopMetric-chart-container"></div>
+ <div ng-show="metricList[chart.name].loading" class="overlay-wrapper">
+ <div class="overlay">
+ <i class="fa fa-refresh fa-spin"></i>
+ </div>
+ </div>
+ <div ng-show="metricList[chart.name].series.length" chart class="hadoopMetric-chart-container"
+ series="metricList[chart.name].series"
+ option="metricList[chart.name].option"></div>
+ <div ng-show="!metricList[chart.name].series.length && !metricList[chart.name].loading" class="hadoopMetric-chart-container">
+ <div class="hadoopMetric-no-chart-data">
+ <span class="fa fa-question-circle"></span><span> NO DATA</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/region/regionList.html
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/region/regionList.html b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/region/regionList.html
new file mode 100644
index 0000000..d1a7440
--- /dev/null
+++ b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/partials/region/regionList.html
@@ -0,0 +1,53 @@
+<!--
+ 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.
+ -->
+<div class="box box-primary">
+ <div class="box-header with-border">
+ <h3 class="box-title">
+ <span ng-show="!regionserverList._done || isSorting" class="fa fa-refresh fa-spin no-animate"></span>
+ </h3>
+ </div>
+ <div class="box-body">
+ <div id="regionserverList" sort-table="regionserverList" is-sorting="isSorting"
+ search-path-list="searchPathList"
+ scope="tableScope">
+ <table class="table table-bordered">
+ <thead>
+ <tr>
+ <th sortpath="tags.hostname">RegionServer</th>
+ <th sortpath="tags.rack">Rack</th>
+ <th sortpath="tags.site">SiteId</th>
+ <th sortpath="status">Status</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr ng-repeat="item in regionserverList">
+ <td>
+ <a ui-sref="regionDetail({siteId: site, hostname: item.tags.hostname})">{{item.tags.hostname}}</a>
+ </td>
+ <td>{{item.tags.rack}}</td>
+ <td>{{item.tags.site}}</td>
+ <td>
+ <span ng-if="item.status===live" class="label label-success">Healthy</span>
+ <span ng-if="item.status===dead" class="label label-danger">UnHealthy</span>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+</div>
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/style/index.css
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/style/index.css b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/style/index.css
new file mode 100644
index 0000000..aa215ab
--- /dev/null
+++ b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/style/index.css
@@ -0,0 +1,88 @@
+@CHARSET "UTF-8";
+/*
+ * 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.
+ */
+
+.hadoopMetric-chart {
+ position: relative;
+ margin-bottom: 15px;
+}
+
+.hadoopMetric-chart h3 {
+ font-size: 20px;
+ margin: 10px 0 0 0;
+}
+
+.hadoopMetric-chart .hadoopMetric-chart-container {
+ height: 300px;
+ position: relative;
+}
+
+.hadoopMetric-chart .hadoopMetric-no-chart-data {
+ position:absolute;
+ left: 38%;
+ top: 40%;
+ font-size: 20px;
+ color: #999;
+}
+
+.with-border .hadoopMetric-chart {
+ padding-bottom: 15px;
+ margin-bottom: 15px;
+ border-bottom: 1px solid #f4f4f4;
+}
+
+.with-border .hadoopMetric-chart:last-child {
+ padding-bottom: 0;
+ margin-bottom: 0;
+ border-bottom: 0;
+}
+
+.hadoopMetric-widget {
+ width: 100%;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
+ border-radius: 2px;
+ padding: 10px;
+}
+
+.hadoopMetric-widget h3 {
+ margin: 0;
+ padding: 0;
+}
+
+.hadoopMetric-widget .hadoopMetric-chart-container {
+ height: 100px;
+}
+
+.hadoopMetric-summary-a {
+ color: #fff;
+}
+
+.small-box.hadoopMetric-widget {
+ margin: 0;
+ height: 100%;
+ min-height: 110px;
+}
+
+.hadoopMetric-widget-detail {
+ margin-left: 12px;
+ margin-top: 10px;
+}
+
+.hadoopMetric-table {
+ text-align: right;
+}
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/widgets/availabilityChart.js
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/widgets/availabilityChart.js b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/widgets/availabilityChart.js
new file mode 100644
index 0000000..bd0a278
--- /dev/null
+++ b/eagle-metric/eagle-hbase-web/src/main/webapp/app/apps/hbase/widgets/availabilityChart.js
@@ -0,0 +1,145 @@
+/*
+ * 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.
+ */
+
+(function () {
+ /**
+ * `register` without params will load the module which using require
+ */
+ register(function (hadoopMetricApp) {
+ var COLOR_MAPPING = {
+ HDFS: 'orange',
+ HBase: 'yellow',
+ Yarn: 'green'
+ };
+
+ hadoopMetricApp.directive("hadoopMetricWidget", function () {
+ return {
+ restrict: 'AE',
+ controller: function ($scope, $attrs, METRIC, Application, $interval, Site, $wrapState) {
+ // Get site
+ var site = $scope.site;
+ var refreshInterval;
+
+ if(!site) {
+ $scope.list = $.map(Application.find("HADOOP_METRIC_MONITOR"), function (app) {
+ return {
+ siteId: app.site.siteId,
+ siteName: app.site.siteName || app.site.siteId
+ };
+ });
+ } else {
+ $scope.list = [{
+ siteId: site.siteId,
+ siteName: site.siteName || site.siteId
+ }];
+ }
+ // Get type
+ $scope.type = $attrs.type;
+
+ // Customize chart color
+ $scope.bgColor = COLOR_MAPPING[$scope.type];
+
+ function countHBaseRole(site, status, role, groups, filed, limit) {
+ var jobCond = {
+ site: site,
+ status: status,
+ role: role
+ };
+ return METRIC.aggHBaseInstance(jobCond, groups, filed, limit);
+ }
+
+ // Ref: jpm widget if need keep refresh the widget
+
+ function refresh() {
+ $.each($scope.list, function (i, site) {
+
+ countHBaseRole(site.siteId, "active", "hmaster", ["site"], "count")._promise.then(function (res) {
+ $.map(res, function (data) {
+ $scope.hmasteractivenum = data.value[0];
+ });
+ });
+ countHBaseRole(site.siteId, "standby", "hmaster", ["site"], "count")._promise.then(function (res) {
+ $.map(res, function (data) {
+ $scope.hmasterstandbynum = data.value[0];
+ });
+ });
+ countHBaseRole(site.siteId, "live", "regionserver", ["site"], "count")._promise.then(function (res) {
+ $.map(res, function (data) {
+ $scope.regionserverhealtynum = data.value[0];
+ });
+ });
+ countHBaseRole(site.siteId, "dead", "regionserver", ["site"], "count")._promise.then(function (res) {
+ $.map(res, function (data) {
+ $scope.regionserverunhealtynum = data.value[0];
+ });
+ });
+ });
+ }
+
+ refresh();
+ refreshInterval = $interval(refresh, 30 * 1000);
+
+ $scope.$on('$destroy', function () {
+ $interval.cancel(refreshInterval);
+ });
+ },
+ template:
+ '<div class="small-box hadoopMetric-widget bg-{{bgColor}}">' +
+ '<div class="inner">' +
+ '<h3>{{type}}</h3>' +
+ '<div ng-show="hmasteractivenum" class="hadoopMetric-widget-detail">' +
+ '<a ui-sref="HBaseMetric({siteId: site.siteId})">' +
+ '<span>{{hmasteractivenum+hmasterstandbynum}}</span> Masters (' +
+ '<span ng-show="hmasteractivenum">{{hmasteractivenum}}</span><span ng-show="!hmasteractivenum">0</span> Active / ' +
+ '<span ng-show="hmasterstandbynum">{{hmasterstandbynum}}</span><span ng-show="!hmasterstandbynum">0</span> Standby)' +
+ '</a>' +
+ '</div>' +
+ '<div ng-show="!hmasteractivenum" class="hadoopMetric-widget-detail">' +
+ '<span class="fa fa-question-circle"></span><span> NO DATA</span>' +
+ '</div>' +
+ '<div ng-show="hmasteractivenum" class="hadoopMetric-widget-detail">' +
+ '<a ui-sref="regionList({siteId: site.siteId})">' +
+ '<span>{{regionserverhealtynum+regionserverunhealtynum}}</span> RegionServers (' +
+ '<span ng-show="regionserverhealtynum">{{regionserverhealtynum}}</span><span ng-show="!regionserverhealtynum">0</span> Healthy / ' +
+ '<span ng-show="regionserverunhealtynum">{{regionserverunhealtynum}}</span><span ng-show="!regionserverunhealtynum">0</span> Unhealthy)' +
+ '</a>' +
+ '</div>' +
+ '</div>' +
+ '<div class="icon">' +
+ '<i class="fa fa-taxi"></i>' +
+ '</div>' +
+ '</div>',
+ replace: true
+ };
+ });
+
+ function withType(serviceType) {
+ /**
+ * Customize the widget content. Return false will prevent auto compile.
+ * @param {{}} $element
+ * @param {function} $element.append
+ */
+ return function registerWidget($element) {
+ $element.append(
+ $("<div hadoop-metric-widget data-type='" + serviceType + "'>")
+ );
+ };
+ }
+ hadoopMetricApp.widget("availabilityHBaseChart", withType('HBase'), true);
+ });
+})();
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hbase-web/src/main/webapp/package.json
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/main/webapp/package.json b/eagle-metric/eagle-hbase-web/src/main/webapp/package.json
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hbase-web/src/test/org/apache/eagle/metric/HBaseMetricWebApplicationProviderTest.java
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hbase-web/src/test/org/apache/eagle/metric/HBaseMetricWebApplicationProviderTest.java b/eagle-metric/eagle-hbase-web/src/test/org/apache/eagle/metric/HBaseMetricWebApplicationProviderTest.java
new file mode 100644
index 0000000..eae05e5
--- /dev/null
+++ b/eagle-metric/eagle-hbase-web/src/test/org/apache/eagle/metric/HBaseMetricWebApplicationProviderTest.java
@@ -0,0 +1,100 @@
+package org.apache.eagle.metric;/*
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ */
+import com.google.inject.Inject;
+import org.apache.eagle.app.resource.ApplicationResource;
+import org.apache.eagle.app.service.ApplicationOperations;
+import org.apache.eagle.app.test.ApplicationTestBase;
+import org.apache.eagle.metadata.model.ApplicationEntity;
+import org.apache.eagle.metadata.model.SiteEntity;
+import org.apache.eagle.metadata.resource.SiteResource;
+import org.apache.eagle.metadata.service.ApplicationStatusUpdateService;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @Since 2/20/17.
+ */
+public class HBaseMetricWebApplicationProviderTest extends ApplicationTestBase {
+ @Inject
+ private SiteResource siteResource;
+
+ @Inject
+ private ApplicationResource applicationResource;
+
+ @Inject
+ private ApplicationStatusUpdateService statusUpdateService;
+
+ private void installDependencies(){
+ ApplicationOperations.InstallOperation installDependency1 = new ApplicationOperations.InstallOperation("test_site", "TOPOLOGY_HEALTH_CHECK_APP", ApplicationEntity.Mode.LOCAL);
+ applicationResource.installApplication(installDependency1);
+
+ ApplicationOperations.InstallOperation installDependency2 = new ApplicationOperations.InstallOperation("test_site", "HADOOP_METRIC_MONITOR", ApplicationEntity.Mode.LOCAL);
+ applicationResource.installApplication(installDependency2);
+ }
+
+ /**
+ * register site
+ * install app
+ * start app
+ * stop app
+ * uninstall app
+ *
+ * @throws InterruptedException
+ */
+ @Test
+ public void testApplicationLifecycle() throws InterruptedException {
+ // Create local site
+ SiteEntity siteEntity = new SiteEntity();
+ siteEntity.setSiteId("test_site");
+ siteEntity.setSiteName("Test Site");
+ siteEntity.setDescription("Test Site for HBASE_METRIC_WEB_APP");
+ siteResource.createSite(siteEntity);
+ Assert.assertNotNull(siteEntity.getUuid());
+
+
+
+ ApplicationOperations.InstallOperation installOperation = new ApplicationOperations.InstallOperation("test_site", "HBASE_METRIC_WEB_APP", ApplicationEntity.Mode.LOCAL);
+ installOperation.setConfiguration(getConf());
+ installDependencies();
+ // Install application
+ ApplicationEntity applicationEntity = applicationResource.installApplication(installOperation).getData();
+ //Todo: comment these for now, because they haven't been implemented
+ // Start application
+// applicationResource.startApplication(new ApplicationOperations.StartOperation(applicationEntity.getUuid()));
+// // Stop application
+// applicationResource.stopApplication(new ApplicationOperations.StopOperation(applicationEntity.getUuid()));
+ //Uninstall application
+ awaitApplicationStop(applicationEntity);
+ applicationResource.uninstallApplication(new ApplicationOperations.UninstallOperation(applicationEntity.getUuid()));
+ try {
+ applicationResource.getApplicationEntityByUUID(applicationEntity.getUuid());
+ Assert.fail("Application instance (UUID: " + applicationEntity.getUuid() + ") should have been uninstalled");
+ } catch (Exception ex) {
+ // Expected exception
+ }
+ }
+
+ private Map<String, Object> getConf() {
+ Map<String, Object> conf = new HashMap<>();
+ conf.put("service.host", "localhost");
+ conf.put("service.port", "9090");
+ return conf;
+ }
+}
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hdfs-web/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hdfs-web/pom.xml b/eagle-metric/eagle-hdfs-web/pom.xml
new file mode 100644
index 0000000..dd38416
--- /dev/null
+++ b/eagle-metric/eagle-hdfs-web/pom.xml
@@ -0,0 +1,57 @@
+<!--
+ ~ 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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>eagle-metric-parent</artifactId>
+ <groupId>org.apache.eagle</groupId>
+ <version>0.5.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>eagle-hdfs-web</artifactId>
+ <name>Eagle::App::HadoopMetric::Hdfs::WebUI</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.eagle</groupId>
+ <artifactId>eagle-app-base</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.eagle</groupId>
+ <artifactId>eagle-hadoop-metric</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.eagle</groupId>
+ <artifactId>eagle-topology-app</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/webapp/app</directory>
+ <targetPath>assets/</targetPath>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+ </build>
+</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hdfs-web/src/main/java/org/apache/eagle/metric/HdfsMetricWebApplicationProvider.java
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hdfs-web/src/main/java/org/apache/eagle/metric/HdfsMetricWebApplicationProvider.java b/eagle-metric/eagle-hdfs-web/src/main/java/org/apache/eagle/metric/HdfsMetricWebApplicationProvider.java
new file mode 100644
index 0000000..434e1f4
--- /dev/null
+++ b/eagle-metric/eagle-hdfs-web/src/main/java/org/apache/eagle/metric/HdfsMetricWebApplicationProvider.java
@@ -0,0 +1,23 @@
+/*
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ */
+package org.apache.eagle.metric;
+
+import org.apache.eagle.app.StaticApplicationProvider;
+
+public class HdfsMetricWebApplicationProvider extends StaticApplicationProvider {
+ // HdfsWebApplicationProvider SPI Interface
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hdfs-web/src/main/resources/META-INF/providers/org.apache.eagle.metric.HdfsMetricWebApplicationProvider.xml
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hdfs-web/src/main/resources/META-INF/providers/org.apache.eagle.metric.HdfsMetricWebApplicationProvider.xml b/eagle-metric/eagle-hdfs-web/src/main/resources/META-INF/providers/org.apache.eagle.metric.HdfsMetricWebApplicationProvider.xml
new file mode 100644
index 0000000..b6f70d1
--- /dev/null
+++ b/eagle-metric/eagle-hdfs-web/src/main/resources/META-INF/providers/org.apache.eagle.metric.HdfsMetricWebApplicationProvider.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ ~ 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.
+ -->
+
+<application>
+ <type>HDFS_METRIC_WEB_APP</type>
+ <name>Hdfs Metric Monitoring Web </name>
+ <viewPath>/apps/hdfs</viewPath>
+ <description>Hdfs Metric Monitoring Web</description>
+ <dependencies>
+ <dependency>
+ <type>HADOOP_METRIC_MONITOR</type>
+ <required>true</required>
+ </dependency>
+ <dependency>
+ <type>TOPOLOGY_HEALTH_CHECK_APP</type>
+ <required>true</required>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <property>
+ <name>service.host</name>
+ <displayName>Eagle Service Host</displayName>
+ <description>Set additional eagle service host, default: using current host</description>
+ </property>
+ <property>
+ <name>service.port</name>
+ <displayName>Eagle Service Port</displayName>
+ <description>Set additional eagle service port, default: using current port</description>
+ </property>
+ </configuration>
+</application>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hdfs-web/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hdfs-web/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider b/eagle-metric/eagle-hdfs-web/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
new file mode 100644
index 0000000..3dec9d0
--- /dev/null
+++ b/eagle-metric/eagle-hdfs-web/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
@@ -0,0 +1,16 @@
+# 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.
+
+org.apache.eagle.metric.HdfsMetricWebApplicationProvider
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/ctrl/overview.js
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/ctrl/overview.js b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/ctrl/overview.js
new file mode 100644
index 0000000..b8d57a7
--- /dev/null
+++ b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/ctrl/overview.js
@@ -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.
+ */
+
+(function () {
+ /**
+ * `register` without params will load the module which using require
+ */
+ register(function (hdfsMetricApp) {
+ hdfsMetricApp.controller("overviewCtrl", function (PageConfig) {
+ PageConfig.title = 'Hdfs';
+
+ });
+ });
+})();
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/index.html
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/index.html b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/index.html
new file mode 100644
index 0000000..799ad15
--- /dev/null
+++ b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/index.html
@@ -0,0 +1,6 @@
+<htm>
+ <body>
+ <h1>HDFS Metric Monitor Application!</h1>
+ <i><b>url</b>: /apps/hdfs</i>
+ </body>
+</htm>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/index.js
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/index.js b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/index.js
new file mode 100644
index 0000000..48b3feb
--- /dev/null
+++ b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/index.js
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+
+(function () {
+ /**
+ * `register` is global function that for application to set up 'controller', 'service', 'directive', 'route' in Eagle
+ */
+ var hdfsMetricApp = register(['ngRoute', 'ngAnimate', 'ui.router', 'eagle.service']);
+
+ hdfsMetricApp.route("HdfsMetric", {
+ url: "/hadoopService/hdfs",
+ site: true,
+ templateUrl: "partials/overview.html",
+ controller: "overviewCtrl",
+ resolve: {time: true}
+ });
+
+ hdfsMetricApp.portal({
+ name: "Services", icon: "heartbeat", list: [
+ {name: "HDFS", path: "hadoopService/hdfs"}
+ ]
+ }, true);
+
+ hdfsMetricApp.requireCSS("style/index.css");
+ hdfsMetricApp.require("widget/availabilityChart.js");
+ hdfsMetricApp.require("ctrl/overview.js");
+})();
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/partials/overview.html
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/partials/overview.html b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/partials/overview.html
new file mode 100644
index 0000000..678b221
--- /dev/null
+++ b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/partials/overview.html
@@ -0,0 +1,17 @@
+<!--
+ 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.
+ -->
+
+HDFS Page
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/style/index.css
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/style/index.css b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/style/index.css
new file mode 100644
index 0000000..aa215ab
--- /dev/null
+++ b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/style/index.css
@@ -0,0 +1,88 @@
+@CHARSET "UTF-8";
+/*
+ * 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.
+ */
+
+.hadoopMetric-chart {
+ position: relative;
+ margin-bottom: 15px;
+}
+
+.hadoopMetric-chart h3 {
+ font-size: 20px;
+ margin: 10px 0 0 0;
+}
+
+.hadoopMetric-chart .hadoopMetric-chart-container {
+ height: 300px;
+ position: relative;
+}
+
+.hadoopMetric-chart .hadoopMetric-no-chart-data {
+ position:absolute;
+ left: 38%;
+ top: 40%;
+ font-size: 20px;
+ color: #999;
+}
+
+.with-border .hadoopMetric-chart {
+ padding-bottom: 15px;
+ margin-bottom: 15px;
+ border-bottom: 1px solid #f4f4f4;
+}
+
+.with-border .hadoopMetric-chart:last-child {
+ padding-bottom: 0;
+ margin-bottom: 0;
+ border-bottom: 0;
+}
+
+.hadoopMetric-widget {
+ width: 100%;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
+ border-radius: 2px;
+ padding: 10px;
+}
+
+.hadoopMetric-widget h3 {
+ margin: 0;
+ padding: 0;
+}
+
+.hadoopMetric-widget .hadoopMetric-chart-container {
+ height: 100px;
+}
+
+.hadoopMetric-summary-a {
+ color: #fff;
+}
+
+.small-box.hadoopMetric-widget {
+ margin: 0;
+ height: 100%;
+ min-height: 110px;
+}
+
+.hadoopMetric-widget-detail {
+ margin-left: 12px;
+ margin-top: 10px;
+}
+
+.hadoopMetric-table {
+ text-align: right;
+}
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/widget/availabilityChart.js
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/widget/availabilityChart.js b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/widget/availabilityChart.js
new file mode 100644
index 0000000..fbfc73d
--- /dev/null
+++ b/eagle-metric/eagle-hdfs-web/src/main/webapp/app/apps/hdfs/widget/availabilityChart.js
@@ -0,0 +1,105 @@
+/*
+ * 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.
+ */
+
+(function () {
+ /**
+ * `register` without params will load the module which using require
+ */
+ register(function (hdfsMetricApp) {
+ var COLOR_MAPPING = {
+ HDFS: 'orange',
+ HBase: 'yellow',
+ Yarn: 'green',
+ };
+
+ var widgetChartOption = {
+ color: ['#FFFFFF'],
+ grid: {
+ top: 0,
+ right: 0,
+ bottom: 0,
+ left: 0,
+ containLabel: false,
+ },
+ xAxis: {
+ axisLine: {show: false},
+ axisLabel: {show: false},
+ },
+ yAxis: [{
+ axisLine: {show: false},
+ axisLabel: {show: false},
+ axisTick: {show: false},
+ splitLine: {show: false},
+ }],
+ };
+
+ hdfsMetricApp.directive("hdfsMetricWidget", function () {
+ return {
+ restrict: 'AE',
+ controller: function($scope, $attrs) {
+ // Get site
+ var site = $scope.site;
+
+ // Get type
+ $scope.type = $attrs.type;
+
+ // Customize chart color
+ $scope.bgColor = COLOR_MAPPING[$scope.type];
+
+ $scope.chartOption = widgetChartOption;
+
+ // Mock fetch data
+ var now = +new Date();
+ var data = [];
+ for(var j = 0 ; j < 30 ; j += 1) {
+ data.push({x: now + j * 1000 * 60, y: Math.random() * 100});
+ }
+ $scope.series = [{
+ name: '',
+ type: 'line',
+ data: data,
+ showSymbol: false,
+ }];
+
+ // Ref: jpm widget if need keep refresh the widget
+ },
+ template:
+ '<div class="hadoopMetric-widget bg-{{bgColor}}">' +
+ '<h3>{{type}}</h3>' +
+ '<div chart class="hadoopMetric-chart-container" series="series" option="chartOption"></div>' +
+ '</div>',
+ replace: true
+ };
+ });
+
+ function withType(serviceType) {
+ /**
+ * Customize the widget content. Return false will prevent auto compile.
+ * @param {{}} $element
+ * @param {function} $element.append
+ */
+ return function registerWidget($element) {
+ $element.append(
+ $("<div hdfs-metric-widget data-type='" + serviceType + "'>")
+ );
+ }
+ }
+
+ hdfsMetricApp.widget("availabilityHdfsChart", withType('HDFS'), true);
+ });
+})();
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hdfs-web/src/main/webapp/package.json
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hdfs-web/src/main/webapp/package.json b/eagle-metric/eagle-hdfs-web/src/main/webapp/package.json
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-metric/eagle-hdfs-web/src/test/org/apache/eagle/metric/HdfsMetricWebApplicationProviderTest.java
----------------------------------------------------------------------
diff --git a/eagle-metric/eagle-hdfs-web/src/test/org/apache/eagle/metric/HdfsMetricWebApplicationProviderTest.java b/eagle-metric/eagle-hdfs-web/src/test/org/apache/eagle/metric/HdfsMetricWebApplicationProviderTest.java
new file mode 100644
index 0000000..8e61af4
--- /dev/null
+++ b/eagle-metric/eagle-hdfs-web/src/test/org/apache/eagle/metric/HdfsMetricWebApplicationProviderTest.java
@@ -0,0 +1,101 @@
+/*
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ */
+package org.apache.eagle.metric;
+import com.google.inject.Inject;
+import org.apache.eagle.app.resource.ApplicationResource;
+import org.apache.eagle.app.service.ApplicationOperations;
+import org.apache.eagle.app.test.ApplicationTestBase;
+import org.apache.eagle.metadata.model.ApplicationEntity;
+import org.apache.eagle.metadata.model.SiteEntity;
+import org.apache.eagle.metadata.resource.SiteResource;
+import org.apache.eagle.metadata.service.ApplicationStatusUpdateService;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @Since 2/20/17.
+ */
+public class HdfsMetricWebApplicationProviderTest extends ApplicationTestBase {
+ @Inject
+ private SiteResource siteResource;
+
+ @Inject
+ private ApplicationResource applicationResource;
+
+ @Inject
+ private ApplicationStatusUpdateService statusUpdateService;
+
+ private void installDependencies(){
+ ApplicationOperations.InstallOperation installDependency1 = new ApplicationOperations.InstallOperation("test_site", "TOPOLOGY_HEALTH_CHECK_APP", ApplicationEntity.Mode.LOCAL);
+ applicationResource.installApplication(installDependency1);
+
+ ApplicationOperations.InstallOperation installDependency2 = new ApplicationOperations.InstallOperation("test_site", "HADOOP_METRIC_MONITOR", ApplicationEntity.Mode.LOCAL);
+ applicationResource.installApplication(installDependency2);
+ }
+
+ /**
+ * register site
+ * install app
+ * start app
+ * stop app
+ * uninstall app
+ *
+ * @throws InterruptedException
+ */
+ @Test
+ public void testApplicationLifecycle() throws InterruptedException {
+ // Create local site
+ SiteEntity siteEntity = new SiteEntity();
+ siteEntity.setSiteId("test_site");
+ siteEntity.setSiteName("Test Site");
+ siteEntity.setDescription("Test Site for HDFS_METRIC_WEB_APP");
+ siteResource.createSite(siteEntity);
+ Assert.assertNotNull(siteEntity.getUuid());
+
+
+
+ ApplicationOperations.InstallOperation installOperation = new ApplicationOperations.InstallOperation("test_site", "HDFS_METRIC_WEB_APP", ApplicationEntity.Mode.LOCAL);
+ installOperation.setConfiguration(getConf());
+ installDependencies();
+ // Install application
+ ApplicationEntity applicationEntity = applicationResource.installApplication(installOperation).getData();
+ //Todo: comment these for now, because they haven't been implemented
+ // Start application
+// applicationResource.startApplication(new ApplicationOperations.StartOperation(applicationEntity.getUuid()));
+// // Stop application
+// applicationResource.stopApplication(new ApplicationOperations.StopOperation(applicationEntity.getUuid()));
+ //Uninstall application
+ awaitApplicationStop(applicationEntity);
+ applicationResource.uninstallApplication(new ApplicationOperations.UninstallOperation(applicationEntity.getUuid()));
+ try {
+ applicationResource.getApplicationEntityByUUID(applicationEntity.getUuid());
+ Assert.fail("Application instance (UUID: " + applicationEntity.getUuid() + ") should have been uninstalled");
+ } catch (Exception ex) {
+ // Expected exception
+ }
+ }
+
+ private Map<String, Object> getConf() {
+ Map<String, Object> conf = new HashMap<>();
+ conf.put("service.host", "localhost");
+ conf.put("service.port", "9090");
+ return conf;
+ }
+}
[4/4] eagle git commit: [EAGLE-900] Only show left navigation item
(HDFS, HBase) when we install the JMX application
Posted by jj...@apache.org.
[EAGLE-900] Only show left navigation item (HDFS, HBase) when we install the JMX application
[EAGLE-900] Only show left navigation item (HDFS, HBase) when we install the JMX application
- Refactor eagle-hadoop-metric to single app for every service, for example, there is a eagle-hadoop-metric before, now eagle-hadoop-metric is split into eagle-hadoop-metric, eagle-hdfs-metric and eagle-hbase-metric, we can see HBase navigation item only if we install eagle-hbase-metric.
https://issues.apache.org/jira/browse/EAGLE-900
Author: chitin <ch...@gmail.com>
Closes #825 from chitin/eagle900-2.
Project: http://git-wip-us.apache.org/repos/asf/eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/eagle/commit/c32b7152
Tree: http://git-wip-us.apache.org/repos/asf/eagle/tree/c32b7152
Diff: http://git-wip-us.apache.org/repos/asf/eagle/diff/c32b7152
Branch: refs/heads/master
Commit: c32b7152595bb074745523cfd9d829484458d90e
Parents: c0198a0
Author: chitin <ch...@gmail.com>
Authored: Wed Feb 22 06:28:30 2017 +0000
Committer: r7raul1984 <ta...@yhd.com>
Committed: Wed Feb 22 06:28:30 2017 +0000
----------------------------------------------------------------------
eagle-hadoop-metric/pom.xml | 67 ----
.../eagle/metric/HadoopMetricMonitorApp.java | 41 ---
.../metric/HadoopMetricMonitorAppProdiver.java | 29 --
...le.metric.HadoopMetricMonitorAppProdiver.xml | 156 ---------
...org.apache.eagle.app.spi.ApplicationProvider | 16 -
.../src/main/resources/datasources.json | 19 --
.../src/main/resources/policies.json | 169 ----------
.../src/main/resources/publishments.json | 33 --
.../src/main/resources/streamdefinitions.json | 47 ---
.../webapp/app/apps/hadoop_metric/.editorconfig | 27 --
.../webapp/app/apps/hadoop_metric/config.json | 68 ----
.../hadoop_metric/ctrls/backupMasterListCtrl.js | 35 --
.../webapp/app/apps/hadoop_metric/ctrls/hdfs.js | 28 --
.../app/apps/hadoop_metric/ctrls/overview.js | 298 ----------------
.../hadoop_metric/ctrls/regionDetailCtrl.js | 286 ----------------
.../apps/hadoop_metric/ctrls/regionListCtrl.js | 38 ---
.../main/webapp/app/apps/hadoop_metric/index.js | 337 -------------------
.../partials/backupMasterList.html | 52 ---
.../apps/hadoop_metric/partials/hdfs/index.html | 19 --
.../apps/hadoop_metric/partials/overview.html | 111 ------
.../partials/region/regionDetail.html | 117 -------
.../partials/region/regionList.html | 53 ---
.../app/apps/hadoop_metric/style/index.css | 88 -----
.../hadoop_metric/widgets/availabilityChart.js | 145 --------
.../src/main/webapp/app/apps/index.html | 6 -
.../metric/HadoopMetricMonitorAppDebug.java | 23 --
.../HadoopMetricMonitorAppProviderTest.java | 89 -----
.../eagle/metric/SendSampleDataToKafka.java | 56 ---
.../src/test/resources/application.conf | 49 ---
.../resources/hadoop_jmx_metric_sample.json | 8 -
.../test/resources/integrate_test_policy.json | 37 --
eagle-metric/eagle-hadoop-metric/pom.xml | 34 ++
.../eagle/metric/HadoopMetricMonitorApp.java | 41 +++
.../metric/HadoopMetricMonitorAppProdiver.java | 29 ++
...le.metric.HadoopMetricMonitorAppProdiver.xml | 149 ++++++++
...org.apache.eagle.app.spi.ApplicationProvider | 16 +
.../src/main/resources/datasources.json | 19 ++
.../src/main/resources/policies.json | 169 ++++++++++
.../src/main/resources/publishments.json | 33 ++
.../src/main/resources/streamdefinitions.json | 47 +++
.../metric/HadoopMetricMonitorAppDebug.java | 23 ++
.../HadoopMetricMonitorAppProviderTest.java | 89 +++++
.../eagle/metric/SendSampleDataToKafka.java | 56 +++
.../src/test/resources/application.conf | 49 +++
.../resources/hadoop_jmx_metric_sample.json | 8 +
.../test/resources/integrate_test_policy.json | 37 ++
eagle-metric/eagle-hbase-web/pom.xml | 57 ++++
.../HBaseMetricWebApplicationProvider.java | 23 ++
...metric.HBaseMetricWebApplicationProvider.xml | 46 +++
...org.apache.eagle.app.spi.ApplicationProvider | 16 +
.../src/main/webapp/app/apps/hbase/config.json | 68 ++++
.../apps/hbase/ctrls/backupMasterListCtrl.js | 35 ++
.../webapp/app/apps/hbase/ctrls/overview.js | 298 ++++++++++++++++
.../app/apps/hbase/ctrls/regionDetailCtrl.js | 306 +++++++++++++++++
.../app/apps/hbase/ctrls/regionListCtrl.js | 38 +++
.../src/main/webapp/app/apps/hbase/index.html | 6 +
.../src/main/webapp/app/apps/hbase/index.js | 329 ++++++++++++++++++
.../apps/hbase/partials/backupMasterList.html | 52 +++
.../app/apps/hbase/partials/overview.html | 111 ++++++
.../hbase/partials/region/regionDetail.html | 117 +++++++
.../apps/hbase/partials/region/regionList.html | 53 +++
.../main/webapp/app/apps/hbase/style/index.css | 88 +++++
.../app/apps/hbase/widgets/availabilityChart.js | 145 ++++++++
.../src/main/webapp/package.json | 0
.../HBaseMetricWebApplicationProviderTest.java | 100 ++++++
eagle-metric/eagle-hdfs-web/pom.xml | 57 ++++
.../HdfsMetricWebApplicationProvider.java | 23 ++
....metric.HdfsMetricWebApplicationProvider.xml | 46 +++
...org.apache.eagle.app.spi.ApplicationProvider | 16 +
.../main/webapp/app/apps/hdfs/ctrl/overview.js | 29 ++
.../src/main/webapp/app/apps/hdfs/index.html | 6 +
.../src/main/webapp/app/apps/hdfs/index.js | 42 +++
.../webapp/app/apps/hdfs/partials/overview.html | 17 +
.../main/webapp/app/apps/hdfs/style/index.css | 88 +++++
.../app/apps/hdfs/widget/availabilityChart.js | 105 ++++++
.../eagle-hdfs-web/src/main/webapp/package.json | 0
.../HdfsMetricWebApplicationProviderTest.java | 101 ++++++
eagle-metric/pom.xml | 74 ++++
eagle-server/pom.xml | 11 +
...org.apache.eagle.app.spi.ApplicationProvider | 6 +-
pom.xml | 2 +-
81 files changed, 3308 insertions(+), 2549 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/pom.xml b/eagle-hadoop-metric/pom.xml
deleted file mode 100644
index 0677f3b..0000000
--- a/eagle-hadoop-metric/pom.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <parent>
- <artifactId>eagle-parent</artifactId>
- <groupId>org.apache.eagle</groupId>
- <version>0.5.0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <artifactId>eagle-hadoop-metric</artifactId>
- <name>Eagle::App::HadoopMetric</name>
- <dependencies>
- <dependency>
- <groupId>org.apache.eagle</groupId>
- <artifactId>eagle-app-base</artifactId>
- <version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- </exclusion>
- <exclusion>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.ow2.asm</groupId>
- <artifactId>asm</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.eagle</groupId>
- <artifactId>eagle-topology-app</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <resources>
- <resource>
- <directory>src/main/webapp/app</directory>
- <targetPath>assets/</targetPath>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- </resources>
- </build>
-</project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/java/org/apache/eagle/metric/HadoopMetricMonitorApp.java
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/java/org/apache/eagle/metric/HadoopMetricMonitorApp.java b/eagle-hadoop-metric/src/main/java/org/apache/eagle/metric/HadoopMetricMonitorApp.java
deleted file mode 100644
index 5aa27a3..0000000
--- a/eagle-hadoop-metric/src/main/java/org/apache/eagle/metric/HadoopMetricMonitorApp.java
+++ /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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.
- */
-package org.apache.eagle.metric;
-
-import backtype.storm.generated.StormTopology;
-import com.typesafe.config.Config;
-import org.apache.eagle.app.StormApplication;
-import org.apache.eagle.app.environment.builder.MetricDefinition;
-import org.apache.eagle.app.environment.impl.StormEnvironment;
-
-import java.util.Calendar;
-
-public class HadoopMetricMonitorApp extends StormApplication {
- @Override
- public StormTopology execute(Config config, StormEnvironment environment) {
- return environment.newApp(config)
- .fromStream("HADOOP_JMX_METRIC_STREAM")
- .saveAsMetric(MetricDefinition
- .metricType("HADOOP_JMX_METRICS")
- .namedByField("metric")
- .eventTimeByField("timestamp")
- .dimensionFields("host","component","site")
- .granularity(Calendar.MINUTE)
- .valueField("value"))
- .toTopology();
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/java/org/apache/eagle/metric/HadoopMetricMonitorAppProdiver.java
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/java/org/apache/eagle/metric/HadoopMetricMonitorAppProdiver.java b/eagle-hadoop-metric/src/main/java/org/apache/eagle/metric/HadoopMetricMonitorAppProdiver.java
deleted file mode 100644
index dc7ea97..0000000
--- a/eagle-hadoop-metric/src/main/java/org/apache/eagle/metric/HadoopMetricMonitorAppProdiver.java
+++ /dev/null
@@ -1,29 +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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.
- */
-package org.apache.eagle.metric;
-
-import org.apache.eagle.app.spi.AbstractApplicationProvider;
-
-/**
- * Metadata: META-INF/providers/org.apache.eagle.metric.HadoopMetricMonitorAppProdiver.xml.
- */
-public class HadoopMetricMonitorAppProdiver extends AbstractApplicationProvider<HadoopMetricMonitorApp> {
- @Override
- public HadoopMetricMonitorApp getApplication() {
- return new HadoopMetricMonitorApp();
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/resources/META-INF/providers/org.apache.eagle.metric.HadoopMetricMonitorAppProdiver.xml
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/META-INF/providers/org.apache.eagle.metric.HadoopMetricMonitorAppProdiver.xml b/eagle-hadoop-metric/src/main/resources/META-INF/providers/org.apache.eagle.metric.HadoopMetricMonitorAppProdiver.xml
deleted file mode 100644
index 8262da9..0000000
--- a/eagle-hadoop-metric/src/main/resources/META-INF/providers/org.apache.eagle.metric.HadoopMetricMonitorAppProdiver.xml
+++ /dev/null
@@ -1,156 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- ~ 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.
- -->
-
-<application>
- <type>HADOOP_METRIC_MONITOR</type>
- <name>Hadoop Metrics Monitor</name>
- <viewPath>/apps/hadoop_metric</viewPath>
- <dependencies>
- <dependency>
- <type>TOPOLOGY_HEALTH_CHECK_APP</type>
- <required>true</required>
- </dependency>
- </dependencies>
- <configuration>
- <!-- data fromStream configurations -->
- <property>
- <name>dataSinkConfig.HADOOP_JMX_METRIC_STREAM.topic</name>
- <displayName>JMX Metric Kafka Topic</displayName>
- <value>hadoop_jmx_metric_${siteId}</value>
- <description>Hadoop JMX metric kafka topic name for stream: HADOOP_JMX_METRIC_STREAM</description>
- <required>true</required>
- </property>
- <property>
- <name>dataSinkConfig.brokerList</name>
- <displayName>Kafka Brokers</displayName>
- <value>localhost:6667</value>
- <description>Sourced Kafka Brokers like broker1,broker2,...</description>
- <required>true</required>
- </property>
- <property>
- <name>dataSourceConfig.zkConnection</name>
- <displayName>Zookeeper Quorum</displayName>
- <value>localhost:2181</value>
- <description>Kafka Zookeeper Quorum</description>
- <required>true</required>
- </property>
- <property>
- <name>dataSourceConfig.fetchSize</name>
- <displayName>Kafka Fetch Size</displayName>
- <value>1048576</value>
- <description>Kafka Fetch Size</description>
- <required>false</required>
- </property>
- <property>
- <name>dataSourceConfig.transactionZKRoot</name>
- <displayName>Kafka Transaction Root Path</displayName>
- <value>/consumers</value>
- <description>Kafka Transaction Root Path</description>
- <required>false</required>
- </property>
- <property>
- <name>dataSourceConfig.consumerGroupId</name>
- <displayName>Kafka Consumer Group ID</displayName>
- <value>eagleConsumer</value>
- <description>Kafka Consumer Group ID</description>
- <required>false</required>
- </property>
- <property>
- <name>dataSourceConfig.brokerZkPath</name>
- <displayName>Kafka Broker ZkPath</displayName>
- <description>Kafka Broker ZkPath</description>
- <required>false</required>
- </property>
- <property>
- <name>dataSourceConfig.txZkServers</name>
- <displayName>Kafka Transaction Zookeeper Servers</displayName>
- <description>Kafka Transaction Zookeeper Servers</description>
- <value>localhost:2181</value>
- <required>true</required>
- </property>
- <property>
- <name>dataSourceConfig.transactionStateUpdateMS</name>
- <value>2000</value>
- <displayName>Kafka Transaction Status Update MS</displayName>
- <description>Kafka Transaction Status Update MS</description>
- <required>false</required>
- </property>
- <property>
- <name>service.host</name>
- <displayName>Eagle Service Host</displayName>
- <description>Set additional eagle service host, default: using current host</description>
- </property>
- <property>
- <name>service.port</name>
- <displayName>Eagle Service Port</displayName>
- <description>Set additional eagle service port, default: using current port</description>
- </property>
- </configuration>
- <streams>
- <stream>
- <streamId>HADOOP_JMX_METRIC_STREAM</streamId>
- <description>Hadoop JMX Metric Stream including name node, resource manager, etc.</description>
- <columns>
- <column>
- <name>host</name>
- <type>string</type>
- </column>
- <column>
- <name>timestamp</name>
- <type>long</type>
- </column>
- <column>
- <name>metric</name>
- <type>string</type>
- </column>
- <column>
- <name>component</name>
- <type>string</type>
- </column>
- <column>
- <name>site</name>
- <type>string</type>
- </column>
- <column>
- <name>value</name>
- <type>double</type>
- <defaultValue>0.0</defaultValue>
- </column>
- </columns>
- </stream>
- </streams>
- <docs>
- <install>
- <b>How to Install</b>
- <ol>
- <li>Create a kafka topic named <code>hadoop_jmx_metric_{SITE_ID}</code></li>
- <li>Setup metric collector for monitored Hadoop/HBase using <a target="_blank" href="https://github.com/apache/incubator-eagle/tree/master/eagle-external/hadoop_jmx_collector">hadoop_jmx_collector</a></li>
- <li>Setup <code>Kafka Topic Name</code> and <code>Kafka Broker List </code> in <code>Settings</code> tab</li>
- <li>Click "Install" button then you will see the <code>HADOOP_JMX_METRIC_STREAM_{SITE_ID}</code> in <a href="/#/alert/streamList">Streams</a></li>
- </ol>
- </install>
- <uninstall>
- <b>How to Uninstall</b>
- <ol>
- <li>Stop and remove installed <code>hadoop_jmx_collector</code></li>
- <li>Remove kafka topic <code>hadoop_jmx_metric_{SITE_ID}</code></li>
- <li>Click "Uninstall" button which will remove stream <code>HADOOP_JMX_METRIC_STREAM_{SITE_ID}</code></li>
- </ol>
- </uninstall>
- </docs>
-</application>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider b/eagle-hadoop-metric/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
deleted file mode 100644
index 25d911d..0000000
--- a/eagle-hadoop-metric/src/main/resources/META-INF/services/org.apache.eagle.app.spi.ApplicationProvider
+++ /dev/null
@@ -1,16 +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.
-
-org.apache.eagle.metric.HadoopMetricMonitorAppProdiver
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/resources/datasources.json
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/datasources.json b/eagle-hadoop-metric/src/main/resources/datasources.json
deleted file mode 100644
index 5c10696..0000000
--- a/eagle-hadoop-metric/src/main/resources/datasources.json
+++ /dev/null
@@ -1,19 +0,0 @@
-[
- {
- "name": "hadoop_jmx_datasource",
- "type": "KAFKA",
- "properties": {
- },
- "topic": "hadoop_jmx_metrics",
- "schemeCls": "org.apache.eagle.alert.engine.scheme.JsonScheme",
- "codec": {
- "streamNameSelectorProp": {
- "userProvidedStreamName" : "hadoopJmxMetricEventStream",
- "streamNameFormat":"%s"
- },
- "streamNameSelectorCls":"org.apache.eagle.alert.engine.scheme.JsonStringStreamNameSelector",
- "timestampColumn": "timestamp",
- "timestampFormat": ""
- }
- }
-]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/resources/policies.json
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/policies.json b/eagle-hadoop-metric/src/main/resources/policies.json
deleted file mode 100644
index 811ffb0..0000000
--- a/eagle-hadoop-metric/src/main/resources/policies.json
+++ /dev/null
@@ -1,169 +0,0 @@
-[
- {
- "name": "haStatePolicy",
- "description": "ha state check for hadoop name node",
- "definition": {
- "inputStreams": [
- "hadoopJmxMetricEventStream"
- ],
- "outputStreams": [
- "tmp"
- ],
- "type": "siddhi",
- "value": " from every a = hadoopJmxMetricEventStream[metric==\"hadoop.namenode.fsnamesystem.hastate\"] -> b = hadoopJmxMetricEventStream[metric==a.metric and b.host == a.host and (convert(a.value, \"long\\\") != convert(value, \"long\"))] within 10 min select a.host, a.value as oldHaState, b.value as newHaState, b.timestamp as timestamp, b.metric as metric, b.component as component, b.site as site insert into tmp; "
- },
- "partitionSpec": [
- {
- "streamId": "hadoopJmxMetricEventStream",
- "type": "GROUPBY",
- "columns": [
- "host"
- ]
- }
- ]
- },
-
- {
- "name": "capacityUsedPolicy",
- "description": "capacity usage check for hadoop cluster",
- "definition": {
- "inputStreams": [
- "hadoopJmxMetricEventStream"
- ],
- "outputStreams": [
- "tmp"
- ],
- "type": "siddhi",
- "value": " from hadoopJmxMetricEventStream[metric == \"hadoop.namenode.fsnamesystemstate.capacityused\" and convert(value, \"long\") > 0]#window.externalTime(timestamp ,10 min) select metric, host, value, timestamp, component, site insert into tmp; "
- },
- "partitionSpec": [
- {
- "streamId": "hadoopJmxMetricEventStream",
- "type": "GROUPBY",
- "columns": [
- "host"
- ]
- }
- ]
- },
-
- {
- "name": "lastCheckPointTimePolicy",
- "description": "last check point interval check for hadoop name node pair",
- "definition": {
- "inputStreams": [
- "hadoopJmxMetricEventStream"
- ],
- "outputStreams": [
- "tmp"
- ],
- "type": "siddhi",
- "value": " from hadoopJmxMetricEventStream[metric == \"hadoop.namenode.dfs.lastcheckpointtime\" and (convert(value, \"long\") + 18000000) < timestamp]#window.externalTime(timestamp ,10 min) select metric, host, value, timestamp, component, site insert into tmp; "
- },
- "partitionSpec": [
- {
- "streamId": "hadoopJmxMetricEventStream",
- "type": "GROUPBY",
- "columns": [
- "host"
- ]
- }
- ]
- },
-
- {
- "name": "missingBlockPolicy",
- "description": "missing block number check for hadoop cluster",
- "definition": {
- "inputStreams": [
- "hadoopJmxMetricEventStream"
- ],
- "outputStreams": [
- "tmp"
- ],
- "type": "siddhi",
- "value": " from hadoopJmxMetricEventStream[metric == \"hadoop.namenode.dfs.missingblocks\" and convert(value, \"long\") > 0]#window.externalTime(timestamp ,10 min) select metric, host, value, timestamp, component, site insert into tmp; "
- },
- "partitionSpec": [
- {
- "streamId": "hadoopJmxMetricEventStream",
- "type": "GROUPBY",
- "columns": [
- "host"
- ]
- }
- ]
- },
-
- {
- "name": "namenodeTxLagPolicy",
- "description": "name node tx log lag check",
- "definition": {
- "inputStreams": [
- "hadoopJmxMetricEventStream"
- ],
- "outputStreams": [
- "tmp"
- ],
- "type": "siddhi",
- "value": " from every a = hadoopJmxMetricEventStream[metric==\"hadoop.namenode.journaltransaction.lastappliedorwrittentxid\"] -> b = hadoopJmxMetricEventStream[metric==a.metric and b.host != a.host and (max(convert(a.value, \"long\")) + 100) <= max(convert(value, \"long\"))] within 5 min select a.host as hostA, a.value as transactIdA, b.host as hostB, b.value as transactIdB insert into tmp; "
- },
- "partitionSpec": [
- {
- "streamId": "hadoopJmxMetricEventStream",
- "type": "GROUPBY",
- "columns": [
- "host"
- ]
- }
- ]
- },
-
- {
- "name": "nodecountPolicy",
- "description": "data node number check for hadoop cluster",
- "definition": {
- "inputStreams": [
- "hadoopJmxMetricEventStream"
- ],
- "outputStreams": [
- "tmp"
- ],
- "type": "siddhi",
- "value": " from every (e1 = hadoopJmxMetricEventStream[metric == \"hadoop.namenode.fsnamesystemstate.numlivedatanodes\" ]) -> e2 = hadoopJmxMetricEventStream[metric == e1.metric and host == e1.host and (convert(e1.value, \"long\") - 5) >= convert(value, \"long\") ] within 5 min select e1.metric, e1.host, e1.value as highNum, e1.timestamp as start, e2.value as lowNum, e2.timestamp as end insert into tmp; "
- },
- "partitionSpec": [
- {
- "streamId": "hadoopJmxMetricEventStream",
- "type": "GROUPBY",
- "columns": [
- "host"
- ]
- }
- ]
- },
-
- {
- "name": "nameNodeSafeModeCheckPolicy",
- "description": "safe mode check for name node",
- "definition": {
- "inputStreams": [
- "hadoopJmxMetricEventStream"
- ],
- "outputStreams": [
- "tmp"
- ],
- "type": "siddhi",
- "value": " from hadoopJmxMetricEventStream[component==\"namenode\" and metric == \"hadoop.namenode.fsnamesystemstate.fsstate\" and convert(value, \"long\") > 0]#window.externalTime(timestamp ,10 min) select metric, host, value, timestamp, component, site insert into tmp; "
- },
- "partitionSpec": [
- {
- "streamId": "hadoopJmxMetricEventStream",
- "type": "GROUPBY",
- "columns": [
- "host"
- ]
- }
- ]
- }
-]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/resources/publishments.json
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/publishments.json b/eagle-hadoop-metric/src/main/resources/publishments.json
deleted file mode 100644
index 10d16a4..0000000
--- a/eagle-hadoop-metric/src/main/resources/publishments.json
+++ /dev/null
@@ -1,33 +0,0 @@
-[
- {
- "name":"jmxStreamOutput_email",
- "type":"org.apache.eagle.alert.engine.publisher.impl.AlertEmailPublisher",
- "policyIds": [
- "perfmon_cpu_host_check", "perfmon_cpu_pool_check"
- ],
- "properties": {
- "subject":"Hadoop Jmx Metrics Alert",
- "template":"",
- "sender": "sender@corp.com",
- "recipients": "services@corp.com",
- "smtp.server":"smtp.mailhost.com",
- "connection": "plaintext",
- "smtp.port": "25"
- },
- "dedupIntervalMin" : "PT1M",
- "serializer" : "org.apache.eagle.alert.engine.publisher.impl.StringEventSerializer"
- },
- {
- "type": "org.apache.eagle.alert.engine.publisher.impl.AlertKafkaPublisher",
- "name":"jmxStreamOutput_kafka",
- "policyIds": [
- "perfmon_cpu_host_check"
- ],
- "dedupIntervalMin": "PT1M",
- "properties":{
- "kafka_broker":"localhost:9092",
- "topic":"jmx_alerts"
- },
- "serializer" : "org.apache.eagle.alert.engine.publisher.impl.StringEventSerializer"
- }
-]
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/resources/streamdefinitions.json
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/streamdefinitions.json b/eagle-hadoop-metric/src/main/resources/streamdefinitions.json
deleted file mode 100644
index 66a2c98..0000000
--- a/eagle-hadoop-metric/src/main/resources/streamdefinitions.json
+++ /dev/null
@@ -1,47 +0,0 @@
-[
- {
- "streamId": "hadoopJmxMetricEventStream",
- "dataSource": "hadoop_jmx_datasource",
- "description": "the data stream for hadoop jmx metrics",
- "validate": false,
- "timeseries": false,
- "columns": [
- {
- "name": "host",
- "type": "STRING",
- "defaultValue": "",
- "required": true
- },
- {
- "name": "timestamp",
- "type": "LONG",
- "defaultValue": 0,
- "required": true
- },
- {
- "name": "metric",
- "type": "STRING",
- "defaultValue": "default_hadoop_jmx_metric_name",
- "required": true
- },
- {
- "name": "component",
- "type": "STRING",
- "defaultValue": "namenode",
- "required": true
- },
- {
- "name": "site",
- "type": "STRING",
- "defaultValue": "hadoop",
- "required": true
- },
- {
- "name": "value",
- "type": "DOUBLE",
- "defaultValue": 0.0,
- "required": true
- }
- ]
- }
-]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/.editorconfig
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/.editorconfig b/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/.editorconfig
deleted file mode 100644
index 42a9b69..0000000
--- a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/.editorconfig
+++ /dev/null
@@ -1,27 +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.
-
-root = true
-
-[*]
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-indent_style = tab
-indent_size = 4
-
-[*.md]
-trim_trailing_whitespace = false
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/config.json
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/config.json b/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/config.json
deleted file mode 100644
index 88b14f6..0000000
--- a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/config.json
+++ /dev/null
@@ -1,68 +0,0 @@
-{
- "master": {
- "nonheap": "hadoop.memory.nonheapmemoryusage.used",
- "heap": "hadoop.memory.heapmemoryusage.used",
- "averageload": "hadoop.hbase.master.server.averageload",
- "ritcount": "hadoop.hbase.master.assignmentmanger.ritcount",
- "ritcountoverthreshold": "hadoop.hbase.master.assignmentmanger.ritcountoverthreshold",
- "AssignNumOps": "hadoop.hbase.master.assignmentmanger.assign_num_ops",
- "AssignMin": "hadoop.hbase.master.assignmentmanger.assign_min",
- "AssignMax": "hadoop.hbase.master.assignmentmanger.assign_max",
- "AssignPercentile75th": "hadoop.hbase.master.assignmentmanger.assign_75th_percentile",
- "AssignPercentile95th": "hadoop.hbase.master.assignmentmanger.assign_95th_percentile",
- "AssignPercentile99th": "hadoop.hbase.master.assignmentmanger.assign_99th_percentile",
- "BulkAssignNum_ops": "hadoop.hbase.master.assignmentmanger.bulkassign_num_ops",
- "BulkAssignMin": "hadoop.hbase.master.assignmentmanger.bulkassign_min",
- "BulkAssignMax": "hadoop.hbase.master.assignmentmanger.bulkassign_max",
- "BulkAssignPercentile75th": "hadoop.hbase.master.assignmentmanger.bulkassign_75th_percentile",
- "BulkAssignPercentile95th": "hadoop.hbase.master.assignmentmanger.bulkassign_95th_percentile",
- "BulkAssignPercentile99th": "hadoop.hbase.master.assignmentmanger.bulkassign_99th_percentile",
- "BalancerClusterNum_ops": "hadoop.hbase.master.balancer.balancercluster_num_ops",
- "BalancerClusterMin": "hadoop.hbase.master.balancer.balancercluster_min",
- "BalancerClusterMax": "hadoop.hbase.master.balancer.balancercluster_max",
- "BalancerClusterPercentile75th": "hadoop.hbase.master.balancer.balancercluster_75th_percentile",
- "BalancerClusterPercentile95th": "hadoop.hbase.master.balancer.balancercluster_95th_percentile",
- "BalancerClusterPercentile99th": "hadoop.hbase.master.balancer.balancercluster_99th_percentile",
- "HlogSplitTimeMin": "hadoop.hbase.master.filesystem.hlogsplittime_min",
- "HlogSplitTimeMax": "hadoop.hbase.master.filesystem.hlogsplittime_max",
- "HlogSplitTimePercentile75th": "hadoop.hbase.master.filesystem.hlogsplittime_75th_percentile",
- "HlogSplitTimePercentile95th": "hadoop.hbase.master.filesystem.hlogsplittime_95th_percentile",
- "HlogSplitTimePercentile99th": "hadoop.hbase.master.filesystem.hlogsplittime_99th_percentile",
- "HlogSplitSizeMin": "hadoop.hbase.master.filesystem.hlogsplitsize_min",
- "HlogSplitSizeMax": "hadoop.hbase.master.filesystem.hlogsplitsize_max",
- "MetaHlogSplitTimeMin": "hadoop.hbase.master.filesystem.metahlogsplittime_min",
- "MetaHlogSplitTimeMax": "hadoop.hbase.master.filesystem.metahlogsplittime_max",
- "MetaHlogSplitTimePercentile75th": "hadoop.hbase.master.filesystem.metahlogsplittime_75th_percentile",
- "MetaHlogSplitTimePercentile95th": "hadoop.hbase.master.filesystem.metahlogsplittime_95th_percentile",
- "MetaHlogSplitTimePercentile99th": "hadoop.hbase.master.filesystem.metahlogsplittime_99th_percentile",
- "MetaHlogSplitSizeMin": "hadoop.hbase.master.filesystem.metahlogsplitsize_min",
- "MetaHlogSplitSizeMax": "hadoop.hbase.master.filesystem.metahlogsplitsize_max"
- },
- "regionserver": {
- "nonheap" : "hadoop.memory.nonheapmemoryusage.used",
- "heap" : "hadoop.memory.heapmemoryusage.used",
- "directmemory" : "hadoop.bufferpool.direct.memoryused",
- "GCCount" : "hadoop.hbase.jvm.gccount",
- "GCTimeMillis" : "hadoop.hbase.jvm.gctimemillis",
- "QueueSize" : "hadoop.hbase.regionserver.ipc.queuesize",
- "NumCallsInGeneralQueue" : "hadoop.hbase.regionserver.ipc.numcallsingeneralqueue",
- "NumActiveHandler" : "hadoop.hbase.regionserver.ipc.numactivehandler",
- "IPCQueueTime99th" : "hadoop.hbase.regionserver.ipc.queuecalltime_99th_percentile",
- "IPCProcessTime99th" : "hadoop.hbase.regionserver.ipc.processcalltime_99th_percentile",
- "QueueCallTime_num_ops" : "hadoop.hbase.regionserver.ipc.queuecalltime_num_ops",
- "ProcessCallTime_num_ops" : "hadoop.hbase.regionserver.ipc.processcalltime_num_ops",
- "RegionCount" : "hadoop.hbase.regionserver.server.regioncount",
- "StoreCount" : "hadoop.hbase.regionserver.server.storecount",
- "MemStoreSize" : "hadoop.hbase.regionserver.server.memstoresize",
- "StoreFileSize" : "hadoop.hbase.regionserver.server.storefilesize",
- "TotalRequestCount" : "hadoop.hbase.regionserver.server.totalrequestcount",
- "ReadRequestCount" : "hadoop.hbase.regionserver.server.readrequestcount",
- "WriteRequestCount" : "hadoop.hbase.regionserver.server.writerequestcount",
- "SlitQueueLength" : "hadoop.hbase.regionserver.server.splitqueuelength",
- "CompactionQueueLength" : "hadoop.hbase.regionserver.server.compactionqueuelength",
- "FlushQueueLength" : "hadoop.hbase.regionserver.server.flushqueuelength",
- "BlockCacheSize" : "hadoop.hbase.regionserver.server.blockcachesize",
- "BlockCacheHitCount" : "hadoop.hbase.regionserver.server.blockcachehitcount",
- "BlockCacheCountHitPercent" : "hadoop.hbase.regionserver.server.blockcounthitpercent"
- }
-}
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/backupMasterListCtrl.js
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/backupMasterListCtrl.js b/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/backupMasterListCtrl.js
deleted file mode 100644
index ca6c47e..0000000
--- a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/backupMasterListCtrl.js
+++ /dev/null
@@ -1,35 +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.
- */
-
-(function () {
- /**
- * `register` without params will load the module which using require
- */
- register(function (hadoopMetricApp) {
-
- hadoopMetricApp.controller("backupMasterListCtrl", function ($wrapState, $scope, PageConfig, METRIC) {
-
- // Initialization
- PageConfig.title = "HBASE BackupMasters";
- $scope.tableScope = {};
- $scope.site = $wrapState.param.siteId;
- $scope.searchPathList = [["tags", "hostname"], ["tags", "rack"], ["tags", "site"], ["status"]];
- $scope.backupMasterList = METRIC.hbaseMaster($scope.site, "standby", 1000);
- });
- });
-})();
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/hdfs.js
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/hdfs.js b/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/hdfs.js
deleted file mode 100644
index 74bb7bf..0000000
--- a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/hdfs.js
+++ /dev/null
@@ -1,28 +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.
- */
-
-(function () {
- /**
- * `register` without params will load the module which using require
- */
- register(function (hadoopMetricApp) {
- hadoopMetricApp.controller("hdfsCtrl", function ($scope, PageConfig) {
- PageConfig.title = 'HDFS';
- });
- });
-})();
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/overview.js
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/overview.js b/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/overview.js
deleted file mode 100644
index 6e7df0b..0000000
--- a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/overview.js
+++ /dev/null
@@ -1,298 +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.
- */
-
-(function () {
- /**
- * `register` without params will load the module which using require
- */
- register(function (hadoopMetricApp) {
- hadoopMetricApp.controller("overviewCtrl", function ($q, $wrapState, $scope, PageConfig, METRIC, Time) {
- var cache = {};
- $scope.site = $wrapState.param.siteId;
- var activeMasterInfo = METRIC.hbaseMaster($scope.site, "active", 1);
-
- PageConfig.title = 'HBase';
- var storageOption = {
- animation: false,
- tooltip: {
- formatter: function (points) {
- return points[0].name + "<br/>" +
- $.map(points, function (point) {
- return '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + point.color + '"></span> ' +
- point.seriesName + ": " +
- common.number.abbr(point.value, true, 0);
- }).reverse().join("<br/>");
- }
- },
- yAxis: [{
- axisLabel: {
- formatter: function (value) {
- return common.number.abbr(value, true);
- }
- }
- }]
- };
-
-
- function generateHbaseMetric(name, flag) {
- var startTime = Time.startTime();
- var endTime = Time.endTime();
- var interval = Time.diffInterval(startTime, endTime);
- var intervalMin = interval / 1000 / 60;
- var trendStartTime = Time.align(startTime, interval);
- var trendEndTime = Time.align(endTime, interval);
-
- $scope.site = $wrapState.param.siteId;
- var result = cache[name] || activeMasterInfo._promise.then(function (res) {
- var hostname = cache[hostname] = cache[hostname] || res[0].tags.hostname;
- $scope.defaultHostname = $wrapState.param.hostname || hostname;
-
- var jobCond = {
- site: $scope.site,
- component: "hbasemaster",
- host: $scope.defaultHostname
- };
- return METRIC.aggMetricsToEntities(METRIC.hbaseMetricsAggregation(jobCond, name, ["site"], "avg(value)", intervalMin, trendStartTime, trendEndTime), flag)
- ._promise.then(function (list) {
- var metricFlag = $.map(list, function (metrics) {
- return metrics[0].flag;
- });
- return [metricFlag, list];
- });
- });
- return result;
- }
-
- function mergeMetricToOneSeries(metricTitle, metrics, legendName, dataOption, option) {
- var series = [];
-
- $.each(metrics, function (i, metricMap) {
- if (typeof metricMap !== 'undefined') {
- series.push(METRIC.metricsToSeries(legendName[i], metricMap[0], option));
- }
- });
- return {
- title: metricTitle,
- series: series,
- option: dataOption || {},
- loading: false
- };
- }
-
- function countHBaseRole(site, status, role, groups, filed, limit) {
- var jobCond = {
- site: site,
- status: status,
- role: role
- };
- return METRIC.aggHBaseInstance(jobCond, groups, filed, limit);
- }
-
- function sumAllRegions(site, role, groups, filed, limit) {
- var jobCond = {
- site: site,
- role: role
- };
- return METRIC.aggHBaseInstance(jobCond, groups, filed, limit);
- }
-
- // TODO: Optimize the chart count
- // TODO: ECharts dynamic refresh series bug: https://github.com/ecomfe/echarts/issues/4033
- $scope.chartList = [
- {
- name: "MemoryUsage",
- metrics: ["nonheap", "heap"],
- linename: ["nonheap", "heap"],
- option: storageOption
- },
- {
- name: "Master Averageload",
- metrics: ["averageload"],
- linename: ["averageload"],
- option: {}
- },
- {
- name: "Ritcount",
- metrics: ["ritcount", "ritcountoverthreshold"],
- linename: ["ritcount", "ritcountoverthreshold"],
- option: {}
- },
- {
- name: "AssignOpsNum",
- metrics: ["AssignNumOps"],
- linename: ["numOps"],
- option: {}
- },
- {
- name: "Assign",
- metrics: ["AssignMin", "AssignMax", "AssignPercentile75th", "AssignPercentile95th", "AssignPercentile99th"],
- linename: ["min", "max", "75th", "95th", "99th"],
- option: {}
- },
- {
- name: "BulkAssignOpsNum",
- metrics: ["BulkAssignNum_ops"],
- linename: ["num_ops"],
- option: {}
- },
- {
- name: "BulkAssign",
- metrics: ["BulkAssignMin", "BulkAssignMax", "BulkAssignPercentile75th", "BulkAssignPercentile95th", "BulkAssignPercentile99th"],
- linename: ["min", "max", "75th", "95th", "99th"],
- option: {}
- },
- {
- name: "BalancerClusterOpsNum",
- metrics: ["BalancerClusterNum_ops"],
- linename: ["num_ops"],
- option: {}
- },
- {
- name: "BalancerCluster",
- metrics: ["BalancerClusterMin", "BalancerClusterMax", "BalancerClusterPercentile75th", "BalancerClusterPercentile95th", "BalancerClusterPercentile99th"],
- linename: ["min", "max", "75th", "95th", "99th"],
- option: {}
- },
- {
- name: "HlogSplitTime",
- metrics: ["HlogSplitTimeMin", "HlogSplitTimeMax"],
- linename: ["HlogSplitTime_min", "HlogSplitTime_max"],
- option: {}
- },
- {
- name: "HlogSplitTime Percentile",
- metrics: ["HlogSplitTimePercentile75th", "HlogSplitTimePercentile95th", "HlogSplitTimePercentile99th"],
- linename: ["75th", "95th", "99th"],
- option: {}
- },
- {
- name: "HlogSplitSize",
- metrics: ["HlogSplitSizeMin","HlogSplitSizeMax"],
- linename: ["Min", "Max"],
- option: {}
- },
- {
- name: "MetaHlogSplitTime",
- metrics: ["MetaHlogSplitTimeMin", "MetaHlogSplitTimeMax"],
- linename: ["Min", "Max"],
- option: {}
- },
- {
- name: "MetaHlogSplitTime Percentile",
- metrics: ["MetaHlogSplitTimePercentile75th", "MetaHlogSplitTimePercentile95th", "MetaHlogSplitTimePercentile99th"],
- linename: ["75th", "95th", "99th"],
- option: {}
- },
- {
- name: "MetaHlogSplitSize",
- metrics: ["MetaHlogSplitSizeMin", "MetaHlogSplitSizeMax"],
- linename: ["Min", "Max"],
- option: {}
- }
- ];
- $scope.metricList = [];
- $.each($scope.chartList, function (i) {
- var chart = $scope.chartList[i];
- var chartname = chart.name;
- $scope.metricList[chartname] = {
- title: chartname,
- series: {},
- option: {},
- loading: true,
- promises: []
- };
- });
- $scope.refresh = function () {
-
- METRIC.getMetricObj().then(function (res) {
- var masterMetricList = res.master;
- $.each($scope.chartList, function (i) {
- var chart = $scope.chartList[i];
- var metricList = chart.metrics;
- $.each(metricList, function (j) {
- var metricKey = metricList[j];
- var metricspromies = generateHbaseMetric(masterMetricList[metricKey], metricKey);
- var chartname = chart.name;
- $scope.metricList[chartname].promises.push(metricspromies);
- });
- });
-
- $.each($scope.chartList, function (k) {
- var chart = $scope.chartList[k];
- var chartname = chart.name;
- $q.all($scope.metricList[chartname].promises).then(function (resp) {
- var series = [];
- for (var r = 0; r < resp.length; r += 1) {
- var rs = resp[r][1];
- if (rs.length > 0) {
- series.push(rs);
- }
- }
- $scope.metricList[chartname] = mergeMetricToOneSeries(chartname, series, chart.linename, chart.option);
- });
- });
- });
-
- countHBaseRole($scope.site, "active", "hmaster", ["site"], "count")._promise.then(function (res) {
- $.map(res, function (data) {
- $scope.hmasteractivenum = data.value[0];
- });
- });
- countHBaseRole($scope.site, "standby", "hmaster", ["site"], "count")._promise.then(function (res) {
- $.map(res, function (data) {
- $scope.hmasterstandbynum = data.value[0];
- });
- });
-
- countHBaseRole($scope.site, "live", "regionserver", ["site"], "count")._promise.then(function (res) {
- $.map(res, function (data) {
- $scope.regionserverhealtynum = data.value[0];
- });
- });
- countHBaseRole($scope.site, "dead", "regionserver", ["site"], "count")._promise.then(function (res) {
- $.map(res, function (data) {
- $scope.regionserverunhealtynum = data.value[0];
- });
- });
- sumAllRegions($scope.site, "regionserver", ["site"], "sum(numRegions)")._promise.then(function (res) {
- $.map(res, function (data) {
- $scope.regionsnum = data.value[0];
- });
- });
-
- activeMasterInfo._promise.then(function (res) {
- var hostname = cache[hostname] = cache[hostname] || res[0].tags.hostname;
- $scope.defaultHostname = $wrapState.param.hostname || hostname;
- var jobCond = {
- site: $scope.site,
- component: "hbasemaster",
- host: $scope.defaultHostname
- };
- METRIC.hbaseMomentMetric(jobCond, "hadoop.hbase.master.server.averageload", 1).then(function (res) {
- $scope.hmasteraverageload = (typeof res.data.obj[0] !== 'undefined') ? res.data.obj[0].value[0] : "-1";
- });
- });
- };
- Time.onReload(function () {
- cache = {};
- $scope.refresh();
- }, $scope);
- $scope.refresh();
- });
- });
-})();
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/regionDetailCtrl.js
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/regionDetailCtrl.js b/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/regionDetailCtrl.js
deleted file mode 100644
index 42d5367..0000000
--- a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/regionDetailCtrl.js
+++ /dev/null
@@ -1,286 +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.
- */
-
-(function () {
- /**
- * `register` without params will load the module which using require
- */
- register(function (hadoopMetricApp) {
- hadoopMetricApp.controller("regionDetailCtrl", function ($q, $wrapState, $scope, PageConfig, Time, METRIC) {
- var cache = {};
- $scope.site = $wrapState.param.siteId;
- $scope.hostname = $wrapState.param.hostname;
- PageConfig.title = 'RegionServer ' + "(" + $scope.hostname + ")";
- Time.autoRefresh = false;
-
- var sizeoption = {
- animation: false,
- tooltip: {
- formatter: function (points) {
- return points[0].name + "<br/>" +
- $.map(points, function (point) {
- return '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + point.color + '"></span> ' +
- point.seriesName + ": " +
- common.number.abbr(point.value, true);
- }).reverse().join("<br/>");
- }
- },
- legend: {
- x: 'center', y: 'bottom'
- },
- areaStyle: {normal: {}},
- yAxis: [{
- axisLabel: {
- formatter: function (value) {
- return common.number.abbr(value, true);
- }
- }
- }]
- };
-
- var gctimeoption = {
- legend: {
- x: 'center', y: 'bottom'
- },
- yAxis: [{
- axisLabel: {
- formatter: function (value) {
- return value / 1000 + ' S';
- }
- }
- }]
- };
- $scope.chartList = [
- {
- name: "Memory Usage",
- metrics: ["nonheap", "heap"],
- option: sizeoption
- },
- {
- name: "Direct Memory Usage",
- metrics: ["directmemory"],
- option: sizeoption
- },
- {
- name: "GC count",
- metrics: ["GCCount"],
- option: {}
- },
- {
- name: "GC TimeMillis",
- metrics: ["GCTimeMillis"],
- option: gctimeoption
- },
- {
- name: "QueueSize",
- metrics: ["QueueSize"],
- option: {}
- },
- {
- name: "NumCallsInGeneralQueue",
- metrics: ["NumCallsInGeneralQueue"],
- option: {}
- },
- {
- name: "NumActiveHandler",
- metrics: ["NumActiveHandler"],
- option: {}
- },
- {
- name: "IPC Queue Time (99th)",
- metrics: ["IPCQueueTime99th"],
- option: {}
- },
- {
- name: "IPC Process Time (99th)",
- metrics: ["IPCProcessTime99th"],
- option: {}
- },
- {
- name: "QueueCallTime_num_ops",
- metrics: ["QueueCallTime_num_ops"],
- option: {}
- },
- {
- name: "ProcessCallTime_num_ops",
- metrics: ["ProcessCallTime_num_ops"],
- option: {}
- },
- {
- name: "RegionCount",
- metrics: ["RegionCount"],
- option: {}
- },
- {
- name: "StoreCount",
- metrics: ["StoreCount"],
- option: {}
- },
- {
- name: "MemStoreSize",
- metrics: ["MemStoreSize"],
- option: sizeoption
- },
- {
- name: "StoreFileSize",
- metrics: ["StoreFileSize"],
- option: sizeoption
- },
- {
- name: "TotalRequestCount",
- metrics: ["TotalRequestCount"],
- option: {}
- },
- {
- name: "ReadRequestCount",
- metrics: ["ReadRequestCount"],
- option: {}
- },
- {
- name: "WriteRequestCount",
- metrics: ["WriteRequestCount"],
- option: {}
- },
- {
- name: "SlitQueueLength",
- metrics: ["SlitQueueLength"],
- option: {}
- },
- {
- name: "CompactionQueueLength",
- metrics: ["CompactionQueueLength"],
- option: {}
- },
- {
- name: "FlushQueueLength",
- metrics: ["FlushQueueLength"],
- option: {}
- },
- {
- name: "BlockCacheSize",
- metrics: ["BlockCacheSize"],
- option: sizeoption
- },
- {
- name: "BlockCacheHitCount",
- metrics: ["BlockCacheHitCount"],
- option: {}
- },
- {
- name: "BlockCacheCountHitPercent",
- metrics: ["BlockCacheCountHitPercent"],
- option: {}
- }
- ];
-
- $scope.metricList = [];
- $.each($scope.chartList, function (i) {
- var chart = $scope.chartList[i];
- var chartname = chart.name;
- $scope.metricList[chartname] = {
- title: chartname,
- series: {},
- option: {},
- loading: true,
- promises: []
- };
- });
- $scope.refresh = function () {
- var startTime = Time.startTime();
- var endTime = Time.endTime();
-
- METRIC.getMetricObj().then(function (res) {
- var masterMetricList = res.regionserver;
- $.each($scope.chartList, function (i) {
- var chart = $scope.chartList[i];
- var metricList = chart.metrics;
- $.each(metricList, function (j) {
- var metricKey = metricList[j];
- var metricspromies = generateHbaseMetric(masterMetricList[metricKey], startTime, endTime, metricKey);
- var chartname = chart.name;
- $scope.metricList[chartname].promises.push(metricspromies);
- });
- });
-
- $.each($scope.chartList, function (k) {
- var chart = $scope.chartList[k];
- var chartname = chart.name;
- $q.all($scope.metricList[chartname].promises).then(function (resp) {
- var series = [];
- for (var r = 0; r < resp.length; r += 1) {
- var rs = resp[r][1];
- if (rs.length > 0) {
- series.push(rs);
- }
- }
- $scope.metricList[chartname] = mergeSeries(chartname, series, chart.metrics, chart.option);
- });
- });
- });
-
- METRIC.regionserverStatus($scope.hostname, $scope.site)._promise.then(function (res) {
- $scope.regionstatus = res;
- });
- };
- Time.onReload(function () {
- cache = {};
- $scope.refresh();
- }, $scope);
- $scope.refresh();
-
-
- function generateHbaseMetric(name, startTime, endTime, flag) {
- var interval = Time.diffInterval(startTime, endTime);
- var intervalMin = interval / 1000 / 60;
- var trendStartTime = Time.align(startTime, interval);
- var trendEndTime = Time.align(endTime, interval);
-
- var condition = {
- site: $scope.site,
- component: "regionserver",
- host: $scope.hostname
- };
- return METRIC.aggMetricsToEntities(METRIC.hbaseMetricsAggregation(condition, name, ["site"], "avg(value)", intervalMin, trendStartTime, trendEndTime), flag)
- ._promise.then(function (list) {
- var metricFlag = $.map(list, function (metrics) {
- return metrics[0].flag;
- });
- return [metricFlag, list];
- });
- }
-
- function mergeSeries(title, metrics, linename, option) {
- var series = [];
- $.each(metrics, function (i, metricMap) {
- $.map(metricMap, function (metric) {
- if (typeof metric !== 'undefined') {
- series.push(METRIC.metricsToSeries(linename[i], metric, option));
- }
- });
- });
- return {
- title: title,
- series: series,
- option: option || {},
- loading: false
- };
- }
- });
- });
-})
-();
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/regionListCtrl.js
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/regionListCtrl.js b/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/regionListCtrl.js
deleted file mode 100644
index 1477e32..0000000
--- a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/ctrls/regionListCtrl.js
+++ /dev/null
@@ -1,38 +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.
- */
-
-(function () {
- /**
- * `register` without params will load the module which using require
- */
- register(function (hadoopMetricApp) {
-
- hadoopMetricApp.controller("regionListCtrl", function ($wrapState, $scope, PageConfig, METRIC) {
-
- // Initialization
- PageConfig.title = "HBASE RegionServers";
- $scope.tableScope = {};
- $scope.live = METRIC.STATUS_LIVE;
- $scope.dead = METRIC.STATUS_DEAD;
- $scope.site = $wrapState.param.siteId;
- $scope.searchPathList = [["tags", "hostname"], ["tags", "rack"], ["tags", "site"], ["status"]];
- $scope.regionserverList = METRIC.regionserverList($scope.site);
-
- });
- });
-})();
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/index.js
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/index.js b/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/index.js
deleted file mode 100644
index d4789b2..0000000
--- a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/index.js
+++ /dev/null
@@ -1,337 +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.
- */
-
-(function () {
- /**
- * `register` is global function that for application to set up 'controller', 'service', 'directive', 'route' in Eagle
- */
- var hadoopMetricApp = register(['ngRoute', 'ngAnimate', 'ui.router', 'eagle.service']);
-
- hadoopMetricApp.route("HadoopMetric", {
- url: "/hadoopService/HBase/overview?startTime&endTime",
- site: true,
- templateUrl: "partials/overview.html",
- controller: "overviewCtrl",
- resolve: {time: true}
- }).route("HadoopMetric_HDFS", {
- url: "/hadoopService/hdfs",
- site: true,
- templateUrl: "partials/hdfs/index.html",
- controller: "hdfsCtrl",
- resolve: {time: true}
- }).route("regionDetail", {
- url: "/hadoopService/HBase/regionDetail/:hostname",
- site: true,
- templateUrl: "partials/region/regionDetail.html",
- controller: "regionDetailCtrl",
- resolve: {time: true}
- }).route("regionList", {
- url: "/hadoopService/HBase/regionList",
- site: true,
- templateUrl: "partials/region/regionList.html",
- controller: "regionListCtrl"
- }).route("backupMasterList", {
- url: "/hadoopService/HBase/backupMasterList",
- site: true,
- templateUrl: "partials/backupMasterList.html",
- controller: "backupMasterListCtrl"
- }).route("masterDetail", {
- url: "/hadoopService/HBase/:hostname?startTime&endTime",
- site: true,
- reloadOnSearch: false,
- templateUrl: "partials/overview.html",
- controller: "overviewCtrl",
- resolve: {time: true}
- });
-
- hadoopMetricApp.portal({
- name: "Services", icon: "heartbeat", list: [
- {name: "HBase", path: "hadoopService/HBase/overview"},
- {name: "HDFS", path: "hadoopService/hdfs"}
- ]
- }, true);
-
- hadoopMetricApp.service("METRIC", function ($q, $http, Time, Site, Application) {
- var METRIC = window._METRIC = {};
- METRIC.STATUS_LIVE = "live";
- METRIC.STATUS_DEAD = "dead";
- METRIC.QUERY_HBASE_METRICS = '${baseURL}/rest/entities?query=GenericMetricService[${condition}]{*}&metricName=${metric}&pageSize=${limit}';
- METRIC.QUERY_HBASE_METRICS_WITHTIME = '${baseURL}/rest/entities?query=GenericMetricService[${condition}]{*}&metricName=${metric}&pageSize=${limit}&startTime=${startTime}&endTime=${endTime}';
- METRIC.QUERY_HBASE_INSTANCE = '${baseURL}/rest/entities?query=HbaseServiceInstance[${condition}]{*}&pageSize=${limit}';
- METRIC.QUERY_HBASE_INSTANCE_AGG = "${baseURL}/rest/entities?query=HbaseServiceInstance[${condition}]<${groups}>{${field}}&pageSize=${limit}";
- METRIC.QUERY_HBASE_METRICS_INTERVAL = '${baseURL}/rest/entities?query=GenericMetricService[${condition}]<${groups}>{${field}}${order}${top}&metricName=${metric}&pageSize=${limit}&startTime=${startTime}&endTime=${endTime}&intervalmin=${intervalMin}&timeSeries=true';
- /**
- * Fetch query content with current site application configuration
- * @param {string} queryName
- */
- var getQuery = METRIC.getQuery = function (queryName, siteId) {
- var baseURL;
- siteId = siteId || Site.current().siteId;
- var app = Application.find("HADOOP_METRIC_MONITOR", siteId)[0];
- var host = app.configuration["service.host"];
- var port = app.configuration["service.port"];
-
- if (!host && !port) {
- baseURL = "";
- } else {
- if (host === "localhost" || !host) {
- host = location.hostname;
- }
- if (!port) {
- port = location.port;
- }
- baseURL = "http://" + host + ":" + port;
- }
-
- return common.template(METRIC["QUERY_" + queryName], {baseURL: baseURL});
- };
-
- function wrapList(promise) {
- var _list = [];
- _list._done = false;
-
- _list._promise = promise.then(
- /**
- * @param {{}} res
- * @param {{}} res.data
- * @param {{}} res.data.obj
- */
- function (res) {
- _list.splice(0);
- Array.prototype.push.apply(_list, res.data.obj);
- _list._done = true;
- return _list;
- });
- return _list;
- }
-
- function toFields(fields) {
- return (fields || []).length > 0 ? $.map(fields, function (field) {
- return "@" + field;
- }).join(",") : "*";
- }
-
- METRIC.metricsToSeries = function (name, metrics, option, rawData) {
- if (arguments.length === 4 && typeof rawData === "object") {
- option = rawData;
- rawData = false;
- }
-
- var data = $.map(metrics, function (metric) {
- return rawData ? metric.value[0] : {
- x: metric.timestamp,
- y: metric.value[0]
- };
- });
- return $.extend({
- name: name,
- showSymbol: false,
- type: "line",
- data: data
- }, option || {});
- };
-
- METRIC.get = function (url, params) {
- return $http({
- url: url,
- method: "GET",
- params: params
- });
- };
-
- METRIC.condition = function (condition) {
- return $.map(condition, function (value, key) {
- return "@" + key + '="' + value + '"';
- }).join(" AND ");
- };
-
-
- METRIC.hbaseMetrics = function (condition, metric, startTime, endTime, limit) {
- var config = {
- condition: METRIC.condition(condition),
- startTime: Time.format(startTime),
- endTime: Time.format(endTime),
- metric: metric,
- limit: limit || 10000
- };
-
- var metrics_url = common.template(getQuery("HBASE_METRICS_WITHTIME"), config);
- return wrapList(METRIC.get(metrics_url));
- };
-
- METRIC.hbaseMomentMetric = function (condition, metric, limit) {
- var config = {
- condition: METRIC.condition(condition),
- metric: metric,
- limit: limit || 10000
- };
-
- var metrics_url = common.template(getQuery("HBASE_METRICS"), config);
- return METRIC.get(metrics_url);
- };
-
- METRIC.aggHBaseInstance = function (condition, groups, field, limit) {
- var fields = field.split(/\s*,\s*/);
- var fieldStr = $.map(fields, function (field, index) {
- var matches = field.match(/^([^\s]*)(\s+.*)?$/);
- if (matches[2]) {
- orderId = index;
- }
- return matches[1];
- }).join(", ");
- var config = {
- condition: METRIC.condition(condition),
- groups: toFields(groups),
- field: fieldStr,
- limit: limit || 10000
- };
- var metrics_url = common.template(getQuery("HBASE_INSTANCE_AGG"), config);
- return wrapList(METRIC.get(metrics_url));
- };
-
- METRIC.hbaseMetricsAggregation = function (condition, metric, groups, field, intervalMin, startTime, endTime, top, limit) {
- var fields = field.split(/\s*,\s*/);
- var orderId = -1;
- var fieldStr = $.map(fields, function (field, index) {
- var matches = field.match(/^([^\s]*)(\s+.*)?$/);
- if (matches[2]) {
- orderId = index;
- }
- return matches[1];
- }).join(", ");
-
-
- var config = {
- condition: METRIC.condition(condition),
- startTime: Time.format(startTime),
- endTime: Time.format(endTime),
- metric: metric,
- groups: toFields(groups),
- field: fieldStr,
- order: orderId === -1 ? "" : ".{" + fields[orderId] + "}",
- top: top ? "&top=" + top : "",
- intervalMin: intervalMin,
- limit: limit || 10000
- };
-
- var metrics_url = common.template(getQuery("HBASE_METRICS_INTERVAL"), config);
- var _list = wrapList(METRIC.get(metrics_url));
- _list._aggInfo = {
- groups: groups,
- startTime: Time(startTime).valueOf(),
- interval: intervalMin * 60 * 1000
- };
- _list._promise.then(function () {
- _list.reverse();
- });
- return _list;
- };
-
- METRIC.aggMetricsToEntities = function (list, param, flatten) {
- var _list = [];
- _list.done = false;
- _list._promise = list._promise.then(function () {
- var _startTime = list._aggInfo.startTime;
- var _interval = list._aggInfo.interval;
-
- $.each(list, function (i, obj) {
- var tags = {};
- $.each(list._aggInfo.groups, function (j, group) {
- tags[group] = obj.key[j];
- });
-
- var _subList = $.map(obj.value[0], function (value, index) {
- return {
- timestamp: _startTime + index * _interval,
- value: [value],
- tags: tags,
- flag: param
- };
- });
-
- if (flatten) {
- _list.push.apply(_list, _subList);
- } else {
- _list.push(_subList);
- }
- });
- _list.done = true;
- return _list;
- });
- return _list;
- };
-
-
- METRIC.hbasehostStatus = function (condition, limit) {
- var config = {
- condition: METRIC.condition(condition),
- limit: limit || 10000
- };
-
- var metrics_url = common.template(getQuery("HBASE_INSTANCE"), config);
- return wrapList(METRIC.get(metrics_url));
- };
-
- METRIC.hbaseMaster = function (siteId, status, limit) {
- var condition = {
- site: siteId,
- role: "hmaster",
- status: status
- };
- return METRIC.hbasehostStatus(condition, limit);
- };
-
- METRIC.regionserverStatus = function (hostname, siteid) {
- var hoststateinfo;
- var condition = {
- site: siteid,
- role: "regionserver",
- hostname: hostname
- };
- hoststateinfo = METRIC.hbasehostStatus(condition, 1);
- return hoststateinfo;
- };
-
- METRIC.regionserverList = function (siteid) {
- var hoststateinfos;
- var condition = {
- site: siteid,
- role: "regionserver"
- };
- hoststateinfos = METRIC.hbasehostStatus(condition);
- return hoststateinfos;
- };
-
- METRIC.getMetricObj = function () {
- var deferred = $q.defer();
- $http.get("apps/hadoop_metric/config.json").success(function (resp) {
- deferred.resolve(resp);
- });
- return deferred.promise;
- };
- return METRIC;
- });
-
- hadoopMetricApp.requireCSS("style/index.css");
- hadoopMetricApp.require("widgets/availabilityChart.js");
- hadoopMetricApp.require("ctrls/overview.js");
- hadoopMetricApp.require("ctrls/hdfs.js");
- hadoopMetricApp.require("ctrls/regionDetailCtrl.js");
- hadoopMetricApp.require("ctrls/regionListCtrl.js");
- hadoopMetricApp.require("ctrls/backupMasterListCtrl.js");
-})();
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/backupMasterList.html
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/backupMasterList.html b/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/backupMasterList.html
deleted file mode 100644
index 13e20c9..0000000
--- a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/backupMasterList.html
+++ /dev/null
@@ -1,52 +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.
- -->
-<div class="box box-primary">
- <div class="box-header with-border">
- <h3 class="box-title">
- <span ng-show="!backupMasterList._done || isSorting" class="fa fa-refresh fa-spin no-animate"></span>
- </h3>
- </div>
- <div class="box-body">
- <div id="backupMasterList" sort-table="backupMasterList" is-sorting="isSorting"
- search-path-list="searchPathList"
- scope="tableScope">
- <table class="table table-bordered">
- <thead>
- <tr>
- <th sortpath="tags.hostname">Master</th>
- <th sortpath="tags.rack">Rack</th>
- <th sortpath="tags.site">SiteId</th>
- <th sortpath="status">Status</th>
- </tr>
- </thead>
- <tbody>
- <tr ng-repeat="item in backupMasterList">
- <td>
- <a ui-sref="masterDetail({siteId: site, hostname: item.tags.hostname})">{{item.tags.hostname}}</a>
- </td>
- <td>{{item.tags.rack}}</td>
- <td>{{item.tags.site}}</td>
- <td>
- <span>{{item.status}}</span>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
-</div>
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/hdfs/index.html
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/hdfs/index.html b/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/hdfs/index.html
deleted file mode 100644
index 33acb15..0000000
--- a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/hdfs/index.html
+++ /dev/null
@@ -1,19 +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.
- -->
-
-HDFS Page
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/overview.html
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/overview.html b/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/overview.html
deleted file mode 100644
index 86a1591..0000000
--- a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/overview.html
+++ /dev/null
@@ -1,111 +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.
- -->
-
-<div class="box box-primary">
- <div class="box-header with-border">
- <span class="fa fa-television"></span>
- <h3 class="box-title">
- HBase Service Summary Information
- </h3>
- </div>
- <div class="box-body">
- <table class="table table-striped hadoopMetric-table">
- <tr>
- <td width="5%">
- <span ng-show="hmasteractivenum">{{hmasteractivenum}}</span>
- <span ng-show="!hmasteractivenum" class="fa fa fa-refresh fa-spin no-animate"></span>
- </td>
- <th width="45%">Active HBase Master</th>
- <td width="5%">
- <span ng-show="regionsnum">{{regionsnum}}</span>
- <span ng-show="!regionsnum" class="fa fa fa-refresh fa-spin no-animate"></span>
- </td>
- <th width="45%">Regions
- </th>
- </tr>
- <tr>
- <td>
- <a ui-sref="backupMasterList({siteId: site})">
- <span ng-show="hmasterstandbynum">{{hmasterstandbynum}}</span></a>
- <span ng-show="!hmasterstandbynum">0</span>
- </td>
- <th>Backup HBase Master</th>
- <td>
- <span ng-show="hmasteraverageload !== '-1'">{{common.number.format(hmasteraverageload, 0)}}</span>
- <span ng-show="hmasteraverageload === '-1'" class="fa fa-refresh fa-spin no-animate"></span>
- </td>
- <th>Average Load</th>
- </tr>
- <tr>
- <td>
- <a ui-sref="regionList({siteId: site})">
- <span ng-show="regionserverhealtynum || regionserverunhealtynum">{{regionserverhealtynum+regionserverunhealtynum}}</span></a>
- <span ng-show="!regionserverhealtynum && !regionserverunhealtynum">0</span>
- </td>
- <th>RegionServers:
- <a ui-sref="regionList({siteId: site})">
- <span ng-show="regionserverhealtynum">{{regionserverhealtynum}}</span></a>
- <span ng-show="!regionserverhealtynum">0</span>
- <span
- class="label label-success">Good Health</span> /
- <a ui-sref="regionList({siteId: site})">
- <span ng-show="regionserverunhealtynum">{{regionserverunhealtynum}}</span></a>
- <span ng-show="!regionserverunhealtynum">0</span>
- <span class="label label-danger">Bad Health</span>
- </th>
- <td></td>
- <th></th>
- </tr>
- </table>
- </div>
-</div>
-
-<div class="box box-primary">
- <div class="box-header with-border">
- <span class="fa fa-line-chart"></span>
- <h3 class="box-title">
- Metrics
- <span>({{defaultHostname}})</span>
- </h3>
- </div>
- <div class="box-body no-padding">
- <div class="row border-split">
- <div class="col-sm-6 col-md-4 col-lg-6" ng-repeat="chart in chartList track by $index">
- <div class="hadoopMetric-chart">
- <h3>{{metricList[chart.name].title}}</h3>
- <div ng-show="metricList[chart.name].loading" chart class="hadoopMetric-chart-container"></div>
- <div ng-show="metricList[chart.name].loading" class="overlay-wrapper">
- <div class="overlay">
- <i class="fa fa-refresh fa-spin"></i>
- </div>
- </div>
- <div ng-show="metricList[chart.name].series.length" chart class="hadoopMetric-chart-container"
- series="metricList[chart.name].series"
- option="metricList[chart.name].option"></div>
- <div ng-show="!metricList[chart.name].series.length && !metricList[chart.name].loading" class="hadoopMetric-chart-container">
- <div class="hadoopMetric-chart-container-withborder">
- <div class="hadoopMetric-no-chart-data">
- <span class="fa fa-question-circle"></span><span> NO DATA</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
-</div>
http://git-wip-us.apache.org/repos/asf/eagle/blob/c32b7152/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/region/regionDetail.html
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/region/regionDetail.html b/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/region/regionDetail.html
deleted file mode 100644
index 63a895f..0000000
--- a/eagle-hadoop-metric/src/main/webapp/app/apps/hadoop_metric/partials/region/regionDetail.html
+++ /dev/null
@@ -1,117 +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.
- -->
-
-<div class="box box-primary">
- <div class="box-header with-border">
- <span class="fa fa-television"></span>
- <h3 class="box-title">
- Summary
- </h3>
- </div>
- <div class="box-body">
- <table class="table table-striped">
- <tbody ng-if="(regionstatus || []).length !== 0">
- <tr>
- <th>Status</th>
- <td class="text-break">
- <span ng-if="regionstatus[0].status==='live'" class="label label-success">Healthy</span>
- <span ng-if="regionstatus[0].status!=='live'" class="label label-danger">UnHealthy</span>
- </td>
- </tr>
- <tr>
- <th>Rack</th>
- <td class="text-break">{{regionstatus[0].tags.rack}}</td>
- </tr>
- <tr>
- <th>MaxHeap</th>
- <td class="text-break">{{regionstatus[0].maxHeapMB}} MB</td>
- </tr>
- <tr>
- <th>UsedHeap</th>
- <td class="text-break">{{regionstatus[0].usedHeapMB}} MB</td>
- </tr>
- <tr>
- <th>NumRegions</th>
- <td class="text-break">{{regionstatus[0].numRegions}}</td>
- </tr>
- <tr>
- <th>NumRequests</th>
- <td class="text-break">{{regionstatus[0].numRequests}}</td>
- </tr>
- </tbody>
- <tbody ng-if="regionstatus.length === 0">
- <tr>
- <th>Status</th>
- <td class="text-break"><span class="label label-danger">Unknow</span></td>
- </tr>
- <tr>
- <th>Rack</th>
- <td class="text-break"><span class="label label-danger">Unknow</span></td>
- </tr>
- <tr>
- <th>MaxHeap</th>
- <td class="text-break"><span class="label label-danger">Unknow</span></td>
- </tr>
- <tr>
- <th>UsedHeap</th>
- <td class="text-break"><span class="label label-danger">Unknow</span></td>
- </tr>
- <tr>
- <th>NumRegions</th>
- <td class="text-break"><span class="label label-danger">Unknow</span></td>
- </tr>
- <tr>
- <th>NumRequests</th>
- <td class="text-break"><span class="label label-danger">Unknow</span></td>
- </tr>
- </tbody>
- </table>
- </div>
-</div>
-
-<div class="box box-primary">
- <div class="box-header with-border">
- <span class="fa fa-line-chart"></span>
- <h3 class="box-title">
- Metrics
- </h3>
- </div>
- <div class="box-body no-padding">
- <div class="row border-split">
- <div class="col-sm-6 hadoopMetric-col-md-6 col-lg-6" ng-repeat="chart in chartList track by $index">
- <div class="hadoopMetric-chart">
- <h3>{{metricList[chart.name].title}}</h3>
- <div ng-show="metricList[chart.name].loading" class="hadoopMetric-chart-container"></div>
- <div ng-show="metricList[chart.name].loading" class="overlay-wrapper">
- <div class="overlay">
- <i class="fa fa-refresh fa-spin"></i>
- </div>
- </div>
- <div ng-show="metricList[chart.name].series.length" chart class="hadoopMetric-chart-container"
- series="metricList[chart.name].series"
- option="metricList[chart.name].option"></div>
- <div ng-show="!metricList[chart.name].series.length && !metricList[chart.name].loading" class="hadoopMetric-chart-container">
- <div class="hadoopMetric-no-chart-data">
- <span class="fa fa-question-circle"></span><span> NO DATA</span>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
-</div>