{"action":"created","comment":{"url":"https://api.github.com/repos/flynn/flynn/pulls/comments/25118389","id":25118389,"diff_hunk":"@@ -0,0 +1,104 @@\n+package main\n+\n+import (\n+\t\"net\"\n+\t\"strings\"\n+\t\"testing\"\n+\t\"time\"\n+\n+\t. \"github.com/flynn/flynn/Godeps/_workspace/src/github.com/flynn/go-check\"\n+)\n+\n+// Hook gocheck up to the \"go test\" runner\n+func Test(t *testing.T) { TestingT(t) }\n+\n+type S struct {\n+}\n+\n+var _ = Suite(&S{})\n+\n+func (s *S) SetUpSuite(c *C) {\n+}\n+\n+func (s *S) TearDownSuite(c *C) {\n+}\n+\n+func (s *S) TearDownTest(c *C) {\n+}\n+\n+func newAggregator(c *C) *Aggregator {\n+\ta := NewAggregator(\"127.0.0.1:0\")\n+\tif err := a.Start(); err != nil {\n+\t\tc.Fatal(err)\n+\t}\n+\treturn a\n+}\n+\n+func (s *S) TestAggregatorListensOnAddr(c *C) {\n+\ta := newAggregator(c)\n+\tdefer a.Shutdown()\n+\n+\tparts := strings.Split(a.Addr, \":\")\n+\tip, port := parts[0], parts[1]","path":"logaggregator/main_test.go","position":42,"original_position":42,"commit_id":"e90397409c6410cd12a6117798858323e7608cc0","original_commit_id":"e90397409c6410cd12a6117798858323e7608cc0","user":{"login":"titanous","id":13026,"avatar_url":"https://avatars.githubusercontent.com/u/13026?v=3","gravatar_id":"","url":"https://api.github.com/users/titanous","html_url":"https://github.com/titanous","followers_url":"https://api.github.com/users/titanous/followers","following_url":"https://api.github.com/users/titanous/following{/other_user}","gists_url":"https://api.github.com/users/titanous/gists{/gist_id}","starred_url":"https://api.github.com/users/titanous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/titanous/subscriptions","organizations_url":"https://api.github.com/users/titanous/orgs","repos_url":"https://api.github.com/users/titanous/repos","events_url":"https://api.github.com/users/titanous/events{/privacy}","received_events_url":"https://api.github.com/users/titanous/received_events","type":"User","site_admin":false},"body":"Does `net.SplitHostPort` make sense?","created_at":"2015-02-21T02:39:17Z","updated_at":"2015-02-21T02:39:17Z","html_url":"https://github.com/flynn/flynn/pull/1040#discussion_r25118389","pull_request_url":"https://api.github.com/repos/flynn/flynn/pulls/1040","_links":{"self":{"href":"https://api.github.com/repos/flynn/flynn/pulls/comments/25118389"},"html":{"href":"https://github.com/flynn/flynn/pull/1040#discussion_r25118389"},"pull_request":{"href":"https://api.github.com/repos/flynn/flynn/pulls/1040"}}},"pull_request":{"url":"https://api.github.com/repos/flynn/flynn/pulls/1040","id":29744549,"html_url":"https://github.com/flynn/flynn/pull/1040","diff_url":"https://github.com/flynn/flynn/pull/1040.diff","patch_url":"https://github.com/flynn/flynn/pull/1040.patch","issue_url":"https://api.github.com/repos/flynn/flynn/issues/1040","number":1040,"state":"open","locked":false,"title":"logging: Add a log aggregator component","user":{"login":"bgentry","id":114033,"avatar_url":"https://avatars.githubusercontent.com/u/114033?v=3","gravatar_id":"","url":"https://api.github.com/users/bgentry","html_url":"https://github.com/bgentry","followers_url":"https://api.github.com/users/bgentry/followers","following_url":"https://api.github.com/users/bgentry/following{/other_user}","gists_url":"https://api.github.com/users/bgentry/gists{/gist_id}","starred_url":"https://api.github.com/users/bgentry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgentry/subscriptions","organizations_url":"https://api.github.com/users/bgentry/orgs","repos_url":"https://api.github.com/users/bgentry/repos","events_url":"https://api.github.com/users/bgentry/events{/privacy}","received_events_url":"https://api.github.com/users/bgentry/received_events","type":"User","site_admin":false},"body":"This is my first batch of progress on a log aggregator component. This component takes syslog-over-TCP input (RFC 6587 / RFC 5424), parses the messages, and buckets the logs into individual buffers based on the `AppName` field in the syslog header.\r\n\r\nBuffers currently have a fixed size of 10,000 log messages. I think I'd like to change this to be configurable and maybe make it work based on the number of bytes in the buffered messages, rather than be based on the count of the messages. It would probably be good if all buffers weren't pre-allocated with a slice of capacity 10,000.\r\n\r\nLogs will be sent to this aggregator by the “collectors” running on each instance, a component that @benburkert is working on.\r\n\r\nThe log aggregator will provide an API that the controller will use to fetch logs out of the buffer. It will also replicate the raw log stream to another aggregator for failover purposes. Eventually it should be able to drain logs for a given channel to syslog or HTTP destinations.\r\n\r\nAny comments on the direction of this at this early stage would be appreciated!","created_at":"2015-02-21T00:53:59Z","updated_at":"2015-02-21T02:39:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"87be5b817e028c626693c3cb505afab02adf7881","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/flynn/flynn/pulls/1040/commits","review_comments_url":"https://api.github.com/repos/flynn/flynn/pulls/1040/comments","review_comment_url":"https://api.github.com/repos/flynn/flynn/pulls/comments/{number}","comments_url":"https://api.github.com/repos/flynn/flynn/issues/1040/comments","statuses_url":"https://api.github.com/repos/flynn/flynn/statuses/e90397409c6410cd12a6117798858323e7608cc0","head":{"label":"flynn:log-aggregator","ref":"log-aggregator","sha":"e90397409c6410cd12a6117798858323e7608cc0","user":{"login":"flynn","id":4973613,"avatar_url":"https://avatars.githubusercontent.com/u/4973613?v=3","gravatar_id":"","url":"https://api.github.com/users/flynn","html_url":"https://github.com/flynn","followers_url":"https://api.github.com/users/flynn/followers","following_url":"https://api.github.com/users/flynn/following{/other_user}","gists_url":"https://api.github.com/users/flynn/gists{/gist_id}","starred_url":"https://api.github.com/users/flynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flynn/subscriptions","organizations_url":"https://api.github.com/users/flynn/orgs","repos_url":"https://api.github.com/users/flynn/repos","events_url":"https://api.github.com/users/flynn/events{/privacy}","received_events_url":"https://api.github.com/users/flynn/received_events","type":"Organization","site_admin":false},"repo":{"id":11290232,"name":"flynn","full_name":"flynn/flynn","owner":{"login":"flynn","id":4973613,"avatar_url":"https://avatars.githubusercontent.com/u/4973613?v=3","gravatar_id":"","url":"https://api.github.com/users/flynn","html_url":"https://github.com/flynn","followers_url":"https://api.github.com/users/flynn/followers","following_url":"https://api.github.com/users/flynn/following{/other_user}","gists_url":"https://api.github.com/users/flynn/gists{/gist_id}","starred_url":"https://api.github.com/users/flynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flynn/subscriptions","organizations_url":"https://api.github.com/users/flynn/orgs","repos_url":"https://api.github.com/users/flynn/repos","events_url":"https://api.github.com/users/flynn/events{/privacy}","received_events_url":"https://api.github.com/users/flynn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flynn/flynn","description":"A next generation open source platform as a service (PaaS)","fork":false,"url":"https://api.github.com/repos/flynn/flynn","forks_url":"https://api.github.com/repos/flynn/flynn/forks","keys_url":"https://api.github.com/repos/flynn/flynn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flynn/flynn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flynn/flynn/teams","hooks_url":"https://api.github.com/repos/flynn/flynn/hooks","issue_events_url":"https://api.github.com/repos/flynn/flynn/issues/events{/number}","events_url":"https://api.github.com/repos/flynn/flynn/events","assignees_url":"https://api.github.com/repos/flynn/flynn/assignees{/user}","branches_url":"https://api.github.com/repos/flynn/flynn/branches{/branch}","tags_url":"https://api.github.com/repos/flynn/flynn/tags","blobs_url":"https://api.github.com/repos/flynn/flynn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flynn/flynn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flynn/flynn/git/refs{/sha}","trees_url":"https://api.github.com/repos/flynn/flynn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flynn/flynn/statuses/{sha}","languages_url":"https://api.github.com/repos/flynn/flynn/languages","stargazers_url":"https://api.github.com/repos/flynn/flynn/stargazers","contributors_url":"https://api.github.com/repos/flynn/flynn/contributors","subscribers_url":"https://api.github.com/repos/flynn/flynn/subscribers","subscription_url":"https://api.github.com/repos/flynn/flynn/subscription","commits_url":"https://api.github.com/repos/flynn/flynn/commits{/sha}","git_commits_url":"https://api.github.com/repos/flynn/flynn/git/commits{/sha}","comments_url":"https://api.github.com/repos/flynn/flynn/comments{/number}","issue_comment_url":"https://api.github.com/repos/flynn/flynn/issues/comments/{number}","contents_url":"https://api.github.com/repos/flynn/flynn/contents/{+path}","compare_url":"https://api.github.com/repos/flynn/flynn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flynn/flynn/merges","archive_url":"https://api.github.com/repos/flynn/flynn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flynn/flynn/downloads","issues_url":"https://api.github.com/repos/flynn/flynn/issues{/number}","pulls_url":"https://api.github.com/repos/flynn/flynn/pulls{/number}","milestones_url":"https://api.github.com/repos/flynn/flynn/milestones{/number}","notifications_url":"https://api.github.com/repos/flynn/flynn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flynn/flynn/labels{/name}","releases_url":"https://api.github.com/repos/flynn/flynn/releases{/id}","created_at":"2013-07-09T18:22:06Z","updated_at":"2015-02-21T02:20:41Z","pushed_at":"2015-02-21T02:20:43Z","git_url":"git://github.com/flynn/flynn.git","ssh_url":"git@github.com:flynn/flynn.git","clone_url":"https://github.com/flynn/flynn.git","svn_url":"https://github.com/flynn/flynn","homepage":"https://flynn.io","size":39205,"stargazers_count":3259,"watchers_count":3259,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":212,"mirror_url":null,"open_issues_count":130,"forks":212,"open_issues":130,"watchers":3259,"default_branch":"master"}},"base":{"label":"flynn:staging-log-aggregation","ref":"staging-log-aggregation","sha":"d31652fb0ead484d7521c1c116588b189021d20c","user":{"login":"flynn","id":4973613,"avatar_url":"https://avatars.githubusercontent.com/u/4973613?v=3","gravatar_id":"","url":"https://api.github.com/users/flynn","html_url":"https://github.com/flynn","followers_url":"https://api.github.com/users/flynn/followers","following_url":"https://api.github.com/users/flynn/following{/other_user}","gists_url":"https://api.github.com/users/flynn/gists{/gist_id}","starred_url":"https://api.github.com/users/flynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flynn/subscriptions","organizations_url":"https://api.github.com/users/flynn/orgs","repos_url":"https://api.github.com/users/flynn/repos","events_url":"https://api.github.com/users/flynn/events{/privacy}","received_events_url":"https://api.github.com/users/flynn/received_events","type":"Organization","site_admin":false},"repo":{"id":11290232,"name":"flynn","full_name":"flynn/flynn","owner":{"login":"flynn","id":4973613,"avatar_url":"https://avatars.githubusercontent.com/u/4973613?v=3","gravatar_id":"","url":"https://api.github.com/users/flynn","html_url":"https://github.com/flynn","followers_url":"https://api.github.com/users/flynn/followers","following_url":"https://api.github.com/users/flynn/following{/other_user}","gists_url":"https://api.github.com/users/flynn/gists{/gist_id}","starred_url":"https://api.github.com/users/flynn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flynn/subscriptions","organizations_url":"https://api.github.com/users/flynn/orgs","repos_url":"https://api.github.com/users/flynn/repos","events_url":"https://api.github.com/users/flynn/events{/privacy}","received_events_url":"https://api.github.com/users/flynn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/flynn/flynn","description":"A next generation open source platform as a service (PaaS)","fork":false,"url":"https://api.github.com/repos/flynn/flynn","forks_url":"https://api.github.com/repos/flynn/flynn/forks","keys_url":"https://api.github.com/repos/flynn/flynn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flynn/flynn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flynn/flynn/teams","hooks_url":"https://api.github.com/repos/flynn/flynn/hooks","issue_events_url":"https://api.github.com/repos/flynn/flynn/issues/events{/number}","events_url":"https://api.github.com/repos/flynn/flynn/events","assignees_url":"https://api.github.com/repos/flynn/flynn/assignees{/user}","branches_url":"https://api.github.com/repos/flynn/flynn/branches{/branch}","tags_url":"https://api.github.com/repos/flynn/flynn/tags","blobs_url":"https://api.github.com/repos/flynn/flynn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flynn/flynn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flynn/flynn/git/refs{/sha}","trees_url":"https://api.github.com/repos/flynn/flynn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flynn/flynn/statuses/{sha}","languages_url":"https://api.github.com/repos/flynn/flynn/languages","stargazers_url":"https://api.github.com/repos/flynn/flynn/stargazers","contributors_url":"https://api.github.com/repos/flynn/flynn/contributors","subscribers_url":"https://api.github.com/repos/flynn/flynn/subscribers","subscription_url":"https://api.github.com/repos/flynn/flynn/subscription","commits_url":"https://api.github.com/repos/flynn/flynn/commits{/sha}","git_commits_url":"https://api.github.com/repos/flynn/flynn/git/commits{/sha}","comments_url":"https://api.github.com/repos/flynn/flynn/comments{/number}","issue_comment_url":"https://api.github.com/repos/flynn/flynn/issues/comments/{number}","contents_url":"https://api.github.com/repos/flynn/flynn/contents/{+path}","compare_url":"https://api.github.com/repos/flynn/flynn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flynn/flynn/merges","archive_url":"https://api.github.com/repos/flynn/flynn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flynn/flynn/downloads","issues_url":"https://api.github.com/repos/flynn/flynn/issues{/number}","pulls_url":"https://api.github.com/repos/flynn/flynn/pulls{/number}","milestones_url":"https://api.github.com/repos/flynn/flynn/milestones{/number}","notifications_url":"https://api.github.com/repos/flynn/flynn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flynn/flynn/labels{/name}","releases_url":"https://api.github.com/repos/flynn/flynn/releases{/id}","created_at":"2013-07-09T18:22:06Z","updated_at":"2015-02-21T02:20:41Z","pushed_at":"2015-02-21T02:20:43Z","git_url":"git://github.com/flynn/flynn.git","ssh_url":"git@github.com:flynn/flynn.git","clone_url":"https://github.com/flynn/flynn.git","svn_url":"https://github.com/flynn/flynn","homepage":"https://flynn.io","size":39205,"stargazers_count":3259,"watchers_count":3259,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":212,"mirror_url":null,"open_issues_count":130,"forks":212,"open_issues":130,"watchers":3259,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/flynn/flynn/pulls/1040"},"html":{"href":"https://github.com/flynn/flynn/pull/1040"},"issue":{"href":"https://api.github.com/repos/flynn/flynn/issues/1040"},"comments":{"href":"https://api.github.com/repos/flynn/flynn/issues/1040/comments"},"review_comments":{"href":"https://api.github.com/repos/flynn/flynn/pulls/1040/comments"},"review_comment":{"href":"https://api.github.com/repos/flynn/flynn/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/flynn/flynn/pulls/1040/commits"},"statuses":{"href":"https://api.github.com/repos/flynn/flynn/statuses/e90397409c6410cd12a6117798858323e7608cc0"}}}}