GitHub PullRequestReviewCommentEvent at 2014-11-21 13:59:00
Repository: akka
Actor: Andrei-Pozolotin
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/akka/akka/pulls/comments/20715661","id":20715661,"diff_hunk":"@@ -754,18 +743,25 @@ class SigarMetricsCollector(address: Address, decayFactor: Double, sigar: AnyRef\n    *\n    * Creates a new instance each time.\n    */\n-  def cpuCombined: Option[Metric] = Metric.create(\n+  def cpuCombined(cpuPerc: CpuPerc): Option[Metric] = Metric.create(\n     name = CpuCombined,\n-    value = Try(CombinedCpu.get.invoke(Cpu.get.invoke(sigar)).asInstanceOf[Number]),\n+    value = cpuPerc.getCombined.asInstanceOf[Number],\n     decayFactor = decayFactorOption)\n \n   /**\n-   * Releases any native resources associated with this instance.\n+   * (SIGAR) Returns the stolen CPU time. Relevant to virtual hosting environments.\n+   * http://en.wikipedia.org/wiki/CPU_time#Subdivision\n+   * https://www.datadoghq.com/2013/08/understanding-aws-stolen-cpu-and-how-it-affects-your-apps/\n    */\n-  override def close(): Unit = Try(createMethodFrom(sigar, \"close\").get.invoke(sigar))\n+  def cpuStolen(cpuPerc: CpuPerc): Option[Metric] = Metric.create(\n+    name = CpuStolen,\n+    value = cpuPerc.getStolen.asInstanceOf[Number],\n+    decayFactor = decayFactorOption)\n \n-  private def createMethodFrom(ref: AnyRef, method: String, types: Array[(Class[_])] = EmptyClassArray): Option[Method] =\n-    Try(ref.getClass.getMethod(method, types: _*)).toOption\n+  /**\n+   * Releases any native resources associated with this instance.\n+   */\n+  override def close: Unit = sigar.close","path":"akka-cluster/src/main/scala/akka/cluster/ClusterMetricsCollector.scala","position":145,"original_position":145,"commit_id":"1415fe155e99b150e963e9328862b66a87ccb825","original_commit_id":"1415fe155e99b150e963e9328862b66a87ccb825","user":{"login":"Andrei-Pozolotin","id":1622151,"avatar_url":"https://avatars.githubusercontent.com/u/1622151?v=3","gravatar_id":"","url":"https://api.github.com/users/Andrei-Pozolotin","html_url":"https://github.com/Andrei-Pozolotin","followers_url":"https://api.github.com/users/Andrei-Pozolotin/followers","following_url":"https://api.github.com/users/Andrei-Pozolotin/following{/other_user}","gists_url":"https://api.github.com/users/Andrei-Pozolotin/gists{/gist_id}","starred_url":"https://api.github.com/users/Andrei-Pozolotin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Andrei-Pozolotin/subscriptions","organizations_url":"https://api.github.com/users/Andrei-Pozolotin/orgs","repos_url":"https://api.github.com/users/Andrei-Pozolotin/repos","events_url":"https://api.github.com/users/Andrei-Pozolotin/events{/privacy}","received_events_url":"https://api.github.com/users/Andrei-Pozolotin/received_events","type":"User","site_admin":false},"body":"ok, how about \r\n2) bring the try back , but introduce scary error level logging","created_at":"2014-11-21T13:59:00Z","updated_at":"2014-11-21T13:59:00Z","html_url":"https://github.com/akka/akka/pull/16354#discussion_r20715661","pull_request_url":"https://api.github.com/repos/akka/akka/pulls/16354","_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/comments/20715661"},"html":{"href":"https://github.com/akka/akka/pull/16354#discussion_r20715661"},"pull_request":{"href":"https://api.github.com/repos/akka/akka/pulls/16354"}}},"pull_request":{"url":"https://api.github.com/repos/akka/akka/pulls/16354","id":24810749,"html_url":"https://github.com/akka/akka/pull/16354","diff_url":"https://github.com/akka/akka/pull/16354.diff","patch_url":"https://github.com/akka/akka/pull/16354.patch","issue_url":"https://api.github.com/repos/akka/akka/issues/16354","number":16354,"state":"open","locked":false,"title":"! akka-cluster: metrics collector improvements - resolve #16121","user":{"login":"Andrei-Pozolotin","id":1622151,"avatar_url":"https://avatars.githubusercontent.com/u/1622151?v=3","gravatar_id":"","url":"https://api.github.com/users/Andrei-Pozolotin","html_url":"https://github.com/Andrei-Pozolotin","followers_url":"https://api.github.com/users/Andrei-Pozolotin/followers","following_url":"https://api.github.com/users/Andrei-Pozolotin/following{/other_user}","gists_url":"https://api.github.com/users/Andrei-Pozolotin/gists{/gist_id}","starred_url":"https://api.github.com/users/Andrei-Pozolotin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Andrei-Pozolotin/subscriptions","organizations_url":"https://api.github.com/users/Andrei-Pozolotin/orgs","repos_url":"https://api.github.com/users/Andrei-Pozolotin/repos","events_url":"https://api.github.com/users/Andrei-Pozolotin/events{/privacy}","received_events_url":"https://api.github.com/users/Andrei-Pozolotin/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-11-21T00:36:34Z","updated_at":"2014-11-21T13:59:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"369d0f7869c5d07a410dd839566dc16f49d52de0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/akka/akka/pulls/16354/commits","review_comments_url":"https://api.github.com/repos/akka/akka/pulls/16354/comments","review_comment_url":"https://api.github.com/repos/akka/akka/pulls/comments/{number}","comments_url":"https://api.github.com/repos/akka/akka/issues/16354/comments","statuses_url":"https://api.github.com/repos/akka/akka/statuses/1415fe155e99b150e963e9328862b66a87ccb825","head":{"label":"carrot-garden:cluster-metrics-collector-improvements","ref":"cluster-metrics-collector-improvements","sha":"1415fe155e99b150e963e9328862b66a87ccb825","user":{"login":"carrot-garden","id":755059,"avatar_url":"https://avatars.githubusercontent.com/u/755059?v=3","gravatar_id":"","url":"https://api.github.com/users/carrot-garden","html_url":"https://github.com/carrot-garden","followers_url":"https://api.github.com/users/carrot-garden/followers","following_url":"https://api.github.com/users/carrot-garden/following{/other_user}","gists_url":"https://api.github.com/users/carrot-garden/gists{/gist_id}","starred_url":"https://api.github.com/users/carrot-garden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carrot-garden/subscriptions","organizations_url":"https://api.github.com/users/carrot-garden/orgs","repos_url":"https://api.github.com/users/carrot-garden/repos","events_url":"https://api.github.com/users/carrot-garden/events{/privacy}","received_events_url":"https://api.github.com/users/carrot-garden/received_events","type":"Organization","site_admin":false},"repo":{"id":2627921,"name":"scala_akka","full_name":"carrot-garden/scala_akka","owner":{"login":"carrot-garden","id":755059,"avatar_url":"https://avatars.githubusercontent.com/u/755059?v=3","gravatar_id":"","url":"https://api.github.com/users/carrot-garden","html_url":"https://github.com/carrot-garden","followers_url":"https://api.github.com/users/carrot-garden/followers","following_url":"https://api.github.com/users/carrot-garden/following{/other_user}","gists_url":"https://api.github.com/users/carrot-garden/gists{/gist_id}","starred_url":"https://api.github.com/users/carrot-garden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carrot-garden/subscriptions","organizations_url":"https://api.github.com/users/carrot-garden/orgs","repos_url":"https://api.github.com/users/carrot-garden/repos","events_url":"https://api.github.com/users/carrot-garden/events{/privacy}","received_events_url":"https://api.github.com/users/carrot-garden/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/carrot-garden/scala_akka","description":"Akka Project","fork":true,"url":"https://api.github.com/repos/carrot-garden/scala_akka","forks_url":"https://api.github.com/repos/carrot-garden/scala_akka/forks","keys_url":"https://api.github.com/repos/carrot-garden/scala_akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/carrot-garden/scala_akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/carrot-garden/scala_akka/teams","hooks_url":"https://api.github.com/repos/carrot-garden/scala_akka/hooks","issue_events_url":"https://api.github.com/repos/carrot-garden/scala_akka/issues/events{/number}","events_url":"https://api.github.com/repos/carrot-garden/scala_akka/events","assignees_url":"https://api.github.com/repos/carrot-garden/scala_akka/assignees{/user}","branches_url":"https://api.github.com/repos/carrot-garden/scala_akka/branches{/branch}","tags_url":"https://api.github.com/repos/carrot-garden/scala_akka/tags","blobs_url":"https://api.github.com/repos/carrot-garden/scala_akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/carrot-garden/scala_akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/carrot-garden/scala_akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/carrot-garden/scala_akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/carrot-garden/scala_akka/statuses/{sha}","languages_url":"https://api.github.com/repos/carrot-garden/scala_akka/languages","stargazers_url":"https://api.github.com/repos/carrot-garden/scala_akka/stargazers","contributors_url":"https://api.github.com/repos/carrot-garden/scala_akka/contributors","subscribers_url":"https://api.github.com/repos/carrot-garden/scala_akka/subscribers","subscription_url":"https://api.github.com/repos/carrot-garden/scala_akka/subscription","commits_url":"https://api.github.com/repos/carrot-garden/scala_akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/carrot-garden/scala_akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/carrot-garden/scala_akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/carrot-garden/scala_akka/issues/comments/{number}","contents_url":"https://api.github.com/repos/carrot-garden/scala_akka/contents/{+path}","compare_url":"https://api.github.com/repos/carrot-garden/scala_akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/carrot-garden/scala_akka/merges","archive_url":"https://api.github.com/repos/carrot-garden/scala_akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/carrot-garden/scala_akka/downloads","issues_url":"https://api.github.com/repos/carrot-garden/scala_akka/issues{/number}","pulls_url":"https://api.github.com/repos/carrot-garden/scala_akka/pulls{/number}","milestones_url":"https://api.github.com/repos/carrot-garden/scala_akka/milestones{/number}","notifications_url":"https://api.github.com/repos/carrot-garden/scala_akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/carrot-garden/scala_akka/labels{/name}","releases_url":"https://api.github.com/repos/carrot-garden/scala_akka/releases{/id}","created_at":"2011-10-22T21:09:22Z","updated_at":"2014-09-03T13:42:14Z","pushed_at":"2014-11-21T00:34:20Z","git_url":"git://github.com/carrot-garden/scala_akka.git","ssh_url":"git@github.com:carrot-garden/scala_akka.git","clone_url":"https://github.com/carrot-garden/scala_akka.git","svn_url":"https://github.com/carrot-garden/scala_akka","homepage":"http://akka.io","size":149972,"stargazers_count":1,"watchers_count":1,"language":"Scala","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":1,"default_branch":"master"}},"base":{"label":"akka:master","ref":"master","sha":"fd498d34a5a50852f44bd270c5f83e09620689e3","user":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"repo":{"id":130013,"name":"akka","full_name":"akka/akka","owner":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/akka/akka","description":"Akka Project","fork":false,"url":"https://api.github.com/repos/akka/akka","forks_url":"https://api.github.com/repos/akka/akka/forks","keys_url":"https://api.github.com/repos/akka/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akka/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akka/akka/teams","hooks_url":"https://api.github.com/repos/akka/akka/hooks","issue_events_url":"https://api.github.com/repos/akka/akka/issues/events{/number}","events_url":"https://api.github.com/repos/akka/akka/events","assignees_url":"https://api.github.com/repos/akka/akka/assignees{/user}","branches_url":"https://api.github.com/repos/akka/akka/branches{/branch}","tags_url":"https://api.github.com/repos/akka/akka/tags","blobs_url":"https://api.github.com/repos/akka/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akka/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akka/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/akka/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akka/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/akka/akka/languages","stargazers_url":"https://api.github.com/repos/akka/akka/stargazers","contributors_url":"https://api.github.com/repos/akka/akka/contributors","subscribers_url":"https://api.github.com/repos/akka/akka/subscribers","subscription_url":"https://api.github.com/repos/akka/akka/subscription","commits_url":"https://api.github.com/repos/akka/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/akka/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/akka/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/akka/akka/issues/comments/{number}","contents_url":"https://api.github.com/repos/akka/akka/contents/{+path}","compare_url":"https://api.github.com/repos/akka/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akka/akka/merges","archive_url":"https://api.github.com/repos/akka/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akka/akka/downloads","issues_url":"https://api.github.com/repos/akka/akka/issues{/number}","pulls_url":"https://api.github.com/repos/akka/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/akka/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/akka/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akka/akka/labels{/name}","releases_url":"https://api.github.com/repos/akka/akka/releases{/id}","created_at":"2009-02-16T12:51:54Z","updated_at":"2014-11-21T10:37:01Z","pushed_at":"2014-11-21T12:32:20Z","git_url":"git://github.com/akka/akka.git","ssh_url":"git@github.com:akka/akka.git","clone_url":"https://github.com/akka/akka.git","svn_url":"https://github.com/akka/akka","homepage":"http://akka.io","size":239721,"stargazers_count":3216,"watchers_count":3216,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":898,"mirror_url":null,"open_issues_count":486,"forks":898,"open_issues":486,"watchers":3216,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/16354"},"html":{"href":"https://github.com/akka/akka/pull/16354"},"issue":{"href":"https://api.github.com/repos/akka/akka/issues/16354"},"comments":{"href":"https://api.github.com/repos/akka/akka/issues/16354/comments"},"review_comments":{"href":"https://api.github.com/repos/akka/akka/pulls/16354/comments"},"review_comment":{"href":"https://api.github.com/repos/akka/akka/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/akka/akka/pulls/16354/commits"},"statuses":{"href":"https://api.github.com/repos/akka/akka/statuses/1415fe155e99b150e963e9328862b66a87ccb825"}}}}