{"action":"created","comment":{"url":"https://api.github.com/repos/apache/flink/pulls/comments/29662593","id":29662593,"diff_hunk":"@@ -1894,6 +1895,52 @@ object TaskManager {\n       override def getValue: Double =\n         ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage()\n     })\n+    \n+    // Preprocessing steps for registering cpuLoad\n+    // fetch the method to get process CPU load\n+    val getCPULoadMethod: Method = getMethodToFetchCPULoad()\n+\n+    // define the fetchCPULoad method as per the fetched getCPULoadMethod\n+    // dummy initialisation\n+    var fetchCPULoad:(Any) => Double = (obj:Any) => -1\n+\n+    if(getCPULoadMethod != null){\n+      fetchCPULoad = (obj:Any) => getCPULoadMethod.invoke(obj).asInstanceOf[Double]\n+    } else {\n+      // Log getProcessCpuLoad method not available for Java 6\n+      LOG.warn(\"getProcessCpuLoad method not available in the Operating System Bean\" +\n+        \"implementation for this Java runtime environment\\n\" + Thread.currentThread().getStackTrace)\n+    }\n+\n+    metricRegistry.register(\"cpuLoad\", new Gauge[Double] {\n+      override def getValue: Double = {\n+        try{\n+          val osMXBean = ManagementFactory.getOperatingSystemMXBean().\n+            asInstanceOf[com.sun.management.OperatingSystemMXBean]\n+          return fetchCPULoad(osMXBean)","path":"flink-runtime/src/main/scala/org/apache/flink/runtime/taskmanager/TaskManager.scala","position":34,"original_position":34,"commit_id":"0dae7808045a2bf6c5b1f7030b3d350e6e3f67bb","original_commit_id":"0dae7808045a2bf6c5b1f7030b3d350e6e3f67bb","user":{"login":"tillrohrmann","id":5756858,"avatar_url":"https://avatars.githubusercontent.com/u/5756858?v=3","gravatar_id":"","url":"https://api.github.com/users/tillrohrmann","html_url":"https://github.com/tillrohrmann","followers_url":"https://api.github.com/users/tillrohrmann/followers","following_url":"https://api.github.com/users/tillrohrmann/following{/other_user}","gists_url":"https://api.github.com/users/tillrohrmann/gists{/gist_id}","starred_url":"https://api.github.com/users/tillrohrmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tillrohrmann/subscriptions","organizations_url":"https://api.github.com/users/tillrohrmann/orgs","repos_url":"https://api.github.com/users/tillrohrmann/repos","events_url":"https://api.github.com/users/tillrohrmann/events{/privacy}","received_events_url":"https://api.github.com/users/tillrohrmann/received_events","type":"User","site_admin":false},"body":"no return statement necessary in Scala","created_at":"2015-05-05T12:09:00Z","updated_at":"2015-05-05T12:09:00Z","html_url":"https://github.com/apache/flink/pull/553#discussion_r29662593","pull_request_url":"https://api.github.com/repos/apache/flink/pulls/553","_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/comments/29662593"},"html":{"href":"https://github.com/apache/flink/pull/553#discussion_r29662593"},"pull_request":{"href":"https://api.github.com/repos/apache/flink/pulls/553"}}},"pull_request":{"url":"https://api.github.com/repos/apache/flink/pulls/553","id":32371398,"html_url":"https://github.com/apache/flink/pull/553","diff_url":"https://github.com/apache/flink/pull/553.diff","patch_url":"https://github.com/apache/flink/pull/553.patch","issue_url":"https://api.github.com/repos/apache/flink/issues/553","number":553,"state":"open","locked":false,"title":"[FLINK-1792] TM Monitoring: CPU utilization, hide graphs by default and show summary only","user":{"login":"bhatsachin","id":4468933,"avatar_url":"https://avatars.githubusercontent.com/u/4468933?v=3","gravatar_id":"","url":"https://api.github.com/users/bhatsachin","html_url":"https://github.com/bhatsachin","followers_url":"https://api.github.com/users/bhatsachin/followers","following_url":"https://api.github.com/users/bhatsachin/following{/other_user}","gists_url":"https://api.github.com/users/bhatsachin/gists{/gist_id}","starred_url":"https://api.github.com/users/bhatsachin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhatsachin/subscriptions","organizations_url":"https://api.github.com/users/bhatsachin/orgs","repos_url":"https://api.github.com/users/bhatsachin/repos","events_url":"https://api.github.com/users/bhatsachin/events{/privacy}","received_events_url":"https://api.github.com/users/bhatsachin/received_events","type":"User","site_admin":false},"body":"Added CPU Load % using another implementation of the OperatingSystemMXBean (https://docs.oracle.com/javase/7/docs/jre/api/management/extension/com/sun/management/OperatingSystemMXBean.html) and its method getProcessCpuLoad(). \r\nAdded show/hide button for detailed graph and summary for the metrics. Currently, the summary is being generated for the previous 10 minutes by default.  ","created_at":"2015-03-31T22:12:02Z","updated_at":"2015-05-05T12:09:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b79194c90212ef2b159f17f94e615cdea2914b6c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/flink/pulls/553/commits","review_comments_url":"https://api.github.com/repos/apache/flink/pulls/553/comments","review_comment_url":"https://api.github.com/repos/apache/flink/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/flink/issues/553/comments","statuses_url":"https://api.github.com/repos/apache/flink/statuses/0dae7808045a2bf6c5b1f7030b3d350e6e3f67bb","head":{"label":"bhatsachin:dev-bhatsachin-flink-1792","ref":"dev-bhatsachin-flink-1792","sha":"0dae7808045a2bf6c5b1f7030b3d350e6e3f67bb","user":{"login":"bhatsachin","id":4468933,"avatar_url":"https://avatars.githubusercontent.com/u/4468933?v=3","gravatar_id":"","url":"https://api.github.com/users/bhatsachin","html_url":"https://github.com/bhatsachin","followers_url":"https://api.github.com/users/bhatsachin/followers","following_url":"https://api.github.com/users/bhatsachin/following{/other_user}","gists_url":"https://api.github.com/users/bhatsachin/gists{/gist_id}","starred_url":"https://api.github.com/users/bhatsachin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhatsachin/subscriptions","organizations_url":"https://api.github.com/users/bhatsachin/orgs","repos_url":"https://api.github.com/users/bhatsachin/repos","events_url":"https://api.github.com/users/bhatsachin/events{/privacy}","received_events_url":"https://api.github.com/users/bhatsachin/received_events","type":"User","site_admin":false},"repo":{"id":32088063,"name":"flink","full_name":"bhatsachin/flink","owner":{"login":"bhatsachin","id":4468933,"avatar_url":"https://avatars.githubusercontent.com/u/4468933?v=3","gravatar_id":"","url":"https://api.github.com/users/bhatsachin","html_url":"https://github.com/bhatsachin","followers_url":"https://api.github.com/users/bhatsachin/followers","following_url":"https://api.github.com/users/bhatsachin/following{/other_user}","gists_url":"https://api.github.com/users/bhatsachin/gists{/gist_id}","starred_url":"https://api.github.com/users/bhatsachin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhatsachin/subscriptions","organizations_url":"https://api.github.com/users/bhatsachin/orgs","repos_url":"https://api.github.com/users/bhatsachin/repos","events_url":"https://api.github.com/users/bhatsachin/events{/privacy}","received_events_url":"https://api.github.com/users/bhatsachin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bhatsachin/flink","description":"Mirror of Apache Flink","fork":true,"url":"https://api.github.com/repos/bhatsachin/flink","forks_url":"https://api.github.com/repos/bhatsachin/flink/forks","keys_url":"https://api.github.com/repos/bhatsachin/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bhatsachin/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bhatsachin/flink/teams","hooks_url":"https://api.github.com/repos/bhatsachin/flink/hooks","issue_events_url":"https://api.github.com/repos/bhatsachin/flink/issues/events{/number}","events_url":"https://api.github.com/repos/bhatsachin/flink/events","assignees_url":"https://api.github.com/repos/bhatsachin/flink/assignees{/user}","branches_url":"https://api.github.com/repos/bhatsachin/flink/branches{/branch}","tags_url":"https://api.github.com/repos/bhatsachin/flink/tags","blobs_url":"https://api.github.com/repos/bhatsachin/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bhatsachin/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bhatsachin/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/bhatsachin/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bhatsachin/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/bhatsachin/flink/languages","stargazers_url":"https://api.github.com/repos/bhatsachin/flink/stargazers","contributors_url":"https://api.github.com/repos/bhatsachin/flink/contributors","subscribers_url":"https://api.github.com/repos/bhatsachin/flink/subscribers","subscription_url":"https://api.github.com/repos/bhatsachin/flink/subscription","commits_url":"https://api.github.com/repos/bhatsachin/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/bhatsachin/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/bhatsachin/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/bhatsachin/flink/issues/comments{/number}","contents_url":"https://api.github.com/repos/bhatsachin/flink/contents/{+path}","compare_url":"https://api.github.com/repos/bhatsachin/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bhatsachin/flink/merges","archive_url":"https://api.github.com/repos/bhatsachin/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bhatsachin/flink/downloads","issues_url":"https://api.github.com/repos/bhatsachin/flink/issues{/number}","pulls_url":"https://api.github.com/repos/bhatsachin/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/bhatsachin/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/bhatsachin/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bhatsachin/flink/labels{/name}","releases_url":"https://api.github.com/repos/bhatsachin/flink/releases{/id}","created_at":"2015-03-12T16:31:59Z","updated_at":"2015-03-12T16:32:08Z","pushed_at":"2015-05-05T08:43:12Z","git_url":"git://github.com/bhatsachin/flink.git","ssh_url":"git@github.com:bhatsachin/flink.git","clone_url":"https://github.com/bhatsachin/flink.git","svn_url":"https://github.com/bhatsachin/flink","homepage":null,"size":44797,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"ae867efd3246a4eac636cb5d5c86e59b96e3040a","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":20587599,"name":"flink","full_name":"apache/flink","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/flink","description":"Mirror of Apache Flink","fork":false,"url":"https://api.github.com/repos/apache/flink","forks_url":"https://api.github.com/repos/apache/flink/forks","keys_url":"https://api.github.com/repos/apache/flink/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/flink/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/flink/teams","hooks_url":"https://api.github.com/repos/apache/flink/hooks","issue_events_url":"https://api.github.com/repos/apache/flink/issues/events{/number}","events_url":"https://api.github.com/repos/apache/flink/events","assignees_url":"https://api.github.com/repos/apache/flink/assignees{/user}","branches_url":"https://api.github.com/repos/apache/flink/branches{/branch}","tags_url":"https://api.github.com/repos/apache/flink/tags","blobs_url":"https://api.github.com/repos/apache/flink/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/flink/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/flink/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/flink/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/flink/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/flink/languages","stargazers_url":"https://api.github.com/repos/apache/flink/stargazers","contributors_url":"https://api.github.com/repos/apache/flink/contributors","subscribers_url":"https://api.github.com/repos/apache/flink/subscribers","subscription_url":"https://api.github.com/repos/apache/flink/subscription","commits_url":"https://api.github.com/repos/apache/flink/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/flink/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/flink/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/flink/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/flink/contents/{+path}","compare_url":"https://api.github.com/repos/apache/flink/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/flink/merges","archive_url":"https://api.github.com/repos/apache/flink/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/flink/downloads","issues_url":"https://api.github.com/repos/apache/flink/issues{/number}","pulls_url":"https://api.github.com/repos/apache/flink/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/flink/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/flink/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/flink/labels{/name}","releases_url":"https://api.github.com/repos/apache/flink/releases{/id}","created_at":"2014-06-07T07:00:10Z","updated_at":"2015-05-05T10:14:59Z","pushed_at":"2015-05-05T10:14:59Z","git_url":"git://github.com/apache/flink.git","ssh_url":"git@github.com:apache/flink.git","clone_url":"https://github.com/apache/flink.git","svn_url":"https://github.com/apache/flink","homepage":null,"size":3077092,"stargazers_count":380,"watchers_count":380,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":231,"mirror_url":"git://git.apache.org/incubator-flink.git","open_issues_count":44,"forks":231,"open_issues":44,"watchers":380,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/flink/pulls/553"},"html":{"href":"https://github.com/apache/flink/pull/553"},"issue":{"href":"https://api.github.com/repos/apache/flink/issues/553"},"comments":{"href":"https://api.github.com/repos/apache/flink/issues/553/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/flink/pulls/553/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/flink/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/flink/pulls/553/commits"},"statuses":{"href":"https://api.github.com/repos/apache/flink/statuses/0dae7808045a2bf6c5b1f7030b3d350e6e3f67bb"}}}}