{"action":"created","comment":{"url":"https://api.github.com/repos/yahoo/pulsar/pulls/comments/85608082","pull_request_review_id":6317277,"id":85608082,"diff_hunk":"@@ -71,25 +91,152 @@ public BrokerHostUsage(PulsarService pulsar) {\n      *\n      * @throws IOException\n      */\n-    public String getBrokerHostUsage() throws IOException {\n-        StringWriter writer = new StringWriter();\n+    public synchronized SystemResourceUsage getBrokerHostUsage() throws IOException {","path":"pulsar-broker/src/main/java/com/yahoo/pulsar/broker/loadbalance/BrokerHostUsage.java","position":62,"original_position":62,"commit_id":"35330408483daf951fb89ccd6e02f25954e9ff46","original_commit_id":"35330408483daf951fb89ccd6e02f25954e9ff46","user":{"login":"sschepens","id":3072509,"avatar_url":"https://avatars.githubusercontent.com/u/3072509?v=3","gravatar_id":"","url":"https://api.github.com/users/sschepens","html_url":"https://github.com/sschepens","followers_url":"https://api.github.com/users/sschepens/followers","following_url":"https://api.github.com/users/sschepens/following{/other_user}","gists_url":"https://api.github.com/users/sschepens/gists{/gist_id}","starred_url":"https://api.github.com/users/sschepens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sschepens/subscriptions","organizations_url":"https://api.github.com/users/sschepens/orgs","repos_url":"https://api.github.com/users/sschepens/repos","events_url":"https://api.github.com/users/sschepens/events{/privacy}","received_events_url":"https://api.github.com/users/sschepens/received_events","type":"User","site_admin":false},"body":"Current implementation runs the script everytime this method is called.\r\nHow often is this method actually called?\r\nThis method would return the average usage between two calls.","created_at":"2016-10-28T20:51:02Z","updated_at":"2016-10-28T20:51:02Z","html_url":"https://github.com/yahoo/pulsar/pull/88#discussion_r85608082","pull_request_url":"https://api.github.com/repos/yahoo/pulsar/pulls/88","_links":{"self":{"href":"https://api.github.com/repos/yahoo/pulsar/pulls/comments/85608082"},"html":{"href":"https://github.com/yahoo/pulsar/pull/88#discussion_r85608082"},"pull_request":{"href":"https://api.github.com/repos/yahoo/pulsar/pulls/88"}}},"pull_request":{"url":"https://api.github.com/repos/yahoo/pulsar/pulls/88","id":91076013,"html_url":"https://github.com/yahoo/pulsar/pull/88","diff_url":"https://github.com/yahoo/pulsar/pull/88.diff","patch_url":"https://github.com/yahoo/pulsar/pull/88.patch","issue_url":"https://api.github.com/repos/yahoo/pulsar/issues/88","number":88,"state":"open","locked":false,"title":"Implement BrokerHostUsage using java","user":{"login":"sschepens","id":3072509,"avatar_url":"https://avatars.githubusercontent.com/u/3072509?v=3","gravatar_id":"","url":"https://api.github.com/users/sschepens","html_url":"https://github.com/sschepens","followers_url":"https://api.github.com/users/sschepens/followers","following_url":"https://api.github.com/users/sschepens/following{/other_user}","gists_url":"https://api.github.com/users/sschepens/gists{/gist_id}","starred_url":"https://api.github.com/users/sschepens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sschepens/subscriptions","organizations_url":"https://api.github.com/users/sschepens/orgs","repos_url":"https://api.github.com/users/sschepens/repos","events_url":"https://api.github.com/users/sschepens/events{/privacy}","received_events_url":"https://api.github.com/users/sschepens/received_events","type":"User","site_admin":false},"body":"### Motivation\r\n\r\nIssue [#81](https://github.com/yahoo/pulsar/issues/81)\r\nI've made a first go a this, I believe it's working ok, please review :blush: \r\n\r\n### Modifications\r\n\r\nI've removed support for usage script and made `BrokerHostUsage` calculate metrics from system data.\r\nCurrent implementation only supports Linux, we should probably find a way to implement the same functionallity for other OS.\r\n\r\n### Result\r\n\r\nBroker can collect usage metrics without need for a script.\r\n","created_at":"2016-10-26T19:54:40Z","updated_at":"2016-10-28T20:51:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f7c2da614c7a525043b0816db315fbf48d0135f2","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/yahoo/pulsar/milestones/2","html_url":"https://github.com/yahoo/pulsar/milestones/1.16","labels_url":"https://api.github.com/repos/yahoo/pulsar/milestones/2/labels","id":2056012,"number":2,"title":"1.16","description":"","creator":{"login":"merlimat","id":62500,"avatar_url":"https://avatars.githubusercontent.com/u/62500?v=3","gravatar_id":"","url":"https://api.github.com/users/merlimat","html_url":"https://github.com/merlimat","followers_url":"https://api.github.com/users/merlimat/followers","following_url":"https://api.github.com/users/merlimat/following{/other_user}","gists_url":"https://api.github.com/users/merlimat/gists{/gist_id}","starred_url":"https://api.github.com/users/merlimat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merlimat/subscriptions","organizations_url":"https://api.github.com/users/merlimat/orgs","repos_url":"https://api.github.com/users/merlimat/repos","events_url":"https://api.github.com/users/merlimat/events{/privacy}","received_events_url":"https://api.github.com/users/merlimat/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":11,"state":"open","created_at":"2016-10-07T23:59:26Z","updated_at":"2016-10-28T20:09:42Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/yahoo/pulsar/pulls/88/commits","review_comments_url":"https://api.github.com/repos/yahoo/pulsar/pulls/88/comments","review_comment_url":"https://api.github.com/repos/yahoo/pulsar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yahoo/pulsar/issues/88/comments","statuses_url":"https://api.github.com/repos/yahoo/pulsar/statuses/35330408483daf951fb89ccd6e02f25954e9ff46","head":{"label":"sschepens:host_usage_collection","ref":"host_usage_collection","sha":"35330408483daf951fb89ccd6e02f25954e9ff46","user":{"login":"sschepens","id":3072509,"avatar_url":"https://avatars.githubusercontent.com/u/3072509?v=3","gravatar_id":"","url":"https://api.github.com/users/sschepens","html_url":"https://github.com/sschepens","followers_url":"https://api.github.com/users/sschepens/followers","following_url":"https://api.github.com/users/sschepens/following{/other_user}","gists_url":"https://api.github.com/users/sschepens/gists{/gist_id}","starred_url":"https://api.github.com/users/sschepens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sschepens/subscriptions","organizations_url":"https://api.github.com/users/sschepens/orgs","repos_url":"https://api.github.com/users/sschepens/repos","events_url":"https://api.github.com/users/sschepens/events{/privacy}","received_events_url":"https://api.github.com/users/sschepens/received_events","type":"User","site_admin":false},"repo":{"id":70098520,"name":"pulsar","full_name":"sschepens/pulsar","owner":{"login":"sschepens","id":3072509,"avatar_url":"https://avatars.githubusercontent.com/u/3072509?v=3","gravatar_id":"","url":"https://api.github.com/users/sschepens","html_url":"https://github.com/sschepens","followers_url":"https://api.github.com/users/sschepens/followers","following_url":"https://api.github.com/users/sschepens/following{/other_user}","gists_url":"https://api.github.com/users/sschepens/gists{/gist_id}","starred_url":"https://api.github.com/users/sschepens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sschepens/subscriptions","organizations_url":"https://api.github.com/users/sschepens/orgs","repos_url":"https://api.github.com/users/sschepens/repos","events_url":"https://api.github.com/users/sschepens/events{/privacy}","received_events_url":"https://api.github.com/users/sschepens/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sschepens/pulsar","description":"Pulsar - distributed pub-sub messaging system","fork":true,"url":"https://api.github.com/repos/sschepens/pulsar","forks_url":"https://api.github.com/repos/sschepens/pulsar/forks","keys_url":"https://api.github.com/repos/sschepens/pulsar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sschepens/pulsar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sschepens/pulsar/teams","hooks_url":"https://api.github.com/repos/sschepens/pulsar/hooks","issue_events_url":"https://api.github.com/repos/sschepens/pulsar/issues/events{/number}","events_url":"https://api.github.com/repos/sschepens/pulsar/events","assignees_url":"https://api.github.com/repos/sschepens/pulsar/assignees{/user}","branches_url":"https://api.github.com/repos/sschepens/pulsar/branches{/branch}","tags_url":"https://api.github.com/repos/sschepens/pulsar/tags","blobs_url":"https://api.github.com/repos/sschepens/pulsar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sschepens/pulsar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sschepens/pulsar/git/refs{/sha}","trees_url":"https://api.github.com/repos/sschepens/pulsar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sschepens/pulsar/statuses/{sha}","languages_url":"https://api.github.com/repos/sschepens/pulsar/languages","stargazers_url":"https://api.github.com/repos/sschepens/pulsar/stargazers","contributors_url":"https://api.github.com/repos/sschepens/pulsar/contributors","subscribers_url":"https://api.github.com/repos/sschepens/pulsar/subscribers","subscription_url":"https://api.github.com/repos/sschepens/pulsar/subscription","commits_url":"https://api.github.com/repos/sschepens/pulsar/commits{/sha}","git_commits_url":"https://api.github.com/repos/sschepens/pulsar/git/commits{/sha}","comments_url":"https://api.github.com/repos/sschepens/pulsar/comments{/number}","issue_comment_url":"https://api.github.com/repos/sschepens/pulsar/issues/comments{/number}","contents_url":"https://api.github.com/repos/sschepens/pulsar/contents/{+path}","compare_url":"https://api.github.com/repos/sschepens/pulsar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sschepens/pulsar/merges","archive_url":"https://api.github.com/repos/sschepens/pulsar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sschepens/pulsar/downloads","issues_url":"https://api.github.com/repos/sschepens/pulsar/issues{/number}","pulls_url":"https://api.github.com/repos/sschepens/pulsar/pulls{/number}","milestones_url":"https://api.github.com/repos/sschepens/pulsar/milestones{/number}","notifications_url":"https://api.github.com/repos/sschepens/pulsar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sschepens/pulsar/labels{/name}","releases_url":"https://api.github.com/repos/sschepens/pulsar/releases{/id}","deployments_url":"https://api.github.com/repos/sschepens/pulsar/deployments","created_at":"2016-10-05T20:52:50Z","updated_at":"2016-10-05T20:52:52Z","pushed_at":"2016-10-26T20:01:54Z","git_url":"git://github.com/sschepens/pulsar.git","ssh_url":"git@github.com:sschepens/pulsar.git","clone_url":"https://github.com/sschepens/pulsar.git","svn_url":"https://github.com/sschepens/pulsar","homepage":"","size":1805,"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":"master"}},"base":{"label":"yahoo:master","ref":"master","sha":"1868d2ff58e83d073e3031d48adf1da0d36b8308","user":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"repo":{"id":62117812,"name":"pulsar","full_name":"yahoo/pulsar","owner":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yahoo/pulsar","description":"Pulsar - distributed pub-sub messaging system","fork":false,"url":"https://api.github.com/repos/yahoo/pulsar","forks_url":"https://api.github.com/repos/yahoo/pulsar/forks","keys_url":"https://api.github.com/repos/yahoo/pulsar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yahoo/pulsar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yahoo/pulsar/teams","hooks_url":"https://api.github.com/repos/yahoo/pulsar/hooks","issue_events_url":"https://api.github.com/repos/yahoo/pulsar/issues/events{/number}","events_url":"https://api.github.com/repos/yahoo/pulsar/events","assignees_url":"https://api.github.com/repos/yahoo/pulsar/assignees{/user}","branches_url":"https://api.github.com/repos/yahoo/pulsar/branches{/branch}","tags_url":"https://api.github.com/repos/yahoo/pulsar/tags","blobs_url":"https://api.github.com/repos/yahoo/pulsar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yahoo/pulsar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yahoo/pulsar/git/refs{/sha}","trees_url":"https://api.github.com/repos/yahoo/pulsar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yahoo/pulsar/statuses/{sha}","languages_url":"https://api.github.com/repos/yahoo/pulsar/languages","stargazers_url":"https://api.github.com/repos/yahoo/pulsar/stargazers","contributors_url":"https://api.github.com/repos/yahoo/pulsar/contributors","subscribers_url":"https://api.github.com/repos/yahoo/pulsar/subscribers","subscription_url":"https://api.github.com/repos/yahoo/pulsar/subscription","commits_url":"https://api.github.com/repos/yahoo/pulsar/commits{/sha}","git_commits_url":"https://api.github.com/repos/yahoo/pulsar/git/commits{/sha}","comments_url":"https://api.github.com/repos/yahoo/pulsar/comments{/number}","issue_comment_url":"https://api.github.com/repos/yahoo/pulsar/issues/comments{/number}","contents_url":"https://api.github.com/repos/yahoo/pulsar/contents/{+path}","compare_url":"https://api.github.com/repos/yahoo/pulsar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yahoo/pulsar/merges","archive_url":"https://api.github.com/repos/yahoo/pulsar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yahoo/pulsar/downloads","issues_url":"https://api.github.com/repos/yahoo/pulsar/issues{/number}","pulls_url":"https://api.github.com/repos/yahoo/pulsar/pulls{/number}","milestones_url":"https://api.github.com/repos/yahoo/pulsar/milestones{/number}","notifications_url":"https://api.github.com/repos/yahoo/pulsar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yahoo/pulsar/labels{/name}","releases_url":"https://api.github.com/repos/yahoo/pulsar/releases{/id}","deployments_url":"https://api.github.com/repos/yahoo/pulsar/deployments","created_at":"2016-06-28T07:00:03Z","updated_at":"2016-10-27T09:43:20Z","pushed_at":"2016-10-28T20:09:41Z","git_url":"git://github.com/yahoo/pulsar.git","ssh_url":"git@github.com:yahoo/pulsar.git","clone_url":"https://github.com/yahoo/pulsar.git","svn_url":"https://github.com/yahoo/pulsar","homepage":"","size":1967,"stargazers_count":1035,"watchers_count":1035,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":197,"mirror_url":null,"open_issues_count":14,"forks":197,"open_issues":14,"watchers":1035,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yahoo/pulsar/pulls/88"},"html":{"href":"https://github.com/yahoo/pulsar/pull/88"},"issue":{"href":"https://api.github.com/repos/yahoo/pulsar/issues/88"},"comments":{"href":"https://api.github.com/repos/yahoo/pulsar/issues/88/comments"},"review_comments":{"href":"https://api.github.com/repos/yahoo/pulsar/pulls/88/comments"},"review_comment":{"href":"https://api.github.com/repos/yahoo/pulsar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yahoo/pulsar/pulls/88/commits"},"statuses":{"href":"https://api.github.com/repos/yahoo/pulsar/statuses/35330408483daf951fb89ccd6e02f25954e9ff46"}}}}
{"actor":{"display_login":"sschepens"}}