GitHub PullRequestReviewCommentEvent at 2014-06-26 21:38:03
Repository: incubator-storm
Actor: revans2
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-storm/pulls/comments/14268407","id":14268407,"diff_hunk":"@@ -0,0 +1,197 @@\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+package backtype.storm.command;\n+\n+import backtype.storm.generated.*;\n+import backtype.storm.utils.NimbusClient;\n+import backtype.storm.utils.Utils;\n+import org.kohsuke.args4j.CmdLineException;\n+import org.kohsuke.args4j.CmdLineParser;\n+import org.kohsuke.args4j.Option;\n+\n+import java.util.Map;\n+\n+public class Monitor {\n+    @Option(name=\"--help\", aliases={\"-h\"}, usage=\"print help message\")\n+    private boolean _help = false;\n+\n+    @Option(name=\"--interval\", aliases={\"-i\"}, usage=\"poll frequency in seconds\")\n+    private int _interval = 4;\n+\n+    @Option(name=\"--name\", aliases={\"--topologyName\"}, metaVar=\"NAME\",\n+            usage=\"base name of the topology (numbers may be appended to the end)\")\n+    private String _name;\n+\n+    @Option(name=\"--component\", aliases={\"--componentName\"}, metaVar=\"NAME\",\n+            usage=\"component name of the topology\")\n+    private String _component;\n+\n+    @Option(name=\"--stat\", aliases={\"--statItem\"}, metaVar=\"ITEM\",\n+            usage=\"stat item [emitted | transferred]\")\n+    private String _stat = \"emitted\";\n+\n+    private static class MetricsState {\n+        long lastStatted = 0;\n+        long lastTime = 0;\n+    }\n+\n+    public void metrics(Nimbus.Client client, int poll, String name, String component, String stat) throws Exception {\n+        System.out.println(\"status\\ttopologie\\tslots\\tcomponent\\texecutors\\texecutorsWithMetrics\\ttime-diff ms\\t\" + stat + \"\\tthroughput (Kt/s)\");\n+        MetricsState state = new MetricsState();\n+        long pollMs = poll * 1000;\n+        long now = System.currentTimeMillis();\n+        state.lastTime = now;\n+        long startTime = now;\n+        long cycle, sleepTime, wakeupTime;\n+\n+        while (metrics(client, name, component, stat, now, state, \"WAITING\")) {","path":"storm-core/src/jvm/backtype/storm/command/Monitor.java","position":62,"original_position":62,"commit_id":"edcaf71b304cc5196eec48035b06d15aaa8df433","original_commit_id":"edcaf71b304cc5196eec48035b06d15aaa8df433","user":{"login":"revans2","id":3441321,"avatar_url":"https://avatars.githubusercontent.com/u/3441321?","gravatar_id":"051e717d11e9844cadf30dd543f9b6e2","url":"https://api.github.com/users/revans2","html_url":"https://github.com/revans2","followers_url":"https://api.github.com/users/revans2/followers","following_url":"https://api.github.com/users/revans2/following{/other_user}","gists_url":"https://api.github.com/users/revans2/gists{/gist_id}","starred_url":"https://api.github.com/users/revans2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/revans2/subscriptions","organizations_url":"https://api.github.com/users/revans2/orgs","repos_url":"https://api.github.com/users/revans2/repos","events_url":"https://api.github.com/users/revans2/events{/privacy}","received_events_url":"https://api.github.com/users/revans2/received_events","type":"User","site_admin":false},"body":"Previously the \"WAITING\" was intended to wait for the topology to be fully up before we started to collect metrics on it because it was used as a benchmark. I am not sure that it is needed just for displaying the current status.  ","created_at":"2014-06-26T21:38:03Z","updated_at":"2014-06-26T21:38:03Z","html_url":"https://github.com/apache/incubator-storm/pull/117#discussion_r14268407","pull_request_url":"https://api.github.com/repos/apache/incubator-storm/pulls/117","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-storm/pulls/comments/14268407"},"html":{"href":"https://github.com/apache/incubator-storm/pull/117#discussion_r14268407"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-storm/pulls/117"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-storm/pulls/117","id":15974142,"html_url":"https://github.com/apache/incubator-storm/pull/117","diff_url":"https://github.com/apache/incubator-storm/pull/117.diff","patch_url":"https://github.com/apache/incubator-storm/pull/117.patch","issue_url":"https://api.github.com/repos/apache/incubator-storm/issues/117","number":117,"state":"open","title":"STORM-312 : add storm monitor tools to monitor throughtput interactively","user":{"login":"Gvain","id":3352351,"avatar_url":"https://avatars.githubusercontent.com/u/3352351?","gravatar_id":"3d756d4019f91ab8dfd76517a3277cdf","url":"https://api.github.com/users/Gvain","html_url":"https://github.com/Gvain","followers_url":"https://api.github.com/users/Gvain/followers","following_url":"https://api.github.com/users/Gvain/following{/other_user}","gists_url":"https://api.github.com/users/Gvain/gists{/gist_id}","starred_url":"https://api.github.com/users/Gvain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gvain/subscriptions","organizations_url":"https://api.github.com/users/Gvain/orgs","repos_url":"https://api.github.com/users/Gvain/repos","events_url":"https://api.github.com/users/Gvain/events{/privacy}","received_events_url":"https://api.github.com/users/Gvain/received_events","type":"User","site_admin":false},"body":"This cmd line tool 'storm monitor' will use Nimbus.Client to get throughput information from Nimbus Server.\r\n1)One can specify topology's name, component's name to monitor it's throughput interactively.\r\n2) It will statistics 'emit' or 'transferred' throughput in a given time window and print it in a given time frequency\r\nThe implementation will be much like yahoo's storm-perf-test (http://yahooeng.tumblr.com/post/64758709722/making-storm-fly-with-netty)","created_at":"2014-05-16T07:18:05Z","updated_at":"2014-06-26T21:38:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4366596ad9949cc49bd00d0c69989c5ca518d5dd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-storm/pulls/117/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-storm/pulls/117/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-storm/pulls/comments/{number}","comments_url":"https://api.github.com/repos/apache/incubator-storm/issues/117/comments","statuses_url":"https://api.github.com/repos/apache/incubator-storm/statuses/edcaf71b304cc5196eec48035b06d15aaa8df433","head":{"label":"Gvain:storm-monitor-cmd","ref":"storm-monitor-cmd","sha":"edcaf71b304cc5196eec48035b06d15aaa8df433","user":{"login":"Gvain","id":3352351,"avatar_url":"https://avatars.githubusercontent.com/u/3352351?","gravatar_id":"3d756d4019f91ab8dfd76517a3277cdf","url":"https://api.github.com/users/Gvain","html_url":"https://github.com/Gvain","followers_url":"https://api.github.com/users/Gvain/followers","following_url":"https://api.github.com/users/Gvain/following{/other_user}","gists_url":"https://api.github.com/users/Gvain/gists{/gist_id}","starred_url":"https://api.github.com/users/Gvain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gvain/subscriptions","organizations_url":"https://api.github.com/users/Gvain/orgs","repos_url":"https://api.github.com/users/Gvain/repos","events_url":"https://api.github.com/users/Gvain/events{/privacy}","received_events_url":"https://api.github.com/users/Gvain/received_events","type":"User","site_admin":false},"repo":{"id":16176567,"name":"incubator-storm","full_name":"Gvain/incubator-storm","owner":{"login":"Gvain","id":3352351,"avatar_url":"https://avatars.githubusercontent.com/u/3352351?","gravatar_id":"3d756d4019f91ab8dfd76517a3277cdf","url":"https://api.github.com/users/Gvain","html_url":"https://github.com/Gvain","followers_url":"https://api.github.com/users/Gvain/followers","following_url":"https://api.github.com/users/Gvain/following{/other_user}","gists_url":"https://api.github.com/users/Gvain/gists{/gist_id}","starred_url":"https://api.github.com/users/Gvain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gvain/subscriptions","organizations_url":"https://api.github.com/users/Gvain/orgs","repos_url":"https://api.github.com/users/Gvain/repos","events_url":"https://api.github.com/users/Gvain/events{/privacy}","received_events_url":"https://api.github.com/users/Gvain/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Gvain/incubator-storm","description":"Mirror of Apache Storm","fork":true,"url":"https://api.github.com/repos/Gvain/incubator-storm","forks_url":"https://api.github.com/repos/Gvain/incubator-storm/forks","keys_url":"https://api.github.com/repos/Gvain/incubator-storm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Gvain/incubator-storm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Gvain/incubator-storm/teams","hooks_url":"https://api.github.com/repos/Gvain/incubator-storm/hooks","issue_events_url":"https://api.github.com/repos/Gvain/incubator-storm/issues/events{/number}","events_url":"https://api.github.com/repos/Gvain/incubator-storm/events","assignees_url":"https://api.github.com/repos/Gvain/incubator-storm/assignees{/user}","branches_url":"https://api.github.com/repos/Gvain/incubator-storm/branches{/branch}","tags_url":"https://api.github.com/repos/Gvain/incubator-storm/tags","blobs_url":"https://api.github.com/repos/Gvain/incubator-storm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Gvain/incubator-storm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Gvain/incubator-storm/git/refs{/sha}","trees_url":"https://api.github.com/repos/Gvain/incubator-storm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Gvain/incubator-storm/statuses/{sha}","languages_url":"https://api.github.com/repos/Gvain/incubator-storm/languages","stargazers_url":"https://api.github.com/repos/Gvain/incubator-storm/stargazers","contributors_url":"https://api.github.com/repos/Gvain/incubator-storm/contributors","subscribers_url":"https://api.github.com/repos/Gvain/incubator-storm/subscribers","subscription_url":"https://api.github.com/repos/Gvain/incubator-storm/subscription","commits_url":"https://api.github.com/repos/Gvain/incubator-storm/commits{/sha}","git_commits_url":"https://api.github.com/repos/Gvain/incubator-storm/git/commits{/sha}","comments_url":"https://api.github.com/repos/Gvain/incubator-storm/comments{/number}","issue_comment_url":"https://api.github.com/repos/Gvain/incubator-storm/issues/comments/{number}","contents_url":"https://api.github.com/repos/Gvain/incubator-storm/contents/{+path}","compare_url":"https://api.github.com/repos/Gvain/incubator-storm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Gvain/incubator-storm/merges","archive_url":"https://api.github.com/repos/Gvain/incubator-storm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Gvain/incubator-storm/downloads","issues_url":"https://api.github.com/repos/Gvain/incubator-storm/issues{/number}","pulls_url":"https://api.github.com/repos/Gvain/incubator-storm/pulls{/number}","milestones_url":"https://api.github.com/repos/Gvain/incubator-storm/milestones{/number}","notifications_url":"https://api.github.com/repos/Gvain/incubator-storm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Gvain/incubator-storm/labels{/name}","releases_url":"https://api.github.com/repos/Gvain/incubator-storm/releases{/id}","created_at":"2014-01-23T15:35:37Z","updated_at":"2014-05-16T07:18:05Z","pushed_at":"2014-05-16T07:14:52Z","git_url":"git://github.com/Gvain/incubator-storm.git","ssh_url":"git@github.com:Gvain/incubator-storm.git","clone_url":"https://github.com/Gvain/incubator-storm.git","svn_url":"https://github.com/Gvain/incubator-storm","homepage":null,"size":10215,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"222c72502d57d37f0b2ee9a63f2765039205bbaf","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?","gravatar_id":"a676c0bf448fcd49f588249ead719b4c","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":14135470,"name":"incubator-storm","full_name":"apache/incubator-storm","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?","gravatar_id":"a676c0bf448fcd49f588249ead719b4c","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/incubator-storm","description":"Mirror of Apache Storm","fork":false,"url":"https://api.github.com/repos/apache/incubator-storm","forks_url":"https://api.github.com/repos/apache/incubator-storm/forks","keys_url":"https://api.github.com/repos/apache/incubator-storm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-storm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-storm/teams","hooks_url":"https://api.github.com/repos/apache/incubator-storm/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-storm/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-storm/events","assignees_url":"https://api.github.com/repos/apache/incubator-storm/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-storm/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-storm/tags","blobs_url":"https://api.github.com/repos/apache/incubator-storm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-storm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-storm/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-storm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-storm/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-storm/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-storm/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-storm/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-storm/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-storm/subscription","commits_url":"https://api.github.com/repos/apache/incubator-storm/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-storm/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-storm/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-storm/issues/comments/{number}","contents_url":"https://api.github.com/repos/apache/incubator-storm/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-storm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-storm/merges","archive_url":"https://api.github.com/repos/apache/incubator-storm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-storm/downloads","issues_url":"https://api.github.com/repos/apache/incubator-storm/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-storm/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-storm/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-storm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-storm/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-storm/releases{/id}","created_at":"2013-11-05T08:00:14Z","updated_at":"2014-06-26T19:39:57Z","pushed_at":"2014-06-26T21:10:13Z","git_url":"git://github.com/apache/incubator-storm.git","ssh_url":"git@github.com:apache/incubator-storm.git","clone_url":"https://github.com/apache/incubator-storm.git","svn_url":"https://github.com/apache/incubator-storm","homepage":null,"size":2629901,"stargazers_count":682,"watchers_count":682,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"forks_count":363,"mirror_url":"git://git.apache.org/incubator-storm.git","open_issues_count":33,"forks":363,"open_issues":33,"watchers":682,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-storm/pulls/117"},"html":{"href":"https://github.com/apache/incubator-storm/pull/117"},"issue":{"href":"https://api.github.com/repos/apache/incubator-storm/issues/117"},"comments":{"href":"https://api.github.com/repos/apache/incubator-storm/issues/117/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-storm/pulls/117/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-storm/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-storm/pulls/117/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-storm/statuses/edcaf71b304cc5196eec48035b06d15aaa8df433"}}}}