{"action":"created","comment":{"url":"https://api.github.com/repos/m3db/m3db/pulls/comments/69643225","id":69643225,"diff_hunk":"@@ -41,12 +41,13 @@ type encoder struct {\n \topts Options\n \n \t// internal bookkeeping\n-\tt   time.Time       // current time\n-\tdt  time.Duration   // current time delta\n-\tvb  uint64          // current value\n-\txor uint64          // current xor\n-\tant m3db.Annotation // current annotation\n-\ttu  xtime.Unit      // current time unit\n+\tt         time.Time       // current time\n+\tdt        time.Duration   // current time delta\n+\tvb        uint64          // current value\n+\txor       uint64          // current xor\n+\tant       m3db.Annotation // current annotation\n+\ttu        xtime.Unit      // current time unit\n+\ttuChanged bool            // whether we have a new time unit","path":"encoding/tsz/encoder.go","position":16,"original_position":16,"commit_id":"210f12aebc6187efc46d46e915808b204aa524a1","original_commit_id":"210f12aebc6187efc46d46e915808b204aa524a1","user":{"login":"robskillington","id":339615,"avatar_url":"https://avatars.githubusercontent.com/u/339615?v=3","gravatar_id":"","url":"https://api.github.com/users/robskillington","html_url":"https://github.com/robskillington","followers_url":"https://api.github.com/users/robskillington/followers","following_url":"https://api.github.com/users/robskillington/following{/other_user}","gists_url":"https://api.github.com/users/robskillington/gists{/gist_id}","starred_url":"https://api.github.com/users/robskillington/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robskillington/subscriptions","organizations_url":"https://api.github.com/users/robskillington/orgs","repos_url":"https://api.github.com/users/robskillington/repos","events_url":"https://api.github.com/users/robskillington/events{/privacy}","received_events_url":"https://api.github.com/users/robskillington/received_events","type":"User","site_admin":false},"body":"Instead of adding a member field, I think returning a `bool` from `writeTimeUnit` is better whether it wrote it or not and then using that inside `writeTimeUnit` and passing it to the call to `writeDeltaOfDelta` as a parameter.  Thoughts?","created_at":"2016-07-05T21:40:28Z","updated_at":"2016-07-05T21:40:28Z","html_url":"https://github.com/m3db/m3db/pull/17#discussion_r69643225","pull_request_url":"https://api.github.com/repos/m3db/m3db/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/m3db/m3db/pulls/comments/69643225"},"html":{"href":"https://github.com/m3db/m3db/pull/17#discussion_r69643225"},"pull_request":{"href":"https://api.github.com/repos/m3db/m3db/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/m3db/m3db/pulls/17","id":76324654,"html_url":"https://github.com/m3db/m3db/pull/17","diff_url":"https://github.com/m3db/m3db/pull/17.diff","patch_url":"https://github.com/m3db/m3db/pull/17.patch","issue_url":"https://api.github.com/repos/m3db/m3db/issues/17","number":17,"state":"open","locked":false,"title":"Properly support encoding datapoints with different time units","user":{"login":"xichen2020","id":12239421,"avatar_url":"https://avatars.githubusercontent.com/u/12239421?v=3","gravatar_id":"","url":"https://api.github.com/users/xichen2020","html_url":"https://github.com/xichen2020","followers_url":"https://api.github.com/users/xichen2020/followers","following_url":"https://api.github.com/users/xichen2020/following{/other_user}","gists_url":"https://api.github.com/users/xichen2020/gists{/gist_id}","starred_url":"https://api.github.com/users/xichen2020/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xichen2020/subscriptions","organizations_url":"https://api.github.com/users/xichen2020/orgs","repos_url":"https://api.github.com/users/xichen2020/repos","events_url":"https://api.github.com/users/xichen2020/events{/privacy}","received_events_url":"https://api.github.com/users/xichen2020/received_events","type":"User","site_admin":false},"body":"cc @robskillington \r\n\r\nSummary of the change (both encoder and iterator):\r\n- Encode the start time as nanoseconds with 64 bits because we don't know the time unit when an encoder is created.\r\n- When a time unit changes, encode the time delta-of-delta as nanoseconds with 64 bits because it might not be a multiple of the time unit. We also reset time delta to 0 because the delta-of-delta when encoding the next datapoint may not be a multiple of the new time unit otherwise.\r\n","created_at":"2016-07-05T18:57:48Z","updated_at":"2016-07-05T21:40:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c6153e7269f05b1c7902b1a1873c6d8441f54881","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/m3db/m3db/pulls/17/commits","review_comments_url":"https://api.github.com/repos/m3db/m3db/pulls/17/comments","review_comment_url":"https://api.github.com/repos/m3db/m3db/pulls/comments{/number}","comments_url":"https://api.github.com/repos/m3db/m3db/issues/17/comments","statuses_url":"https://api.github.com/repos/m3db/m3db/statuses/210f12aebc6187efc46d46e915808b204aa524a1","head":{"label":"m3db:xichen-tsz-timeunit","ref":"xichen-tsz-timeunit","sha":"210f12aebc6187efc46d46e915808b204aa524a1","user":{"login":"m3db","id":19937171,"avatar_url":"https://avatars.githubusercontent.com/u/19937171?v=3","gravatar_id":"","url":"https://api.github.com/users/m3db","html_url":"https://github.com/m3db","followers_url":"https://api.github.com/users/m3db/followers","following_url":"https://api.github.com/users/m3db/following{/other_user}","gists_url":"https://api.github.com/users/m3db/gists{/gist_id}","starred_url":"https://api.github.com/users/m3db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m3db/subscriptions","organizations_url":"https://api.github.com/users/m3db/orgs","repos_url":"https://api.github.com/users/m3db/repos","events_url":"https://api.github.com/users/m3db/events{/privacy}","received_events_url":"https://api.github.com/users/m3db/received_events","type":"Organization","site_admin":false},"repo":{"id":61153677,"name":"m3db","full_name":"m3db/m3db","owner":{"login":"m3db","id":19937171,"avatar_url":"https://avatars.githubusercontent.com/u/19937171?v=3","gravatar_id":"","url":"https://api.github.com/users/m3db","html_url":"https://github.com/m3db","followers_url":"https://api.github.com/users/m3db/followers","following_url":"https://api.github.com/users/m3db/following{/other_user}","gists_url":"https://api.github.com/users/m3db/gists{/gist_id}","starred_url":"https://api.github.com/users/m3db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m3db/subscriptions","organizations_url":"https://api.github.com/users/m3db/orgs","repos_url":"https://api.github.com/users/m3db/repos","events_url":"https://api.github.com/users/m3db/events{/privacy}","received_events_url":"https://api.github.com/users/m3db/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/m3db/m3db","description":"","fork":false,"url":"https://api.github.com/repos/m3db/m3db","forks_url":"https://api.github.com/repos/m3db/m3db/forks","keys_url":"https://api.github.com/repos/m3db/m3db/keys{/key_id}","collaborators_url":"https://api.github.com/repos/m3db/m3db/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/m3db/m3db/teams","hooks_url":"https://api.github.com/repos/m3db/m3db/hooks","issue_events_url":"https://api.github.com/repos/m3db/m3db/issues/events{/number}","events_url":"https://api.github.com/repos/m3db/m3db/events","assignees_url":"https://api.github.com/repos/m3db/m3db/assignees{/user}","branches_url":"https://api.github.com/repos/m3db/m3db/branches{/branch}","tags_url":"https://api.github.com/repos/m3db/m3db/tags","blobs_url":"https://api.github.com/repos/m3db/m3db/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/m3db/m3db/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/m3db/m3db/git/refs{/sha}","trees_url":"https://api.github.com/repos/m3db/m3db/git/trees{/sha}","statuses_url":"https://api.github.com/repos/m3db/m3db/statuses/{sha}","languages_url":"https://api.github.com/repos/m3db/m3db/languages","stargazers_url":"https://api.github.com/repos/m3db/m3db/stargazers","contributors_url":"https://api.github.com/repos/m3db/m3db/contributors","subscribers_url":"https://api.github.com/repos/m3db/m3db/subscribers","subscription_url":"https://api.github.com/repos/m3db/m3db/subscription","commits_url":"https://api.github.com/repos/m3db/m3db/commits{/sha}","git_commits_url":"https://api.github.com/repos/m3db/m3db/git/commits{/sha}","comments_url":"https://api.github.com/repos/m3db/m3db/comments{/number}","issue_comment_url":"https://api.github.com/repos/m3db/m3db/issues/comments{/number}","contents_url":"https://api.github.com/repos/m3db/m3db/contents/{+path}","compare_url":"https://api.github.com/repos/m3db/m3db/compare/{base}...{head}","merges_url":"https://api.github.com/repos/m3db/m3db/merges","archive_url":"https://api.github.com/repos/m3db/m3db/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/m3db/m3db/downloads","issues_url":"https://api.github.com/repos/m3db/m3db/issues{/number}","pulls_url":"https://api.github.com/repos/m3db/m3db/pulls{/number}","milestones_url":"https://api.github.com/repos/m3db/m3db/milestones{/number}","notifications_url":"https://api.github.com/repos/m3db/m3db/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/m3db/m3db/labels{/name}","releases_url":"https://api.github.com/repos/m3db/m3db/releases{/id}","deployments_url":"https://api.github.com/repos/m3db/m3db/deployments","created_at":"2016-06-14T20:29:45Z","updated_at":"2016-07-03T21:35:16Z","pushed_at":"2016-07-05T19:30:10Z","git_url":"git://github.com/m3db/m3db.git","ssh_url":"git@github.com:m3db/m3db.git","clone_url":"https://github.com/m3db/m3db.git","svn_url":"https://github.com/m3db/m3db","homepage":"http://uber.github.io/","size":2111,"stargazers_count":6,"watchers_count":6,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":6,"default_branch":"master"}},"base":{"label":"m3db:master","ref":"master","sha":"ecbcc9390c529efe0e24b5dff32d618c13659ff3","user":{"login":"m3db","id":19937171,"avatar_url":"https://avatars.githubusercontent.com/u/19937171?v=3","gravatar_id":"","url":"https://api.github.com/users/m3db","html_url":"https://github.com/m3db","followers_url":"https://api.github.com/users/m3db/followers","following_url":"https://api.github.com/users/m3db/following{/other_user}","gists_url":"https://api.github.com/users/m3db/gists{/gist_id}","starred_url":"https://api.github.com/users/m3db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m3db/subscriptions","organizations_url":"https://api.github.com/users/m3db/orgs","repos_url":"https://api.github.com/users/m3db/repos","events_url":"https://api.github.com/users/m3db/events{/privacy}","received_events_url":"https://api.github.com/users/m3db/received_events","type":"Organization","site_admin":false},"repo":{"id":61153677,"name":"m3db","full_name":"m3db/m3db","owner":{"login":"m3db","id":19937171,"avatar_url":"https://avatars.githubusercontent.com/u/19937171?v=3","gravatar_id":"","url":"https://api.github.com/users/m3db","html_url":"https://github.com/m3db","followers_url":"https://api.github.com/users/m3db/followers","following_url":"https://api.github.com/users/m3db/following{/other_user}","gists_url":"https://api.github.com/users/m3db/gists{/gist_id}","starred_url":"https://api.github.com/users/m3db/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m3db/subscriptions","organizations_url":"https://api.github.com/users/m3db/orgs","repos_url":"https://api.github.com/users/m3db/repos","events_url":"https://api.github.com/users/m3db/events{/privacy}","received_events_url":"https://api.github.com/users/m3db/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/m3db/m3db","description":"","fork":false,"url":"https://api.github.com/repos/m3db/m3db","forks_url":"https://api.github.com/repos/m3db/m3db/forks","keys_url":"https://api.github.com/repos/m3db/m3db/keys{/key_id}","collaborators_url":"https://api.github.com/repos/m3db/m3db/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/m3db/m3db/teams","hooks_url":"https://api.github.com/repos/m3db/m3db/hooks","issue_events_url":"https://api.github.com/repos/m3db/m3db/issues/events{/number}","events_url":"https://api.github.com/repos/m3db/m3db/events","assignees_url":"https://api.github.com/repos/m3db/m3db/assignees{/user}","branches_url":"https://api.github.com/repos/m3db/m3db/branches{/branch}","tags_url":"https://api.github.com/repos/m3db/m3db/tags","blobs_url":"https://api.github.com/repos/m3db/m3db/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/m3db/m3db/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/m3db/m3db/git/refs{/sha}","trees_url":"https://api.github.com/repos/m3db/m3db/git/trees{/sha}","statuses_url":"https://api.github.com/repos/m3db/m3db/statuses/{sha}","languages_url":"https://api.github.com/repos/m3db/m3db/languages","stargazers_url":"https://api.github.com/repos/m3db/m3db/stargazers","contributors_url":"https://api.github.com/repos/m3db/m3db/contributors","subscribers_url":"https://api.github.com/repos/m3db/m3db/subscribers","subscription_url":"https://api.github.com/repos/m3db/m3db/subscription","commits_url":"https://api.github.com/repos/m3db/m3db/commits{/sha}","git_commits_url":"https://api.github.com/repos/m3db/m3db/git/commits{/sha}","comments_url":"https://api.github.com/repos/m3db/m3db/comments{/number}","issue_comment_url":"https://api.github.com/repos/m3db/m3db/issues/comments{/number}","contents_url":"https://api.github.com/repos/m3db/m3db/contents/{+path}","compare_url":"https://api.github.com/repos/m3db/m3db/compare/{base}...{head}","merges_url":"https://api.github.com/repos/m3db/m3db/merges","archive_url":"https://api.github.com/repos/m3db/m3db/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/m3db/m3db/downloads","issues_url":"https://api.github.com/repos/m3db/m3db/issues{/number}","pulls_url":"https://api.github.com/repos/m3db/m3db/pulls{/number}","milestones_url":"https://api.github.com/repos/m3db/m3db/milestones{/number}","notifications_url":"https://api.github.com/repos/m3db/m3db/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/m3db/m3db/labels{/name}","releases_url":"https://api.github.com/repos/m3db/m3db/releases{/id}","deployments_url":"https://api.github.com/repos/m3db/m3db/deployments","created_at":"2016-06-14T20:29:45Z","updated_at":"2016-07-03T21:35:16Z","pushed_at":"2016-07-05T19:30:10Z","git_url":"git://github.com/m3db/m3db.git","ssh_url":"git@github.com:m3db/m3db.git","clone_url":"https://github.com/m3db/m3db.git","svn_url":"https://github.com/m3db/m3db","homepage":"http://uber.github.io/","size":2111,"stargazers_count":6,"watchers_count":6,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/m3db/m3db/pulls/17"},"html":{"href":"https://github.com/m3db/m3db/pull/17"},"issue":{"href":"https://api.github.com/repos/m3db/m3db/issues/17"},"comments":{"href":"https://api.github.com/repos/m3db/m3db/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/m3db/m3db/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/m3db/m3db/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/m3db/m3db/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/m3db/m3db/statuses/210f12aebc6187efc46d46e915808b204aa524a1"}}}}
{"actor":{"display_login":"robskillington"}}