eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ralp...@apache.org
Subject incubator-eagle git commit: EAGLE-165: Add more jmx metric cases
Date Mon, 22 Feb 2016 06:11:27 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/master 62db846d6 -> 46155d97c


EAGLE-165: Add more jmx metric cases

https://issues.apache.org/jira/browse/EAGLE-165

    Add capacity use policy
    Fix to package hadoop metric project into independent jar.
    Add missing license header to read me file

Author: @ralphsu<ralphsu@apache.org>
Committer: @ralphsu<ralphsu@apache.org>

Closes #95


Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/46155d97
Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/46155d97
Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/46155d97

Branch: refs/heads/master
Commit: 46155d97c9316b5d91a1e992dae23abdad5ec644
Parents: 62db846
Author: Ralph, Su <suliangfei@gmail.com>
Authored: Mon Feb 22 14:08:39 2016 +0800
Committer: Ralph, Su <suliangfei@gmail.com>
Committed: Mon Feb 22 14:08:39 2016 +0800

----------------------------------------------------------------------
 eagle-hadoop-metric/pom.xml                     | 22 +++++++
 .../assembly/eagle-hadoop-metric-assembly.xml   | 64 ++++++++++++++++++++
 .../resources/capacityused-policy-import.sh     | 51 ++++++++++++++++
 .../main/resources/nodecount-policy-import.sh   |  2 +-
 .../src/test/resources/cassandra.json           | 13 ++++
 eagle-tutorial/SetupDevelopmentEnvOnMac.md      | 19 ++++++
 6 files changed, 170 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/46155d97/eagle-hadoop-metric/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/pom.xml b/eagle-hadoop-metric/pom.xml
index 63eb88b..9ba0f44 100644
--- a/eagle-hadoop-metric/pom.xml
+++ b/eagle-hadoop-metric/pom.xml
@@ -34,5 +34,27 @@
         </dependency>
     </dependencies>
 
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <configuration>
+                    <descriptor>src/assembly/eagle-hadoop-metric-assembly.xml</descriptor>
+                    <finalName>eagle-hadoop-metric-${project.version}</finalName>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                        <configuration>
+                            <tarLongFileMode>posix</tarLongFileMode>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/46155d97/eagle-hadoop-metric/src/assembly/eagle-hadoop-metric-assembly.xml
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/assembly/eagle-hadoop-metric-assembly.xml b/eagle-hadoop-metric/src/assembly/eagle-hadoop-metric-assembly.xml
new file mode 100644
index 0000000..b581fbc
--- /dev/null
+++ b/eagle-hadoop-metric/src/assembly/eagle-hadoop-metric-assembly.xml
@@ -0,0 +1,64 @@
+<!--
+   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.
+-->
+
+<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+    <id>assembly</id>
+    <formats>
+        <format>jar</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+    <dependencySets>
+        <dependencySet>
+            <outputDirectory>/</outputDirectory>
+            <useProjectArtifact>false</useProjectArtifact>
+            <unpack>true</unpack>
+            <scope>runtime</scope>
+            <unpackOptions>
+                <excludes>
+                    <exclude>**/application.conf</exclude>
+                    <exclude>**/defaults.yaml</exclude>
+                    <exclude>**/*storm.yaml</exclude>
+                    <exclude>**/*storm.yaml.1</exclude>
+                    <exclude>**/log4j.properties</exclude>
+                </excludes>
+            </unpackOptions>
+            <excludes>
+                <exclude>org.apache.storm:storm-core</exclude>
+                <exclude>org.slf4j:slf4j-api</exclude>
+                <exclude>org.slf4j:log4j-over-slf4j</exclude>
+                <exclude>org.slf4j:slf4j-log4j12</exclude>
+                <exclude>log4j:log4j</exclude>
+                <exclude>asm:asm</exclude>
+                <exclude>org.apache.log4j.wso2:log4j</exclude>
+            </excludes>
+        </dependencySet>
+    </dependencySets>
+
+    <fileSets>
+        <fileSet>
+            <directory>${project.build.outputDirectory}</directory>
+            <outputDirectory>/</outputDirectory>
+            <excludes>
+                <exclude>application.conf</exclude>
+                <exclude>log4j.properties</exclude>
+                <exclude>**/storm.yaml.1</exclude>
+            </excludes>
+        </fileSet>
+    </fileSets>
+</assembly>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/46155d97/eagle-hadoop-metric/src/main/resources/capacityused-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/capacityused-policy-import.sh b/eagle-hadoop-metric/src/main/resources/capacityused-policy-import.sh
new file mode 100644
index 0000000..a09199a
--- /dev/null
+++ b/eagle-hadoop-metric/src/main/resources/capacityused-policy-import.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# 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.
+
+source $(dirname $0)/eagle-env.sh
+source $(dirname $0)/hadoop-metric-init.sh
+
+
+##### add policies ##########
+echo ""
+echo "Importing policy: capacityUsedPolicy "
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json'
\
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDefinitionService"
\
+ -d '
+ [
+     {
+       "prefix": "alertdef",
+       "tags": {
+         "site": "sandbox",
+         "dataSource": "hadoopJmxMetricDataSource",
+         "policyId": "capacityUsedPolicy",
+         "alertExecutorId": "hadoopJmxMetricAlertExecutor",
+         "policyType": "siddhiCEPEngine"
+       },
+       "description": "jmx metric ",
+       "policyDef": "{\"expression\":\"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; \",\"type\":\"siddhiCEPEngine\"}",
+       "enabled": true,
+       "dedupeDef": "{\"alertDedupIntervalMin\":10,\"emailDedupIntervalMin\":10}",
+       "notificationDef": "[{\"sender\":\"eagle@apache.org\",\"recipients\":\"eagle@apache.org\",\"subject\":\"missing
block found.\",\"flavor\":\"email\",\"id\":\"email_1\",\"tplFileName\":\"\"}]"
+     }
+ ]
+ '
+
+ ## Finished
+echo ""
+echo "Finished initialization for eagle topology"
+
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/46155d97/eagle-hadoop-metric/src/main/resources/nodecount-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/nodecount-policy-import.sh b/eagle-hadoop-metric/src/main/resources/nodecount-policy-import.sh
index 2d5b152..e77e10e 100644
--- a/eagle-hadoop-metric/src/main/resources/nodecount-policy-import.sh
+++ b/eagle-hadoop-metric/src/main/resources/nodecount-policy-import.sh
@@ -36,7 +36,7 @@ curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:a
          "policyType": "siddhiCEPEngine"
        },
        "description": "jmx metric ",
-       "policyDef": "{\"expression\":\"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 lowNum, e1.timestamp as
start, e2.value as highNum, e2.timestamp as end insert into tmp; \",\"type\":\"siddhiCEPEngine\"}",
+       "policyDef": "{\"expression\":\"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; \",\"type\":\"siddhiCEPEngine\"}",
        "enabled": true,
        "dedupeDef": "{\"alertDedupIntervalMin\":10,\"emailDedupIntervalMin\":10}",
        "notificationDef": "[{\"sender\":\"eagle@apache.org\",\"recipients\":\"eagle@apache.org\",\"subject\":\"node
count joggling found.\",\"flavor\":\"email\",\"id\":\"email_1\",\"tplFileName\":\"\"}]"

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/46155d97/eagle-hadoop-metric/src/test/resources/cassandra.json
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/test/resources/cassandra.json b/eagle-hadoop-metric/src/test/resources/cassandra.json
new file mode 100644
index 0000000..645e314
--- /dev/null
+++ b/eagle-hadoop-metric/src/test/resources/cassandra.json
@@ -0,0 +1,13 @@
+{
+  "host": "/192.168.6.227",
+  "source": "/192.168.6.227",
+  "user": "jaspa",
+  "timestamp": 1455574202864,
+  "category": "QUERY",
+  "type": "CQL_SELECT",
+  "ks": "dg_keyspace",
+  "cf": "customer_details",
+  "operation": "CQL_SELECT",
+  "masked_columns": ["bank", "ccno", "email", "ip", "name", "sal", "ssn ", "tel", "url"],
+  "other_columns": ["id", "npi"]
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/46155d97/eagle-tutorial/SetupDevelopmentEnvOnMac.md
----------------------------------------------------------------------
diff --git a/eagle-tutorial/SetupDevelopmentEnvOnMac.md b/eagle-tutorial/SetupDevelopmentEnvOnMac.md
index 68adfe7..b169ffe 100644
--- a/eagle-tutorial/SetupDevelopmentEnvOnMac.md
+++ b/eagle-tutorial/SetupDevelopmentEnvOnMac.md
@@ -1,3 +1,22 @@
+<!--
+{% comment %}
+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.
+{% endcomment %}
+-->
+
 How to setup the Eagle development environment on Mac
 ===============================================
 


Mime
View raw message