eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinh...@apache.org
Subject incubator-eagle git commit: [MINOR] change delay strategy of topology check app
Date Thu, 24 Nov 2016 14:20:06 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/master de061d599 -> 52dc7a5d9


[MINOR] change delay strategy of topology check app

Author: wujinhu <wujinhu920@126.com>

Closes #682 from wujinhu/EAGLE-789.


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

Branch: refs/heads/master
Commit: 52dc7a5d99ed37b7778813c8b6483a4227e7c0ee
Parents: de061d5
Author: wujinhu <wujinhu920@126.com>
Authored: Thu Nov 24 22:19:56 2016 +0800
Committer: wujinhu <wujinhu920@126.com>
Committed: Thu Nov 24 22:19:56 2016 +0800

----------------------------------------------------------------------
 ...adoopQueueRunningApplicationHealthCheck.java |  2 +-
 .../SparkHistoryJobApplicationHealthCheck.java  |  2 +-
 .../TopologyCheckApplicationHealthCheck.java    | 36 +++++++++++++-------
 3 files changed, 25 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/52dc7a5d/eagle-jpm/eagle-hadoop-queue/src/main/java/org/apache/eagle/hadoop/queue/HadoopQueueRunningApplicationHealthCheck.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-hadoop-queue/src/main/java/org/apache/eagle/hadoop/queue/HadoopQueueRunningApplicationHealthCheck.java
b/eagle-jpm/eagle-hadoop-queue/src/main/java/org/apache/eagle/hadoop/queue/HadoopQueueRunningApplicationHealthCheck.java
index 61c7687..6a7535c 100644
--- a/eagle-jpm/eagle-hadoop-queue/src/main/java/org/apache/eagle/hadoop/queue/HadoopQueueRunningApplicationHealthCheck.java
+++ b/eagle-jpm/eagle-hadoop-queue/src/main/java/org/apache/eagle/hadoop/queue/HadoopQueueRunningApplicationHealthCheck.java
@@ -71,7 +71,7 @@ public class HadoopQueueRunningApplicationHealthCheck extends ApplicationHealthC
                     .metricName(HadoopClusterConstants.MetricName.HADOOP_CLUSTER_ALLOCATED_MEMORY)
                     .startTime(System.currentTimeMillis() - 24 * 60 * 60000L)
                     .endTime(System.currentTimeMillis())
-                    .pageSize(Integer.MAX_VALUE)
+                    .pageSize(10)
                     .send();
             List<Map<List<String>, List<Double>>> results = response.getObj();
             long currentProcessTimeStamp = results.get(0).get("value").get(0).longValue();

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/52dc7a5d/eagle-jpm/eagle-jpm-spark-history/src/main/java/org/apache/eagle/jpm/spark/history/SparkHistoryJobApplicationHealthCheck.java
----------------------------------------------------------------------
diff --git a/eagle-jpm/eagle-jpm-spark-history/src/main/java/org/apache/eagle/jpm/spark/history/SparkHistoryJobApplicationHealthCheck.java
b/eagle-jpm/eagle-jpm-spark-history/src/main/java/org/apache/eagle/jpm/spark/history/SparkHistoryJobApplicationHealthCheck.java
index fe6bd5a..d6f5031 100644
--- a/eagle-jpm/eagle-jpm-spark-history/src/main/java/org/apache/eagle/jpm/spark/history/SparkHistoryJobApplicationHealthCheck.java
+++ b/eagle-jpm/eagle-jpm-spark-history/src/main/java/org/apache/eagle/jpm/spark/history/SparkHistoryJobApplicationHealthCheck.java
@@ -65,7 +65,7 @@ public class SparkHistoryJobApplicationHealthCheck extends ApplicationHealthChec
 
             GenericServiceAPIResponseEntity response = client
                     .search(query)
-                    .startTime(System.currentTimeMillis() - 24 * 60 * 60000L)
+                    .startTime(System.currentTimeMillis() - 12 * 60 * 60000L)
                     .endTime(System.currentTimeMillis())
                     .pageSize(10)
                     .send();

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/52dc7a5d/eagle-topology-check/eagle-topology-app/src/main/java/org/apache/eagle/topology/TopologyCheckApplicationHealthCheck.java
----------------------------------------------------------------------
diff --git a/eagle-topology-check/eagle-topology-app/src/main/java/org/apache/eagle/topology/TopologyCheckApplicationHealthCheck.java
b/eagle-topology-check/eagle-topology-app/src/main/java/org/apache/eagle/topology/TopologyCheckApplicationHealthCheck.java
index 5115af6..7860cb5 100644
--- a/eagle-topology-check/eagle-topology-app/src/main/java/org/apache/eagle/topology/TopologyCheckApplicationHealthCheck.java
+++ b/eagle-topology-check/eagle-topology-app/src/main/java/org/apache/eagle/topology/TopologyCheckApplicationHealthCheck.java
@@ -59,19 +59,11 @@ public class TopologyCheckApplicationHealthCheck extends ApplicationHealthCheckB
                 message += String.format("Application is not RUNNING, status is %s. ", status.toString());
             }
 
-            String query = String.format("%s[@site=\"%s\"]<@site>{max(timestamp)}",
-                    TopologyConstants.GENERIC_METRIC_SERVICE,
-                    topologyCheckAppConfig.dataExtractorConfig.site);
-
-            GenericServiceAPIResponseEntity response = client
-                    .search(query)
-                    .metricName(String.format(TopologyConstants.METRIC_LIVE_RATIO_NAME_FORMAT,
TopologyConstants.DATA_NODE_ROLE))
-                    .startTime(System.currentTimeMillis() - 2 * 60 * 60000L)
-                    .endTime(System.currentTimeMillis())
-                    .pageSize(Integer.MAX_VALUE)
-                    .send();
-            List<Map<List<String>, List<Double>>> results = response.getObj();
-            long currentProcessTimeStamp = results.get(0).get("value").get(0).longValue();
+            long currentProcessTimeStamp = Math.min(
+                    Math.min(
+                        getServiceLatestUpdateTime(TopologyConstants.HBASE_INSTANCE_SERVICE_NAME,
client),
+                        getServiceLatestUpdateTime(TopologyConstants.HDFS_INSTANCE_SERVICE_NAME,
client)
+                    ), getServiceLatestUpdateTime(TopologyConstants.MR_INSTANCE_SERVICE_NAME,
client));
             long currentTimeStamp = System.currentTimeMillis();
             long maxDelayTime = DEFAULT_MAX_DELAY_TIME;
             if (topologyCheckAppConfig.getConfig().hasPath(MAX_DELAY_TIME_KEY)) {
@@ -96,4 +88,22 @@ public class TopologyCheckApplicationHealthCheck extends ApplicationHealthCheckB
             }
         }
     }
+
+    private long getServiceLatestUpdateTime(String serviceName, IEagleServiceClient client)
throws Exception {
+        String query = String.format("%s[@site=\"%s\"]<@site>{max(lastUpdateTime)}",
+                serviceName,
+                topologyCheckAppConfig.dataExtractorConfig.site);
+
+        GenericServiceAPIResponseEntity response = client
+                .search(query)
+                .pageSize(10)
+                .send();
+
+        List<Map<List<String>, List<Double>>> results = response.getObj();
+        if (results.size() == 0) {
+            return Long.MAX_VALUE;
+        }
+        long currentProcessTimeStamp = results.get(0).get("value").get(0).longValue();
+        return currentProcessTimeStamp;
+    }
 }


Mime
View raw message