{"action":"created","comment":{"url":"https://api.github.com/repos/InMobi/oozie/pulls/comments/30967936","id":30967936,"diff_hunk":"@@ -0,0 +1,105 @@\n+/**\n+ * Licensed to the Apache Software Foundation (ASF) under one\n+ * or more contributor license agreements.  See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership.  The ASF licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License.  You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package org.apache.oozie.service;\n+\n+import java.io.IOException;\n+import java.net.InetSocketAddress;\n+import java.util.concurrent.TimeUnit;\n+import com.codahale.metrics.MetricFilter;\n+import com.codahale.metrics.MetricRegistry;\n+import com.codahale.metrics.ganglia.GangliaReporter;\n+import com.codahale.metrics.graphite.Graphite;\n+import com.codahale.metrics.graphite.GraphiteReporter;\n+import info.ganglia.gmetric4j.gmetric.GMetric;\n+\n+public class PopulatorMetricsReportingManagerService {\n+\n+    private static final String GRAPHITE=\"graphite\";\n+    private static final String GANGLIA=\"ganglia\";\n+    private static final String METRICS_SERVER_NAME =\"METRICS_SERVER_NAME\";\n+    private String METRICS_HOST;\n+    private String METRICS_PREFIX;\n+\n+    private long METRICS_REPORT_INTERVAL_SEC;\n+    private int METRICS_PORT;\n+\n+    private GraphiteReporter graphiteReporter = null;\n+    private GangliaReporter gangliaReporter = null;\n+    private long metricsReportIntervalSec;\n+\n+    public PopulatorMetricsReportingManagerService() {\n+        METRICS_HOST = ConfigurationService.get(\"METRICS_HOST\");\n+        METRICS_PREFIX = ConfigurationService.get(\"METRICS_PREFIX\");\n+        METRICS_REPORT_INTERVAL_SEC = ConfigurationService.getLong(\"METRICS_REPORT_INTERVAL_SEC\");\n+        METRICS_PORT = ConfigurationService.getInt(\"METRICS_PORT\");\n+    }\n+\n+    public void init(MetricRegistry metricRegistry) {\n+\n+        if(ConfigurationService.get(METRICS_SERVER_NAME).equals(GRAPHITE)) {\n+            Graphite graphite = new Graphite(new InetSocketAddress(METRICS_HOST, METRICS_PORT));\n+            graphiteReporter = GraphiteReporter.forRegistry(metricRegistry).prefixedWith(METRICS_PREFIX)\n+                    .convertDurationsTo(TimeUnit.SECONDS).filter(MetricFilter.ALL).build(graphite);\n+        }\n+\n+        if(ConfigurationService.get(METRICS_SERVER_NAME).equals(GANGLIA)) {\n+            GMetric ganglia = null;\n+            try {\n+                ganglia = new GMetric(METRICS_HOST, METRICS_PORT, GMetric.UDPAddressingMode.MULTICAST, 1);\n+            } catch (IOException e) {\n+                e.printStackTrace();","path":"core/src/main/java/org/apache/oozie/service/PopulatorMetricsReportingManagerService.java","position":66,"original_position":66,"commit_id":"b5b09dab1571cc52547dfd50a2341e3f08e5999e","original_commit_id":"b5b09dab1571cc52547dfd50a2341e3f08e5999e","user":{"login":"nperiwal","id":10936156,"avatar_url":"https://avatars.githubusercontent.com/u/10936156?v=3","gravatar_id":"","url":"https://api.github.com/users/nperiwal","html_url":"https://github.com/nperiwal","followers_url":"https://api.github.com/users/nperiwal/followers","following_url":"https://api.github.com/users/nperiwal/following{/other_user}","gists_url":"https://api.github.com/users/nperiwal/gists{/gist_id}","starred_url":"https://api.github.com/users/nperiwal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nperiwal/subscriptions","organizations_url":"https://api.github.com/users/nperiwal/orgs","repos_url":"https://api.github.com/users/nperiwal/repos","events_url":"https://api.github.com/users/nperiwal/events{/privacy}","received_events_url":"https://api.github.com/users/nperiwal/received_events","type":"User","site_admin":false},"body":"If we don't catch it, its shows error saying unhandled exception : java.io.IOException","created_at":"2015-05-25T08:13:52Z","updated_at":"2015-05-25T08:13:52Z","html_url":"https://github.com/InMobi/oozie/pull/62#discussion_r30967936","pull_request_url":"https://api.github.com/repos/InMobi/oozie/pulls/62","_links":{"self":{"href":"https://api.github.com/repos/InMobi/oozie/pulls/comments/30967936"},"html":{"href":"https://github.com/InMobi/oozie/pull/62#discussion_r30967936"},"pull_request":{"href":"https://api.github.com/repos/InMobi/oozie/pulls/62"}}},"pull_request":{"url":"https://api.github.com/repos/InMobi/oozie/pulls/62","id":35614377,"html_url":"https://github.com/InMobi/oozie/pull/62","diff_url":"https://github.com/InMobi/oozie/pull/62.diff","patch_url":"https://github.com/InMobi/oozie/pull/62.patch","issue_url":"https://api.github.com/repos/InMobi/oozie/issues/62","number":62,"state":"open","locked":false,"title":"Integrating Oozie functional metrics with Hawkeye","user":{"login":"nperiwal","id":10936156,"avatar_url":"https://avatars.githubusercontent.com/u/10936156?v=3","gravatar_id":"","url":"https://api.github.com/users/nperiwal","html_url":"https://github.com/nperiwal","followers_url":"https://api.github.com/users/nperiwal/followers","following_url":"https://api.github.com/users/nperiwal/following{/other_user}","gists_url":"https://api.github.com/users/nperiwal/gists{/gist_id}","starred_url":"https://api.github.com/users/nperiwal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nperiwal/subscriptions","organizations_url":"https://api.github.com/users/nperiwal/orgs","repos_url":"https://api.github.com/users/nperiwal/repos","events_url":"https://api.github.com/users/nperiwal/events{/privacy}","received_events_url":"https://api.github.com/users/nperiwal/received_events","type":"User","site_admin":false},"body":"The metrics that are available in oozie-instrumentation are displayed in Hawkeye","created_at":"2015-05-18T09:06:41Z","updated_at":"2015-05-25T08:13:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"84dcfb952c8c9da06aa1a80c023ad63a3be7dac3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/InMobi/oozie/pulls/62/commits","review_comments_url":"https://api.github.com/repos/InMobi/oozie/pulls/62/comments","review_comment_url":"https://api.github.com/repos/InMobi/oozie/pulls/comments{/number}","comments_url":"https://api.github.com/repos/InMobi/oozie/issues/62/comments","statuses_url":"https://api.github.com/repos/InMobi/oozie/statuses/b5b09dab1571cc52547dfd50a2341e3f08e5999e","head":{"label":"nperiwal:apache-oozie","ref":"apache-oozie","sha":"b5b09dab1571cc52547dfd50a2341e3f08e5999e","user":{"login":"nperiwal","id":10936156,"avatar_url":"https://avatars.githubusercontent.com/u/10936156?v=3","gravatar_id":"","url":"https://api.github.com/users/nperiwal","html_url":"https://github.com/nperiwal","followers_url":"https://api.github.com/users/nperiwal/followers","following_url":"https://api.github.com/users/nperiwal/following{/other_user}","gists_url":"https://api.github.com/users/nperiwal/gists{/gist_id}","starred_url":"https://api.github.com/users/nperiwal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nperiwal/subscriptions","organizations_url":"https://api.github.com/users/nperiwal/orgs","repos_url":"https://api.github.com/users/nperiwal/repos","events_url":"https://api.github.com/users/nperiwal/events{/privacy}","received_events_url":"https://api.github.com/users/nperiwal/received_events","type":"User","site_admin":false},"repo":{"id":30578855,"name":"oozie","full_name":"nperiwal/oozie","owner":{"login":"nperiwal","id":10936156,"avatar_url":"https://avatars.githubusercontent.com/u/10936156?v=3","gravatar_id":"","url":"https://api.github.com/users/nperiwal","html_url":"https://github.com/nperiwal","followers_url":"https://api.github.com/users/nperiwal/followers","following_url":"https://api.github.com/users/nperiwal/following{/other_user}","gists_url":"https://api.github.com/users/nperiwal/gists{/gist_id}","starred_url":"https://api.github.com/users/nperiwal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nperiwal/subscriptions","organizations_url":"https://api.github.com/users/nperiwal/orgs","repos_url":"https://api.github.com/users/nperiwal/repos","events_url":"https://api.github.com/users/nperiwal/events{/privacy}","received_events_url":"https://api.github.com/users/nperiwal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nperiwal/oozie","description":"Mirror of Apache Oozie","fork":true,"url":"https://api.github.com/repos/nperiwal/oozie","forks_url":"https://api.github.com/repos/nperiwal/oozie/forks","keys_url":"https://api.github.com/repos/nperiwal/oozie/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nperiwal/oozie/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nperiwal/oozie/teams","hooks_url":"https://api.github.com/repos/nperiwal/oozie/hooks","issue_events_url":"https://api.github.com/repos/nperiwal/oozie/issues/events{/number}","events_url":"https://api.github.com/repos/nperiwal/oozie/events","assignees_url":"https://api.github.com/repos/nperiwal/oozie/assignees{/user}","branches_url":"https://api.github.com/repos/nperiwal/oozie/branches{/branch}","tags_url":"https://api.github.com/repos/nperiwal/oozie/tags","blobs_url":"https://api.github.com/repos/nperiwal/oozie/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nperiwal/oozie/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nperiwal/oozie/git/refs{/sha}","trees_url":"https://api.github.com/repos/nperiwal/oozie/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nperiwal/oozie/statuses/{sha}","languages_url":"https://api.github.com/repos/nperiwal/oozie/languages","stargazers_url":"https://api.github.com/repos/nperiwal/oozie/stargazers","contributors_url":"https://api.github.com/repos/nperiwal/oozie/contributors","subscribers_url":"https://api.github.com/repos/nperiwal/oozie/subscribers","subscription_url":"https://api.github.com/repos/nperiwal/oozie/subscription","commits_url":"https://api.github.com/repos/nperiwal/oozie/commits{/sha}","git_commits_url":"https://api.github.com/repos/nperiwal/oozie/git/commits{/sha}","comments_url":"https://api.github.com/repos/nperiwal/oozie/comments{/number}","issue_comment_url":"https://api.github.com/repos/nperiwal/oozie/issues/comments{/number}","contents_url":"https://api.github.com/repos/nperiwal/oozie/contents/{+path}","compare_url":"https://api.github.com/repos/nperiwal/oozie/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nperiwal/oozie/merges","archive_url":"https://api.github.com/repos/nperiwal/oozie/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nperiwal/oozie/downloads","issues_url":"https://api.github.com/repos/nperiwal/oozie/issues{/number}","pulls_url":"https://api.github.com/repos/nperiwal/oozie/pulls{/number}","milestones_url":"https://api.github.com/repos/nperiwal/oozie/milestones{/number}","notifications_url":"https://api.github.com/repos/nperiwal/oozie/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nperiwal/oozie/labels{/name}","releases_url":"https://api.github.com/repos/nperiwal/oozie/releases{/id}","created_at":"2015-02-10T06:41:56Z","updated_at":"2015-02-10T06:42:00Z","pushed_at":"2015-05-25T07:04:57Z","git_url":"git://github.com/nperiwal/oozie.git","ssh_url":"git@github.com:nperiwal/oozie.git","clone_url":"https://github.com/nperiwal/oozie.git","svn_url":"https://github.com/nperiwal/oozie","homepage":null,"size":18245,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"InMobi:apache-oozie","ref":"apache-oozie","sha":"74addb47c20a70837cc6b1266f2aba8563a4867a","user":{"login":"InMobi","id":570133,"avatar_url":"https://avatars.githubusercontent.com/u/570133?v=3","gravatar_id":"","url":"https://api.github.com/users/InMobi","html_url":"https://github.com/InMobi","followers_url":"https://api.github.com/users/InMobi/followers","following_url":"https://api.github.com/users/InMobi/following{/other_user}","gists_url":"https://api.github.com/users/InMobi/gists{/gist_id}","starred_url":"https://api.github.com/users/InMobi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/InMobi/subscriptions","organizations_url":"https://api.github.com/users/InMobi/orgs","repos_url":"https://api.github.com/users/InMobi/repos","events_url":"https://api.github.com/users/InMobi/events{/privacy}","received_events_url":"https://api.github.com/users/InMobi/received_events","type":"Organization","site_admin":false},"repo":{"id":6453586,"name":"oozie","full_name":"InMobi/oozie","owner":{"login":"InMobi","id":570133,"avatar_url":"https://avatars.githubusercontent.com/u/570133?v=3","gravatar_id":"","url":"https://api.github.com/users/InMobi","html_url":"https://github.com/InMobi","followers_url":"https://api.github.com/users/InMobi/followers","following_url":"https://api.github.com/users/InMobi/following{/other_user}","gists_url":"https://api.github.com/users/InMobi/gists{/gist_id}","starred_url":"https://api.github.com/users/InMobi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/InMobi/subscriptions","organizations_url":"https://api.github.com/users/InMobi/orgs","repos_url":"https://api.github.com/users/InMobi/repos","events_url":"https://api.github.com/users/InMobi/events{/privacy}","received_events_url":"https://api.github.com/users/InMobi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/InMobi/oozie","description":"Mirror of Apache Oozie","fork":true,"url":"https://api.github.com/repos/InMobi/oozie","forks_url":"https://api.github.com/repos/InMobi/oozie/forks","keys_url":"https://api.github.com/repos/InMobi/oozie/keys{/key_id}","collaborators_url":"https://api.github.com/repos/InMobi/oozie/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/InMobi/oozie/teams","hooks_url":"https://api.github.com/repos/InMobi/oozie/hooks","issue_events_url":"https://api.github.com/repos/InMobi/oozie/issues/events{/number}","events_url":"https://api.github.com/repos/InMobi/oozie/events","assignees_url":"https://api.github.com/repos/InMobi/oozie/assignees{/user}","branches_url":"https://api.github.com/repos/InMobi/oozie/branches{/branch}","tags_url":"https://api.github.com/repos/InMobi/oozie/tags","blobs_url":"https://api.github.com/repos/InMobi/oozie/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/InMobi/oozie/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/InMobi/oozie/git/refs{/sha}","trees_url":"https://api.github.com/repos/InMobi/oozie/git/trees{/sha}","statuses_url":"https://api.github.com/repos/InMobi/oozie/statuses/{sha}","languages_url":"https://api.github.com/repos/InMobi/oozie/languages","stargazers_url":"https://api.github.com/repos/InMobi/oozie/stargazers","contributors_url":"https://api.github.com/repos/InMobi/oozie/contributors","subscribers_url":"https://api.github.com/repos/InMobi/oozie/subscribers","subscription_url":"https://api.github.com/repos/InMobi/oozie/subscription","commits_url":"https://api.github.com/repos/InMobi/oozie/commits{/sha}","git_commits_url":"https://api.github.com/repos/InMobi/oozie/git/commits{/sha}","comments_url":"https://api.github.com/repos/InMobi/oozie/comments{/number}","issue_comment_url":"https://api.github.com/repos/InMobi/oozie/issues/comments{/number}","contents_url":"https://api.github.com/repos/InMobi/oozie/contents/{+path}","compare_url":"https://api.github.com/repos/InMobi/oozie/compare/{base}...{head}","merges_url":"https://api.github.com/repos/InMobi/oozie/merges","archive_url":"https://api.github.com/repos/InMobi/oozie/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/InMobi/oozie/downloads","issues_url":"https://api.github.com/repos/InMobi/oozie/issues{/number}","pulls_url":"https://api.github.com/repos/InMobi/oozie/pulls{/number}","milestones_url":"https://api.github.com/repos/InMobi/oozie/milestones{/number}","notifications_url":"https://api.github.com/repos/InMobi/oozie/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/InMobi/oozie/labels{/name}","releases_url":"https://api.github.com/repos/InMobi/oozie/releases{/id}","created_at":"2012-10-30T07:41:12Z","updated_at":"2015-05-21T07:09:23Z","pushed_at":"2015-05-25T07:04:58Z","git_url":"git://github.com/InMobi/oozie.git","ssh_url":"git@github.com:InMobi/oozie.git","clone_url":"https://github.com/InMobi/oozie.git","svn_url":"https://github.com/InMobi/oozie","homepage":null,"size":19600,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":2,"forks":8,"open_issues":2,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/InMobi/oozie/pulls/62"},"html":{"href":"https://github.com/InMobi/oozie/pull/62"},"issue":{"href":"https://api.github.com/repos/InMobi/oozie/issues/62"},"comments":{"href":"https://api.github.com/repos/InMobi/oozie/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/InMobi/oozie/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/InMobi/oozie/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/InMobi/oozie/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/InMobi/oozie/statuses/b5b09dab1571cc52547dfd50a2341e3f08e5999e"}}}}