{"action":"created","comment":{"url":"https://api.github.com/repos/stripe/veneur/pulls/comments/146068697","pull_request_review_id":70968362,"id":146068697,"diff_hunk":"@@ -824,6 +834,12 @@ func (s *Server) Shutdown() {\n \tgraceful.Shutdown()\n }\n \n+// CalculateTickDelay takes the provided time, `Truncate`s it a rounded-down\n+// multiple of `interval`, then adds `interval` back to find the \"next\" tick.\n+func (s *Server) CalculateTickDelay(t time.Time) time.Duration {","path":"server.go","position":23,"original_position":23,"commit_id":"67605e407321a74ec783ffca031d8b92bebfbaa8","original_commit_id":"67605e407321a74ec783ffca031d8b92bebfbaa8","user":{"login":"ChimeraCoder","id":376414,"avatar_url":"https://avatars0.githubusercontent.com/u/376414?v=4","gravatar_id":"","url":"https://api.github.com/users/ChimeraCoder","html_url":"https://github.com/ChimeraCoder","followers_url":"https://api.github.com/users/ChimeraCoder/followers","following_url":"https://api.github.com/users/ChimeraCoder/following{/other_user}","gists_url":"https://api.github.com/users/ChimeraCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/ChimeraCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChimeraCoder/subscriptions","organizations_url":"https://api.github.com/users/ChimeraCoder/orgs","repos_url":"https://api.github.com/users/ChimeraCoder/repos","events_url":"https://api.github.com/users/ChimeraCoder/events{/privacy}","received_events_url":"https://api.github.com/users/ChimeraCoder/received_events","type":"User","site_admin":false},"body":"does this need to be a method on `Server`? We could just pass in the interval as a separate argument, which would make it easier to test without needing to spin up a new server.","created_at":"2017-10-20T21:17:21Z","updated_at":"2017-10-20T21:17:21Z","html_url":"https://github.com/stripe/veneur/pull/297#discussion_r146068697","pull_request_url":"https://api.github.com/repos/stripe/veneur/pulls/297","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/stripe/veneur/pulls/comments/146068697"},"html":{"href":"https://github.com/stripe/veneur/pull/297#discussion_r146068697"},"pull_request":{"href":"https://api.github.com/repos/stripe/veneur/pulls/297"}}},"pull_request":{"url":"https://api.github.com/repos/stripe/veneur/pulls/297","id":147816005,"html_url":"https://github.com/stripe/veneur/pull/297","diff_url":"https://github.com/stripe/veneur/pull/297.diff","patch_url":"https://github.com/stripe/veneur/pull/297.patch","issue_url":"https://api.github.com/repos/stripe/veneur/issues/297","number":297,"state":"open","locked":false,"title":"Align tick with interval boundaries for bucketing.","user":{"login":"cory-stripe","id":23101296,"avatar_url":"https://avatars3.githubusercontent.com/u/23101296?v=4","gravatar_id":"","url":"https://api.github.com/users/cory-stripe","html_url":"https://github.com/cory-stripe","followers_url":"https://api.github.com/users/cory-stripe/followers","following_url":"https://api.github.com/users/cory-stripe/following{/other_user}","gists_url":"https://api.github.com/users/cory-stripe/gists{/gist_id}","starred_url":"https://api.github.com/users/cory-stripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cory-stripe/subscriptions","organizations_url":"https://api.github.com/users/cory-stripe/orgs","repos_url":"https://api.github.com/users/cory-stripe/repos","events_url":"https://api.github.com/users/cory-stripe/events{/privacy}","received_events_url":"https://api.github.com/users/cory-stripe/received_events","type":"User","site_admin":false},"body":"#### Summary\r\nAlign Veneur's internal flush ticker with the interval for nice bucketing.\r\n\r\n\r\n#### Motivation\r\nWe got an issue from @hermanbanken in #296 that pointed our Veneur's choice to \"tick\" outside of a convenient boundary was causing some bucketing issues. This isn't the first time we've heard this, but it's the first time someone helped us understand _why_.\r\n\r\nTo that end, this patch changes veneur to delay the start of it's ticker by <= `interval` so as to align with nice, round clock buckets.\r\n\r\n#### Test plan\r\nTest incoming, in writing this PR text I realized how to test it. :)\r\n\r\nr? @stripe/observability ","created_at":"2017-10-20T14:36:35Z","updated_at":"2017-10-20T21:17:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"42526e37c344dea82335820555c69d87fdb341ac","assignee":{"login":"asf-stripe","id":23062936,"avatar_url":"https://avatars0.githubusercontent.com/u/23062936?v=4","gravatar_id":"","url":"https://api.github.com/users/asf-stripe","html_url":"https://github.com/asf-stripe","followers_url":"https://api.github.com/users/asf-stripe/followers","following_url":"https://api.github.com/users/asf-stripe/following{/other_user}","gists_url":"https://api.github.com/users/asf-stripe/gists{/gist_id}","starred_url":"https://api.github.com/users/asf-stripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asf-stripe/subscriptions","organizations_url":"https://api.github.com/users/asf-stripe/orgs","repos_url":"https://api.github.com/users/asf-stripe/repos","events_url":"https://api.github.com/users/asf-stripe/events{/privacy}","received_events_url":"https://api.github.com/users/asf-stripe/received_events","type":"User","site_admin":false},"assignees":[{"login":"asf-stripe","id":23062936,"avatar_url":"https://avatars0.githubusercontent.com/u/23062936?v=4","gravatar_id":"","url":"https://api.github.com/users/asf-stripe","html_url":"https://github.com/asf-stripe","followers_url":"https://api.github.com/users/asf-stripe/followers","following_url":"https://api.github.com/users/asf-stripe/following{/other_user}","gists_url":"https://api.github.com/users/asf-stripe/gists{/gist_id}","starred_url":"https://api.github.com/users/asf-stripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asf-stripe/subscriptions","organizations_url":"https://api.github.com/users/asf-stripe/orgs","repos_url":"https://api.github.com/users/asf-stripe/repos","events_url":"https://api.github.com/users/asf-stripe/events{/privacy}","received_events_url":"https://api.github.com/users/asf-stripe/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/stripe/veneur/pulls/297/commits","review_comments_url":"https://api.github.com/repos/stripe/veneur/pulls/297/comments","review_comment_url":"https://api.github.com/repos/stripe/veneur/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stripe/veneur/issues/297/comments","statuses_url":"https://api.github.com/repos/stripe/veneur/statuses/67605e407321a74ec783ffca031d8b92bebfbaa8","head":{"label":"stripe:cory-align-ticker-with-clock","ref":"cory-align-ticker-with-clock","sha":"67605e407321a74ec783ffca031d8b92bebfbaa8","user":{"login":"stripe","id":856813,"avatar_url":"https://avatars1.githubusercontent.com/u/856813?v=4","gravatar_id":"","url":"https://api.github.com/users/stripe","html_url":"https://github.com/stripe","followers_url":"https://api.github.com/users/stripe/followers","following_url":"https://api.github.com/users/stripe/following{/other_user}","gists_url":"https://api.github.com/users/stripe/gists{/gist_id}","starred_url":"https://api.github.com/users/stripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stripe/subscriptions","organizations_url":"https://api.github.com/users/stripe/orgs","repos_url":"https://api.github.com/users/stripe/repos","events_url":"https://api.github.com/users/stripe/events{/privacy}","received_events_url":"https://api.github.com/users/stripe/received_events","type":"Organization","site_admin":false},"repo":{"id":55277533,"name":"veneur","full_name":"stripe/veneur","owner":{"login":"stripe","id":856813,"avatar_url":"https://avatars1.githubusercontent.com/u/856813?v=4","gravatar_id":"","url":"https://api.github.com/users/stripe","html_url":"https://github.com/stripe","followers_url":"https://api.github.com/users/stripe/followers","following_url":"https://api.github.com/users/stripe/following{/other_user}","gists_url":"https://api.github.com/users/stripe/gists{/gist_id}","starred_url":"https://api.github.com/users/stripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stripe/subscriptions","organizations_url":"https://api.github.com/users/stripe/orgs","repos_url":"https://api.github.com/users/stripe/repos","events_url":"https://api.github.com/users/stripe/events{/privacy}","received_events_url":"https://api.github.com/users/stripe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stripe/veneur","description":"A DogStatsD server implementation with global aggregation capability.    ","fork":false,"url":"https://api.github.com/repos/stripe/veneur","forks_url":"https://api.github.com/repos/stripe/veneur/forks","keys_url":"https://api.github.com/repos/stripe/veneur/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stripe/veneur/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stripe/veneur/teams","hooks_url":"https://api.github.com/repos/stripe/veneur/hooks","issue_events_url":"https://api.github.com/repos/stripe/veneur/issues/events{/number}","events_url":"https://api.github.com/repos/stripe/veneur/events","assignees_url":"https://api.github.com/repos/stripe/veneur/assignees{/user}","branches_url":"https://api.github.com/repos/stripe/veneur/branches{/branch}","tags_url":"https://api.github.com/repos/stripe/veneur/tags","blobs_url":"https://api.github.com/repos/stripe/veneur/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stripe/veneur/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stripe/veneur/git/refs{/sha}","trees_url":"https://api.github.com/repos/stripe/veneur/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stripe/veneur/statuses/{sha}","languages_url":"https://api.github.com/repos/stripe/veneur/languages","stargazers_url":"https://api.github.com/repos/stripe/veneur/stargazers","contributors_url":"https://api.github.com/repos/stripe/veneur/contributors","subscribers_url":"https://api.github.com/repos/stripe/veneur/subscribers","subscription_url":"https://api.github.com/repos/stripe/veneur/subscription","commits_url":"https://api.github.com/repos/stripe/veneur/commits{/sha}","git_commits_url":"https://api.github.com/repos/stripe/veneur/git/commits{/sha}","comments_url":"https://api.github.com/repos/stripe/veneur/comments{/number}","issue_comment_url":"https://api.github.com/repos/stripe/veneur/issues/comments{/number}","contents_url":"https://api.github.com/repos/stripe/veneur/contents/{+path}","compare_url":"https://api.github.com/repos/stripe/veneur/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stripe/veneur/merges","archive_url":"https://api.github.com/repos/stripe/veneur/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stripe/veneur/downloads","issues_url":"https://api.github.com/repos/stripe/veneur/issues{/number}","pulls_url":"https://api.github.com/repos/stripe/veneur/pulls{/number}","milestones_url":"https://api.github.com/repos/stripe/veneur/milestones{/number}","notifications_url":"https://api.github.com/repos/stripe/veneur/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stripe/veneur/labels{/name}","releases_url":"https://api.github.com/repos/stripe/veneur/releases{/id}","deployments_url":"https://api.github.com/repos/stripe/veneur/deployments","created_at":"2016-04-02T04:24:34Z","updated_at":"2017-10-16T15:13:54Z","pushed_at":"2017-10-20T21:11:59Z","git_url":"git://github.com/stripe/veneur.git","ssh_url":"git@github.com:stripe/veneur.git","clone_url":"https://github.com/stripe/veneur.git","svn_url":"https://github.com/stripe/veneur","homepage":"","size":25059,"stargazers_count":383,"watchers_count":383,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":30,"mirror_url":null,"archived":false,"open_issues_count":30,"forks":30,"open_issues":30,"watchers":383,"default_branch":"master"}},"base":{"label":"stripe:master","ref":"master","sha":"a320148c1e2c91d160d04174a2e7b395b813a669","user":{"login":"stripe","id":856813,"avatar_url":"https://avatars1.githubusercontent.com/u/856813?v=4","gravatar_id":"","url":"https://api.github.com/users/stripe","html_url":"https://github.com/stripe","followers_url":"https://api.github.com/users/stripe/followers","following_url":"https://api.github.com/users/stripe/following{/other_user}","gists_url":"https://api.github.com/users/stripe/gists{/gist_id}","starred_url":"https://api.github.com/users/stripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stripe/subscriptions","organizations_url":"https://api.github.com/users/stripe/orgs","repos_url":"https://api.github.com/users/stripe/repos","events_url":"https://api.github.com/users/stripe/events{/privacy}","received_events_url":"https://api.github.com/users/stripe/received_events","type":"Organization","site_admin":false},"repo":{"id":55277533,"name":"veneur","full_name":"stripe/veneur","owner":{"login":"stripe","id":856813,"avatar_url":"https://avatars1.githubusercontent.com/u/856813?v=4","gravatar_id":"","url":"https://api.github.com/users/stripe","html_url":"https://github.com/stripe","followers_url":"https://api.github.com/users/stripe/followers","following_url":"https://api.github.com/users/stripe/following{/other_user}","gists_url":"https://api.github.com/users/stripe/gists{/gist_id}","starred_url":"https://api.github.com/users/stripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stripe/subscriptions","organizations_url":"https://api.github.com/users/stripe/orgs","repos_url":"https://api.github.com/users/stripe/repos","events_url":"https://api.github.com/users/stripe/events{/privacy}","received_events_url":"https://api.github.com/users/stripe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stripe/veneur","description":"A DogStatsD server implementation with global aggregation capability.    ","fork":false,"url":"https://api.github.com/repos/stripe/veneur","forks_url":"https://api.github.com/repos/stripe/veneur/forks","keys_url":"https://api.github.com/repos/stripe/veneur/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stripe/veneur/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stripe/veneur/teams","hooks_url":"https://api.github.com/repos/stripe/veneur/hooks","issue_events_url":"https://api.github.com/repos/stripe/veneur/issues/events{/number}","events_url":"https://api.github.com/repos/stripe/veneur/events","assignees_url":"https://api.github.com/repos/stripe/veneur/assignees{/user}","branches_url":"https://api.github.com/repos/stripe/veneur/branches{/branch}","tags_url":"https://api.github.com/repos/stripe/veneur/tags","blobs_url":"https://api.github.com/repos/stripe/veneur/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stripe/veneur/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stripe/veneur/git/refs{/sha}","trees_url":"https://api.github.com/repos/stripe/veneur/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stripe/veneur/statuses/{sha}","languages_url":"https://api.github.com/repos/stripe/veneur/languages","stargazers_url":"https://api.github.com/repos/stripe/veneur/stargazers","contributors_url":"https://api.github.com/repos/stripe/veneur/contributors","subscribers_url":"https://api.github.com/repos/stripe/veneur/subscribers","subscription_url":"https://api.github.com/repos/stripe/veneur/subscription","commits_url":"https://api.github.com/repos/stripe/veneur/commits{/sha}","git_commits_url":"https://api.github.com/repos/stripe/veneur/git/commits{/sha}","comments_url":"https://api.github.com/repos/stripe/veneur/comments{/number}","issue_comment_url":"https://api.github.com/repos/stripe/veneur/issues/comments{/number}","contents_url":"https://api.github.com/repos/stripe/veneur/contents/{+path}","compare_url":"https://api.github.com/repos/stripe/veneur/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stripe/veneur/merges","archive_url":"https://api.github.com/repos/stripe/veneur/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stripe/veneur/downloads","issues_url":"https://api.github.com/repos/stripe/veneur/issues{/number}","pulls_url":"https://api.github.com/repos/stripe/veneur/pulls{/number}","milestones_url":"https://api.github.com/repos/stripe/veneur/milestones{/number}","notifications_url":"https://api.github.com/repos/stripe/veneur/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stripe/veneur/labels{/name}","releases_url":"https://api.github.com/repos/stripe/veneur/releases{/id}","deployments_url":"https://api.github.com/repos/stripe/veneur/deployments","created_at":"2016-04-02T04:24:34Z","updated_at":"2017-10-16T15:13:54Z","pushed_at":"2017-10-20T21:11:59Z","git_url":"git://github.com/stripe/veneur.git","ssh_url":"git@github.com:stripe/veneur.git","clone_url":"https://github.com/stripe/veneur.git","svn_url":"https://github.com/stripe/veneur","homepage":"","size":25059,"stargazers_count":383,"watchers_count":383,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":30,"mirror_url":null,"archived":false,"open_issues_count":30,"forks":30,"open_issues":30,"watchers":383,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/stripe/veneur/pulls/297"},"html":{"href":"https://github.com/stripe/veneur/pull/297"},"issue":{"href":"https://api.github.com/repos/stripe/veneur/issues/297"},"comments":{"href":"https://api.github.com/repos/stripe/veneur/issues/297/comments"},"review_comments":{"href":"https://api.github.com/repos/stripe/veneur/pulls/297/comments"},"review_comment":{"href":"https://api.github.com/repos/stripe/veneur/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stripe/veneur/pulls/297/commits"},"statuses":{"href":"https://api.github.com/repos/stripe/veneur/statuses/67605e407321a74ec783ffca031d8b92bebfbaa8"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"ChimeraCoder"}}