{"action":"created","comment":{"url":"https://api.github.com/repos/weaveworks/cortex/pulls/comments/121180493","pull_request_review_id":43214450,"id":121180493,"diff_hunk":"@@ -2,6 +2,29 @@ package util\n \n import \"github.com/prometheus/common/model\"\n \n+// MergeNSamples merges and dedupes n sets of already sorted sample pairs.\n+func MergeNSamples(sampleSets ...[]model.SamplePair) []model.SamplePair {\n+\tl := len(sampleSets)\n+\tswitch l {\n+\tcase 0:","path":"pkg/util/merger.go","position":null,"original_position":8,"commit_id":"940291eb26ecc5019565c2a83dcafea7c85db66e","original_commit_id":"40f77ee11f0c801c8ded73b07aa2ffb41f8e19ae","user":{"login":"marccarre","id":836014,"avatar_url":"https://avatars3.githubusercontent.com/u/836014?v=3","gravatar_id":"","url":"https://api.github.com/users/marccarre","html_url":"https://github.com/marccarre","followers_url":"https://api.github.com/users/marccarre/followers","following_url":"https://api.github.com/users/marccarre/following{/other_user}","gists_url":"https://api.github.com/users/marccarre/gists{/gist_id}","starred_url":"https://api.github.com/users/marccarre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marccarre/subscriptions","organizations_url":"https://api.github.com/users/marccarre/orgs","repos_url":"https://api.github.com/users/marccarre/repos","events_url":"https://api.github.com/users/marccarre/events{/privacy}","received_events_url":"https://api.github.com/users/marccarre/received_events","type":"User","site_admin":false},"body":"Unless I've missed it, and even though that's trivial, I don't think there is an unit test covering this `case` statement.\r\nIf I understood well, we'd need this additional test case:\r\n```\r\n\t\t{\r\n\t\t\tsampleSets: [][]model.SamplePair{},\r\n\t\t\texpected:   []model.SamplePair{},\r\n\t\t},\r\n```\r\n","created_at":"2017-06-09T17:26:35Z","updated_at":"2017-06-09T17:26:36Z","html_url":"https://github.com/weaveworks/cortex/pull/442#discussion_r121180493","pull_request_url":"https://api.github.com/repos/weaveworks/cortex/pulls/442","_links":{"self":{"href":"https://api.github.com/repos/weaveworks/cortex/pulls/comments/121180493"},"html":{"href":"https://github.com/weaveworks/cortex/pull/442#discussion_r121180493"},"pull_request":{"href":"https://api.github.com/repos/weaveworks/cortex/pulls/442"}}},"pull_request":{"url":"https://api.github.com/repos/weaveworks/cortex/pulls/442","id":122383226,"html_url":"https://github.com/weaveworks/cortex/pull/442","diff_url":"https://github.com/weaveworks/cortex/pull/442.diff","patch_url":"https://github.com/weaveworks/cortex/pull/442.patch","issue_url":"https://api.github.com/repos/weaveworks/cortex/issues/442","number":442,"state":"open","locked":false,"title":"Use LazySeriesIterator with fuzzy metric name queries","user":{"login":"aaron7","id":903926,"avatar_url":"https://avatars1.githubusercontent.com/u/903926?v=3","gravatar_id":"","url":"https://api.github.com/users/aaron7","html_url":"https://github.com/aaron7","followers_url":"https://api.github.com/users/aaron7/followers","following_url":"https://api.github.com/users/aaron7/following{/other_user}","gists_url":"https://api.github.com/users/aaron7/gists{/gist_id}","starred_url":"https://api.github.com/users/aaron7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaron7/subscriptions","organizations_url":"https://api.github.com/users/aaron7/orgs","repos_url":"https://api.github.com/users/aaron7/repos","events_url":"https://api.github.com/users/aaron7/events{/privacy}","received_events_url":"https://api.github.com/users/aaron7/received_events","type":"User","site_admin":false},"body":"Depends on #430 and #438 - view changes for this PR here: https://github.com/weaveworks/cortex/pull/442/files/4100dcc322159141bb645b0823795f3d726954a5..685f52f8245af19795b6a47d4f95be30fb4367d4\r\n\r\nThere is not opportunity for our iterator to return an error if values are request, so we are just returning no values for now.\r\n\r\nTest plan:\r\n- `count({__name__=~\".+\"}) by (__name__)` ran locally\r\n\r\n\r\n","created_at":"2017-05-25T07:00:30Z","updated_at":"2017-06-09T17:26:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e50bbb89ab9e0a0438bd1d64eb2fb9920d9de0d5","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/weaveworks/cortex/pulls/442/commits","review_comments_url":"https://api.github.com/repos/weaveworks/cortex/pulls/442/comments","review_comment_url":"https://api.github.com/repos/weaveworks/cortex/pulls/comments{/number}","comments_url":"https://api.github.com/repos/weaveworks/cortex/issues/442/comments","statuses_url":"https://api.github.com/repos/weaveworks/cortex/statuses/940291eb26ecc5019565c2a83dcafea7c85db66e","head":{"label":"weaveworks:416-lazy-series-when-no-metric-name","ref":"416-lazy-series-when-no-metric-name","sha":"940291eb26ecc5019565c2a83dcafea7c85db66e","user":{"login":"weaveworks","id":9976052,"avatar_url":"https://avatars2.githubusercontent.com/u/9976052?v=3","gravatar_id":"","url":"https://api.github.com/users/weaveworks","html_url":"https://github.com/weaveworks","followers_url":"https://api.github.com/users/weaveworks/followers","following_url":"https://api.github.com/users/weaveworks/following{/other_user}","gists_url":"https://api.github.com/users/weaveworks/gists{/gist_id}","starred_url":"https://api.github.com/users/weaveworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaveworks/subscriptions","organizations_url":"https://api.github.com/users/weaveworks/orgs","repos_url":"https://api.github.com/users/weaveworks/repos","events_url":"https://api.github.com/users/weaveworks/events{/privacy}","received_events_url":"https://api.github.com/users/weaveworks/received_events","type":"Organization","site_admin":false},"repo":{"id":67793333,"name":"cortex","full_name":"weaveworks/cortex","owner":{"login":"weaveworks","id":9976052,"avatar_url":"https://avatars2.githubusercontent.com/u/9976052?v=3","gravatar_id":"","url":"https://api.github.com/users/weaveworks","html_url":"https://github.com/weaveworks","followers_url":"https://api.github.com/users/weaveworks/followers","following_url":"https://api.github.com/users/weaveworks/following{/other_user}","gists_url":"https://api.github.com/users/weaveworks/gists{/gist_id}","starred_url":"https://api.github.com/users/weaveworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaveworks/subscriptions","organizations_url":"https://api.github.com/users/weaveworks/orgs","repos_url":"https://api.github.com/users/weaveworks/repos","events_url":"https://api.github.com/users/weaveworks/events{/privacy}","received_events_url":"https://api.github.com/users/weaveworks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/weaveworks/cortex","description":"A multitenant, horizontally scalable Prometheus as a Service","fork":false,"url":"https://api.github.com/repos/weaveworks/cortex","forks_url":"https://api.github.com/repos/weaveworks/cortex/forks","keys_url":"https://api.github.com/repos/weaveworks/cortex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weaveworks/cortex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weaveworks/cortex/teams","hooks_url":"https://api.github.com/repos/weaveworks/cortex/hooks","issue_events_url":"https://api.github.com/repos/weaveworks/cortex/issues/events{/number}","events_url":"https://api.github.com/repos/weaveworks/cortex/events","assignees_url":"https://api.github.com/repos/weaveworks/cortex/assignees{/user}","branches_url":"https://api.github.com/repos/weaveworks/cortex/branches{/branch}","tags_url":"https://api.github.com/repos/weaveworks/cortex/tags","blobs_url":"https://api.github.com/repos/weaveworks/cortex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weaveworks/cortex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weaveworks/cortex/git/refs{/sha}","trees_url":"https://api.github.com/repos/weaveworks/cortex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weaveworks/cortex/statuses/{sha}","languages_url":"https://api.github.com/repos/weaveworks/cortex/languages","stargazers_url":"https://api.github.com/repos/weaveworks/cortex/stargazers","contributors_url":"https://api.github.com/repos/weaveworks/cortex/contributors","subscribers_url":"https://api.github.com/repos/weaveworks/cortex/subscribers","subscription_url":"https://api.github.com/repos/weaveworks/cortex/subscription","commits_url":"https://api.github.com/repos/weaveworks/cortex/commits{/sha}","git_commits_url":"https://api.github.com/repos/weaveworks/cortex/git/commits{/sha}","comments_url":"https://api.github.com/repos/weaveworks/cortex/comments{/number}","issue_comment_url":"https://api.github.com/repos/weaveworks/cortex/issues/comments{/number}","contents_url":"https://api.github.com/repos/weaveworks/cortex/contents/{+path}","compare_url":"https://api.github.com/repos/weaveworks/cortex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weaveworks/cortex/merges","archive_url":"https://api.github.com/repos/weaveworks/cortex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weaveworks/cortex/downloads","issues_url":"https://api.github.com/repos/weaveworks/cortex/issues{/number}","pulls_url":"https://api.github.com/repos/weaveworks/cortex/pulls{/number}","milestones_url":"https://api.github.com/repos/weaveworks/cortex/milestones{/number}","notifications_url":"https://api.github.com/repos/weaveworks/cortex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weaveworks/cortex/labels{/name}","releases_url":"https://api.github.com/repos/weaveworks/cortex/releases{/id}","deployments_url":"https://api.github.com/repos/weaveworks/cortex/deployments","created_at":"2016-09-09T11:23:12Z","updated_at":"2017-06-06T00:50:00Z","pushed_at":"2017-06-06T16:20:10Z","git_url":"git://github.com/weaveworks/cortex.git","ssh_url":"git@github.com:weaveworks/cortex.git","clone_url":"https://github.com/weaveworks/cortex.git","svn_url":"https://github.com/weaveworks/cortex","homepage":null,"size":18764,"stargazers_count":188,"watchers_count":188,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":55,"forks":20,"open_issues":55,"watchers":188,"default_branch":"master"}},"base":{"label":"weaveworks:master","ref":"master","sha":"72abd830cce1628aac1d478d10e5afa5b4ca906f","user":{"login":"weaveworks","id":9976052,"avatar_url":"https://avatars2.githubusercontent.com/u/9976052?v=3","gravatar_id":"","url":"https://api.github.com/users/weaveworks","html_url":"https://github.com/weaveworks","followers_url":"https://api.github.com/users/weaveworks/followers","following_url":"https://api.github.com/users/weaveworks/following{/other_user}","gists_url":"https://api.github.com/users/weaveworks/gists{/gist_id}","starred_url":"https://api.github.com/users/weaveworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaveworks/subscriptions","organizations_url":"https://api.github.com/users/weaveworks/orgs","repos_url":"https://api.github.com/users/weaveworks/repos","events_url":"https://api.github.com/users/weaveworks/events{/privacy}","received_events_url":"https://api.github.com/users/weaveworks/received_events","type":"Organization","site_admin":false},"repo":{"id":67793333,"name":"cortex","full_name":"weaveworks/cortex","owner":{"login":"weaveworks","id":9976052,"avatar_url":"https://avatars2.githubusercontent.com/u/9976052?v=3","gravatar_id":"","url":"https://api.github.com/users/weaveworks","html_url":"https://github.com/weaveworks","followers_url":"https://api.github.com/users/weaveworks/followers","following_url":"https://api.github.com/users/weaveworks/following{/other_user}","gists_url":"https://api.github.com/users/weaveworks/gists{/gist_id}","starred_url":"https://api.github.com/users/weaveworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaveworks/subscriptions","organizations_url":"https://api.github.com/users/weaveworks/orgs","repos_url":"https://api.github.com/users/weaveworks/repos","events_url":"https://api.github.com/users/weaveworks/events{/privacy}","received_events_url":"https://api.github.com/users/weaveworks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/weaveworks/cortex","description":"A multitenant, horizontally scalable Prometheus as a Service","fork":false,"url":"https://api.github.com/repos/weaveworks/cortex","forks_url":"https://api.github.com/repos/weaveworks/cortex/forks","keys_url":"https://api.github.com/repos/weaveworks/cortex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weaveworks/cortex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weaveworks/cortex/teams","hooks_url":"https://api.github.com/repos/weaveworks/cortex/hooks","issue_events_url":"https://api.github.com/repos/weaveworks/cortex/issues/events{/number}","events_url":"https://api.github.com/repos/weaveworks/cortex/events","assignees_url":"https://api.github.com/repos/weaveworks/cortex/assignees{/user}","branches_url":"https://api.github.com/repos/weaveworks/cortex/branches{/branch}","tags_url":"https://api.github.com/repos/weaveworks/cortex/tags","blobs_url":"https://api.github.com/repos/weaveworks/cortex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weaveworks/cortex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weaveworks/cortex/git/refs{/sha}","trees_url":"https://api.github.com/repos/weaveworks/cortex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weaveworks/cortex/statuses/{sha}","languages_url":"https://api.github.com/repos/weaveworks/cortex/languages","stargazers_url":"https://api.github.com/repos/weaveworks/cortex/stargazers","contributors_url":"https://api.github.com/repos/weaveworks/cortex/contributors","subscribers_url":"https://api.github.com/repos/weaveworks/cortex/subscribers","subscription_url":"https://api.github.com/repos/weaveworks/cortex/subscription","commits_url":"https://api.github.com/repos/weaveworks/cortex/commits{/sha}","git_commits_url":"https://api.github.com/repos/weaveworks/cortex/git/commits{/sha}","comments_url":"https://api.github.com/repos/weaveworks/cortex/comments{/number}","issue_comment_url":"https://api.github.com/repos/weaveworks/cortex/issues/comments{/number}","contents_url":"https://api.github.com/repos/weaveworks/cortex/contents/{+path}","compare_url":"https://api.github.com/repos/weaveworks/cortex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weaveworks/cortex/merges","archive_url":"https://api.github.com/repos/weaveworks/cortex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weaveworks/cortex/downloads","issues_url":"https://api.github.com/repos/weaveworks/cortex/issues{/number}","pulls_url":"https://api.github.com/repos/weaveworks/cortex/pulls{/number}","milestones_url":"https://api.github.com/repos/weaveworks/cortex/milestones{/number}","notifications_url":"https://api.github.com/repos/weaveworks/cortex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weaveworks/cortex/labels{/name}","releases_url":"https://api.github.com/repos/weaveworks/cortex/releases{/id}","deployments_url":"https://api.github.com/repos/weaveworks/cortex/deployments","created_at":"2016-09-09T11:23:12Z","updated_at":"2017-06-06T00:50:00Z","pushed_at":"2017-06-06T16:20:10Z","git_url":"git://github.com/weaveworks/cortex.git","ssh_url":"git@github.com:weaveworks/cortex.git","clone_url":"https://github.com/weaveworks/cortex.git","svn_url":"https://github.com/weaveworks/cortex","homepage":null,"size":18764,"stargazers_count":188,"watchers_count":188,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":55,"forks":20,"open_issues":55,"watchers":188,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/weaveworks/cortex/pulls/442"},"html":{"href":"https://github.com/weaveworks/cortex/pull/442"},"issue":{"href":"https://api.github.com/repos/weaveworks/cortex/issues/442"},"comments":{"href":"https://api.github.com/repos/weaveworks/cortex/issues/442/comments"},"review_comments":{"href":"https://api.github.com/repos/weaveworks/cortex/pulls/442/comments"},"review_comment":{"href":"https://api.github.com/repos/weaveworks/cortex/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/weaveworks/cortex/pulls/442/commits"},"statuses":{"href":"https://api.github.com/repos/weaveworks/cortex/statuses/940291eb26ecc5019565c2a83dcafea7c85db66e"}}}}
{"actor":{"display_login":"marccarre"}}