{"action":"created","issue":{"url":"https://api.github.com/repos/Banno/metrics/issues/1","labels_url":"https://api.github.com/repos/Banno/metrics/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/Banno/metrics/issues/1/comments","events_url":"https://api.github.com/repos/Banno/metrics/issues/1/events","html_url":"https://github.com/Banno/metrics/pull/1","id":98275455,"number":1,"title":"Create a new socket each time we report to graphite.","user":{"login":"adamdecaf","id":120951,"avatar_url":"https://avatars.githubusercontent.com/u/120951?v=3","gravatar_id":"","url":"https://api.github.com/users/adamdecaf","html_url":"https://github.com/adamdecaf","followers_url":"https://api.github.com/users/adamdecaf/followers","following_url":"https://api.github.com/users/adamdecaf/following{/other_user}","gists_url":"https://api.github.com/users/adamdecaf/gists{/gist_id}","starred_url":"https://api.github.com/users/adamdecaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamdecaf/subscriptions","organizations_url":"https://api.github.com/users/adamdecaf/orgs","repos_url":"https://api.github.com/users/adamdecaf/repos","events_url":"https://api.github.com/users/adamdecaf/events{/privacy}","received_events_url":"https://api.github.com/users/adamdecaf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-30T22:05:01Z","updated_at":"2015-07-31T12:55:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Banno/metrics/pulls/1","html_url":"https://github.com/Banno/metrics/pull/1","diff_url":"https://github.com/Banno/metrics/pull/1.diff","patch_url":"https://github.com/Banno/metrics/pull/1.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/Banno/metrics/issues/comments/126682075","html_url":"https://github.com/Banno/metrics/pull/1#issuecomment-126682075","issue_url":"https://api.github.com/repos/Banno/metrics/issues/1","id":126682075,"user":{"login":"zcox","id":145250,"avatar_url":"https://avatars.githubusercontent.com/u/145250?v=3","gravatar_id":"","url":"https://api.github.com/users/zcox","html_url":"https://github.com/zcox","followers_url":"https://api.github.com/users/zcox/followers","following_url":"https://api.github.com/users/zcox/following{/other_user}","gists_url":"https://api.github.com/users/zcox/gists{/gist_id}","starred_url":"https://api.github.com/users/zcox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zcox/subscriptions","organizations_url":"https://api.github.com/users/zcox/orgs","repos_url":"https://api.github.com/users/zcox/repos","events_url":"https://api.github.com/users/zcox/events{/privacy}","received_events_url":"https://api.github.com/users/zcox/received_events","type":"User","site_admin":false},"created_at":"2015-07-31T12:55:13Z","updated_at":"2015-07-31T12:55:13Z","body":"Hi @adamdecaf - when I was looking at this recently, I was thinking maybe each call to `GraphiteReporter.report` should result in one socket (udp or tcp) being opened to the Graphite server, used for all metrics being reported (i.e. each call to `GraphiteSender.send`) and then closed when all metrics have been reported. \r\n\r\nI'm assuming that `GraphiteReporter.report` gets called once per minute (or whatever is configured) with params containing every single metric in the entire system, sends all metrics to Graphite really quickly, then does nothing again for another minute until it's called again. Does that seem accurate? \r\n\r\nIf that's the way it works, it might be good to reuse that socket/connection throughout the same `GraphiteReporter.report` call since there could presumably be lots of metrics sent to Graphite in that call. It might be costly to open/use/close a single socket/connection for each individual metric to send.\r\n\r\nThe `GraphiteSender` API doesn't make it straightforward to take this approach though. `GraphiteReporter.report` seems to call `isConnected` and `connect` first, then call `send` many times, and then finally calls `flush` at the end, so maybe those calls could be used in a `GraphiteSender` impl to create, use and then close the socket per single call to `GraphiteReporter.report`?"}}