{"action":"created","comment":{"url":"https://api.github.com/repos/influxdata/telegraf/pulls/comments/54231963","id":54231963,"diff_hunk":"@@ -0,0 +1,139 @@\n+package udp_line_protocol\n+\n+import (\n+\t\"github.com/influxdata/telegraf\"\n+\t\"github.com/influxdata/telegraf/plugins/inputs\"\n+\t\"github.com/influxdata/telegraf/plugins/parsers\"\n+\t\"log\"\n+\t\"net\"\n+\t\"sync\"\n+)\n+\n+type UdpLineProtocol struct {\n+\tServiceAddress         string\n+\tUDPPacketSize          int `toml:\"udp_packet_size\"`\n+\tAllowedPendingMessages int\n+\tsync.Mutex\n+\n+\tin         chan []byte\n+\tdone       chan struct{}\n+\tmetricsAcc []telegraf.Metric\n+}\n+\n+const UDP_PACKET_SIZE int = 1500\n+\n+var dropwarn = \"ERROR: Message queue full. Discarding line [%s] \" +\n+\t\"You may want to increase allowed_pending_messages in the config\\n\"\n+\n+const sampleConfig = `\n+  ## Address and port to host UDP listener on\n+  service_address = \":8125\"\n+\n+  ## Number of UDP messages allowed to queue up, once filled,\n+  ## the statsd server will start dropping packets\n+  allowed_pending_messages = 10000\n+\n+  ## UDP packet size for the server to listen for. This will depend on the size\n+  ## of the packets that the client is sending, which is usually 1500 bytes.\n+  udp_packet_size = 1500\n+`\n+\n+func (u *UdpLineProtocol) SampleConfig() string {\n+\treturn sampleConfig\n+}\n+\n+func (u *UdpLineProtocol) Description() string {\n+\treturn \"Read metrics from one or more commands that can output to stdout\"\n+}\n+\n+func (u *UdpLineProtocol) Start(_ telegraf.Accumulator) error {","path":"plugins/inputs/udp_line_protocol/udp_line_protocol.go","position":49,"original_position":49,"commit_id":"d793f169ba721e8b27818c897318f6b76880ac37","original_commit_id":"d793f169ba721e8b27818c897318f6b76880ac37","user":{"login":"sparrc","id":7155926,"avatar_url":"https://avatars.githubusercontent.com/u/7155926?v=3","gravatar_id":"","url":"https://api.github.com/users/sparrc","html_url":"https://github.com/sparrc","followers_url":"https://api.github.com/users/sparrc/followers","following_url":"https://api.github.com/users/sparrc/following{/other_user}","gists_url":"https://api.github.com/users/sparrc/gists{/gist_id}","starred_url":"https://api.github.com/users/sparrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sparrc/subscriptions","organizations_url":"https://api.github.com/users/sparrc/orgs","repos_url":"https://api.github.com/users/sparrc/repos","events_url":"https://api.github.com/users/sparrc/events{/privacy}","received_events_url":"https://api.github.com/users/sparrc/received_events","type":"User","site_admin":false},"body":"lock/unlock the start function","created_at":"2016-02-26T11:22:02Z","updated_at":"2016-02-26T11:22:02Z","html_url":"https://github.com/influxdata/telegraf/pull/758#discussion_r54231963","pull_request_url":"https://api.github.com/repos/influxdata/telegraf/pulls/758","_links":{"self":{"href":"https://api.github.com/repos/influxdata/telegraf/pulls/comments/54231963"},"html":{"href":"https://github.com/influxdata/telegraf/pull/758#discussion_r54231963"},"pull_request":{"href":"https://api.github.com/repos/influxdata/telegraf/pulls/758"}}},"pull_request":{"url":"https://api.github.com/repos/influxdata/telegraf/pulls/758","id":60701536,"html_url":"https://github.com/influxdata/telegraf/pull/758","diff_url":"https://github.com/influxdata/telegraf/pull/758.diff","patch_url":"https://github.com/influxdata/telegraf/pull/758.patch","issue_url":"https://api.github.com/repos/influxdata/telegraf/issues/758","number":758,"state":"open","locked":false,"title":"Add generic UDP line-protocol service input","user":{"login":"whatyouhide","id":3890250,"avatar_url":"https://avatars.githubusercontent.com/u/3890250?v=3","gravatar_id":"","url":"https://api.github.com/users/whatyouhide","html_url":"https://github.com/whatyouhide","followers_url":"https://api.github.com/users/whatyouhide/followers","following_url":"https://api.github.com/users/whatyouhide/following{/other_user}","gists_url":"https://api.github.com/users/whatyouhide/gists{/gist_id}","starred_url":"https://api.github.com/users/whatyouhide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whatyouhide/subscriptions","organizations_url":"https://api.github.com/users/whatyouhide/orgs","repos_url":"https://api.github.com/users/whatyouhide/repos","events_url":"https://api.github.com/users/whatyouhide/events{/privacy}","received_events_url":"https://api.github.com/users/whatyouhide/received_events","type":"User","site_admin":false},"body":"@lexmag and I added the UDP line-protocol service input discussed in #481. The PR fully implements the UDP service input but is still lacking tests and a README; we're working on both but we would like some feedback on the current implementation :).","created_at":"2016-02-25T16:02:08Z","updated_at":"2016-02-26T11:22:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e282d04ecc1b41b4046b73852e201b324994eb12","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/influxdata/telegraf/pulls/758/commits","review_comments_url":"https://api.github.com/repos/influxdata/telegraf/pulls/758/comments","review_comment_url":"https://api.github.com/repos/influxdata/telegraf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/influxdata/telegraf/issues/758/comments","statuses_url":"https://api.github.com/repos/influxdata/telegraf/statuses/d793f169ba721e8b27818c897318f6b76880ac37","head":{"label":"whatyouhide:udp-line-protocol","ref":"udp-line-protocol","sha":"d793f169ba721e8b27818c897318f6b76880ac37","user":{"login":"whatyouhide","id":3890250,"avatar_url":"https://avatars.githubusercontent.com/u/3890250?v=3","gravatar_id":"","url":"https://api.github.com/users/whatyouhide","html_url":"https://github.com/whatyouhide","followers_url":"https://api.github.com/users/whatyouhide/followers","following_url":"https://api.github.com/users/whatyouhide/following{/other_user}","gists_url":"https://api.github.com/users/whatyouhide/gists{/gist_id}","starred_url":"https://api.github.com/users/whatyouhide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whatyouhide/subscriptions","organizations_url":"https://api.github.com/users/whatyouhide/orgs","repos_url":"https://api.github.com/users/whatyouhide/repos","events_url":"https://api.github.com/users/whatyouhide/events{/privacy}","received_events_url":"https://api.github.com/users/whatyouhide/received_events","type":"User","site_admin":false},"repo":{"id":52524588,"name":"telegraf","full_name":"whatyouhide/telegraf","owner":{"login":"whatyouhide","id":3890250,"avatar_url":"https://avatars.githubusercontent.com/u/3890250?v=3","gravatar_id":"","url":"https://api.github.com/users/whatyouhide","html_url":"https://github.com/whatyouhide","followers_url":"https://api.github.com/users/whatyouhide/followers","following_url":"https://api.github.com/users/whatyouhide/following{/other_user}","gists_url":"https://api.github.com/users/whatyouhide/gists{/gist_id}","starred_url":"https://api.github.com/users/whatyouhide/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whatyouhide/subscriptions","organizations_url":"https://api.github.com/users/whatyouhide/orgs","repos_url":"https://api.github.com/users/whatyouhide/repos","events_url":"https://api.github.com/users/whatyouhide/events{/privacy}","received_events_url":"https://api.github.com/users/whatyouhide/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/whatyouhide/telegraf","description":"The plugin-driven server agent for collecting & reporting metrics.","fork":true,"url":"https://api.github.com/repos/whatyouhide/telegraf","forks_url":"https://api.github.com/repos/whatyouhide/telegraf/forks","keys_url":"https://api.github.com/repos/whatyouhide/telegraf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/whatyouhide/telegraf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/whatyouhide/telegraf/teams","hooks_url":"https://api.github.com/repos/whatyouhide/telegraf/hooks","issue_events_url":"https://api.github.com/repos/whatyouhide/telegraf/issues/events{/number}","events_url":"https://api.github.com/repos/whatyouhide/telegraf/events","assignees_url":"https://api.github.com/repos/whatyouhide/telegraf/assignees{/user}","branches_url":"https://api.github.com/repos/whatyouhide/telegraf/branches{/branch}","tags_url":"https://api.github.com/repos/whatyouhide/telegraf/tags","blobs_url":"https://api.github.com/repos/whatyouhide/telegraf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/whatyouhide/telegraf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/whatyouhide/telegraf/git/refs{/sha}","trees_url":"https://api.github.com/repos/whatyouhide/telegraf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/whatyouhide/telegraf/statuses/{sha}","languages_url":"https://api.github.com/repos/whatyouhide/telegraf/languages","stargazers_url":"https://api.github.com/repos/whatyouhide/telegraf/stargazers","contributors_url":"https://api.github.com/repos/whatyouhide/telegraf/contributors","subscribers_url":"https://api.github.com/repos/whatyouhide/telegraf/subscribers","subscription_url":"https://api.github.com/repos/whatyouhide/telegraf/subscription","commits_url":"https://api.github.com/repos/whatyouhide/telegraf/commits{/sha}","git_commits_url":"https://api.github.com/repos/whatyouhide/telegraf/git/commits{/sha}","comments_url":"https://api.github.com/repos/whatyouhide/telegraf/comments{/number}","issue_comment_url":"https://api.github.com/repos/whatyouhide/telegraf/issues/comments{/number}","contents_url":"https://api.github.com/repos/whatyouhide/telegraf/contents/{+path}","compare_url":"https://api.github.com/repos/whatyouhide/telegraf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/whatyouhide/telegraf/merges","archive_url":"https://api.github.com/repos/whatyouhide/telegraf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/whatyouhide/telegraf/downloads","issues_url":"https://api.github.com/repos/whatyouhide/telegraf/issues{/number}","pulls_url":"https://api.github.com/repos/whatyouhide/telegraf/pulls{/number}","milestones_url":"https://api.github.com/repos/whatyouhide/telegraf/milestones{/number}","notifications_url":"https://api.github.com/repos/whatyouhide/telegraf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/whatyouhide/telegraf/labels{/name}","releases_url":"https://api.github.com/repos/whatyouhide/telegraf/releases{/id}","deployments_url":"https://api.github.com/repos/whatyouhide/telegraf/deployments","created_at":"2016-02-25T13:01:15Z","updated_at":"2016-02-25T13:01:18Z","pushed_at":"2016-02-25T16:20:04Z","git_url":"git://github.com/whatyouhide/telegraf.git","ssh_url":"git@github.com:whatyouhide/telegraf.git","clone_url":"https://github.com/whatyouhide/telegraf.git","svn_url":"https://github.com/whatyouhide/telegraf","homepage":"","size":9565,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"influxdata:master","ref":"master","sha":"664816383ad2601f3a8511b991634fa45cd4dc60","user":{"login":"influxdata","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdata","html_url":"https://github.com/influxdata","followers_url":"https://api.github.com/users/influxdata/followers","following_url":"https://api.github.com/users/influxdata/following{/other_user}","gists_url":"https://api.github.com/users/influxdata/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdata/subscriptions","organizations_url":"https://api.github.com/users/influxdata/orgs","repos_url":"https://api.github.com/users/influxdata/repos","events_url":"https://api.github.com/users/influxdata/events{/privacy}","received_events_url":"https://api.github.com/users/influxdata/received_events","type":"Organization","site_admin":false},"repo":{"id":33258973,"name":"telegraf","full_name":"influxdata/telegraf","owner":{"login":"influxdata","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdata","html_url":"https://github.com/influxdata","followers_url":"https://api.github.com/users/influxdata/followers","following_url":"https://api.github.com/users/influxdata/following{/other_user}","gists_url":"https://api.github.com/users/influxdata/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdata/subscriptions","organizations_url":"https://api.github.com/users/influxdata/orgs","repos_url":"https://api.github.com/users/influxdata/repos","events_url":"https://api.github.com/users/influxdata/events{/privacy}","received_events_url":"https://api.github.com/users/influxdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influxdata/telegraf","description":"The plugin-driven server agent for collecting & reporting metrics.","fork":false,"url":"https://api.github.com/repos/influxdata/telegraf","forks_url":"https://api.github.com/repos/influxdata/telegraf/forks","keys_url":"https://api.github.com/repos/influxdata/telegraf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influxdata/telegraf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influxdata/telegraf/teams","hooks_url":"https://api.github.com/repos/influxdata/telegraf/hooks","issue_events_url":"https://api.github.com/repos/influxdata/telegraf/issues/events{/number}","events_url":"https://api.github.com/repos/influxdata/telegraf/events","assignees_url":"https://api.github.com/repos/influxdata/telegraf/assignees{/user}","branches_url":"https://api.github.com/repos/influxdata/telegraf/branches{/branch}","tags_url":"https://api.github.com/repos/influxdata/telegraf/tags","blobs_url":"https://api.github.com/repos/influxdata/telegraf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influxdata/telegraf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influxdata/telegraf/git/refs{/sha}","trees_url":"https://api.github.com/repos/influxdata/telegraf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influxdata/telegraf/statuses/{sha}","languages_url":"https://api.github.com/repos/influxdata/telegraf/languages","stargazers_url":"https://api.github.com/repos/influxdata/telegraf/stargazers","contributors_url":"https://api.github.com/repos/influxdata/telegraf/contributors","subscribers_url":"https://api.github.com/repos/influxdata/telegraf/subscribers","subscription_url":"https://api.github.com/repos/influxdata/telegraf/subscription","commits_url":"https://api.github.com/repos/influxdata/telegraf/commits{/sha}","git_commits_url":"https://api.github.com/repos/influxdata/telegraf/git/commits{/sha}","comments_url":"https://api.github.com/repos/influxdata/telegraf/comments{/number}","issue_comment_url":"https://api.github.com/repos/influxdata/telegraf/issues/comments{/number}","contents_url":"https://api.github.com/repos/influxdata/telegraf/contents/{+path}","compare_url":"https://api.github.com/repos/influxdata/telegraf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influxdata/telegraf/merges","archive_url":"https://api.github.com/repos/influxdata/telegraf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influxdata/telegraf/downloads","issues_url":"https://api.github.com/repos/influxdata/telegraf/issues{/number}","pulls_url":"https://api.github.com/repos/influxdata/telegraf/pulls{/number}","milestones_url":"https://api.github.com/repos/influxdata/telegraf/milestones{/number}","notifications_url":"https://api.github.com/repos/influxdata/telegraf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influxdata/telegraf/labels{/name}","releases_url":"https://api.github.com/repos/influxdata/telegraf/releases{/id}","deployments_url":"https://api.github.com/repos/influxdata/telegraf/deployments","created_at":"2015-04-01T16:28:44Z","updated_at":"2016-02-26T09:35:07Z","pushed_at":"2016-02-25T22:39:48Z","git_url":"git://github.com/influxdata/telegraf.git","ssh_url":"git@github.com:influxdata/telegraf.git","clone_url":"https://github.com/influxdata/telegraf.git","svn_url":"https://github.com/influxdata/telegraf","homepage":"","size":10585,"stargazers_count":984,"watchers_count":984,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":256,"mirror_url":null,"open_issues_count":85,"forks":256,"open_issues":85,"watchers":984,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/influxdata/telegraf/pulls/758"},"html":{"href":"https://github.com/influxdata/telegraf/pull/758"},"issue":{"href":"https://api.github.com/repos/influxdata/telegraf/issues/758"},"comments":{"href":"https://api.github.com/repos/influxdata/telegraf/issues/758/comments"},"review_comments":{"href":"https://api.github.com/repos/influxdata/telegraf/pulls/758/comments"},"review_comment":{"href":"https://api.github.com/repos/influxdata/telegraf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/influxdata/telegraf/pulls/758/commits"},"statuses":{"href":"https://api.github.com/repos/influxdata/telegraf/statuses/d793f169ba721e8b27818c897318f6b76880ac37"}}}}