{"action":"created","comment":{"url":"https://api.github.com/repos/square/metrics/pulls/comments/38605043","id":38605043,"diff_hunk":"@@ -0,0 +1,50 @@\n+// Copyright 2015 Square Inc.\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+// http://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+// Package api holds common data types and public interface exposed by the indexer library.\n+// Refer to the doc\n+// https://docs.google.com/a/squareup.com/document/d/1k0Wgi2wnJPQoyDyReb9dyIqRrD8-v0u8hz37S282ii4/edit\n+// for the terminology.\n+\n+package api\n+\n+// SeriesType is a different aspect of data.\n+// For example, Blueflood may stores (min / max / average / count) during rollups,\n+// and these data are exposed via columns\n+type SeriesType string\n+\n+// SampleMethod determines how the given time series should be sampled.\n+type SampleMethod int\n+\n+const (\n+\t// SamplingMax chooses the maximum value.\n+\tSampleMax SampleMethod = iota + 1","path":"api/sample_method.go","position":32,"original_position":32,"commit_id":"4cdb3fba89b5589381830ca568768d626c9bada5","original_commit_id":"4cdb3fba89b5589381830ca568768d626c9bada5","user":{"login":"jeeyoungk","id":232784,"avatar_url":"https://avatars.githubusercontent.com/u/232784?v=3","gravatar_id":"","url":"https://api.github.com/users/jeeyoungk","html_url":"https://github.com/jeeyoungk","followers_url":"https://api.github.com/users/jeeyoungk/followers","following_url":"https://api.github.com/users/jeeyoungk/following{/other_user}","gists_url":"https://api.github.com/users/jeeyoungk/gists{/gist_id}","starred_url":"https://api.github.com/users/jeeyoungk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeeyoungk/subscriptions","organizations_url":"https://api.github.com/users/jeeyoungk/orgs","repos_url":"https://api.github.com/users/jeeyoungk/repos","events_url":"https://api.github.com/users/jeeyoungk/events{/privacy}","received_events_url":"https://api.github.com/users/jeeyoungk/received_events","type":"User","site_admin":false},"body":"yes that was done on purpose.","created_at":"2015-09-03T01:22:54Z","updated_at":"2015-09-03T01:22:54Z","html_url":"https://github.com/square/metrics/pull/199#discussion_r38605043","pull_request_url":"https://api.github.com/repos/square/metrics/pulls/199","_links":{"self":{"href":"https://api.github.com/repos/square/metrics/pulls/comments/38605043"},"html":{"href":"https://github.com/square/metrics/pull/199#discussion_r38605043"},"pull_request":{"href":"https://api.github.com/repos/square/metrics/pulls/199"}}},"pull_request":{"url":"https://api.github.com/repos/square/metrics/pulls/199","id":44047983,"html_url":"https://github.com/square/metrics/pull/199","diff_url":"https://github.com/square/metrics/pull/199.diff","patch_url":"https://github.com/square/metrics/pull/199.patch","issue_url":"https://api.github.com/repos/square/metrics/issues/199","number":199,"state":"open","locked":false,"title":"Rename components and annotate","user":{"login":"cchandler","id":26321,"avatar_url":"https://avatars.githubusercontent.com/u/26321?v=3","gravatar_id":"","url":"https://api.github.com/users/cchandler","html_url":"https://github.com/cchandler","followers_url":"https://api.github.com/users/cchandler/followers","following_url":"https://api.github.com/users/cchandler/following{/other_user}","gists_url":"https://api.github.com/users/cchandler/gists{/gist_id}","starred_url":"https://api.github.com/users/cchandler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cchandler/subscriptions","organizations_url":"https://api.github.com/users/cchandler/orgs","repos_url":"https://api.github.com/users/cchandler/repos","events_url":"https://api.github.com/users/cchandler/events{/privacy}","received_events_url":"https://api.github.com/users/cchandler/received_events","type":"User","site_admin":false},"body":"These are the changes @cuzelac  + @cchandler have been working on. This is entirely to make the actual larger changes coming, easier. No tests were modified except where absolutely necessary to mesh with the new APIs. A few tests were discovered to not actually cover anything and so it's possible we've introduced some problems. Starting tomorrow we're going to create a branch on our internal(stash) repos that merge these changes in. We won't merge here until those match so we can do it mostly-atomically. Talk to either me or cu if you have questions.\r\n\r\nI'm sorry. I'm sorry. I'm sorry. I'm sorry. But it's happening.\r\n\r\n---\r\n\r\nNO TESTS WERE CHANGED. This is strictly a structural remap so we can start introducing changes.\r\n\r\nWider changes:\r\n* Mostly renamed stuff.\r\n* Anywhere that used a singular/sequential Backend now uses the parallel one\r\n\r\nSpecifics:\r\n* api/api -> gone. Moved to individual pieces\r\n* api/backend -> gone. Moved to individual pieces\r\n* api/backend/blueflood -> timeseries_storage/blueflood\r\n* api/backend/multibackend -> ParallelTimeseriesStorageWrapper and the sequential/singular removed.\r\n& api/backend/multibackend -> Added guard condition if a Cancellable was not included. Induces panic.\r\n* api/backend/multibackend -> ProfilingBackend became the ProfilingMultiTimeseriesStorageWrapper\r\n* api/errors -> Errors grouped with their segment APIs\r\n* api/metric_metadata_api -> New API along with ProfilingMetricMetadataAPI\r\n* api/timeseries_storage_api -> New API\r\n* api/timeseries_storage_api -> Old BackendErrorCode now TimeseriesStorageErrorCode\r\n* api/types.go -> Moved to individual files for testability\r\n* assert -> moved to testing_support/assert. No changes.\r\n* most of function package -> Just updated tests\r\n* internal/api.go -> Renamed to cassandra since that's all it implemented\r\n* internal/api.go -> Moved all mentions of graphite to package util and implemented a graphite rule converter\r\n* internal/errors.go -> Errors moved to util because they corresponded with graphite rules\r\n* internal/rules.go -> moved to util\r\n* main/build_mains -> Changed to correctly cd into each directory and build main\r\n* main/* -> Updated for new names/paths\r\n* mocks/* -> Moved to testing_support/mocks\r\n* testing_support/mocks -> Added 'AddPairWithoutGraphite' and 'AddPair'. Now that graphite converter is its own thing, this messy hack was left as a way to also update the graphite converter along with the metadata API in testing. This will change.\r\n* query -> Updated for new names/paths\r\n* query/inspect_test.go -> This appears to have always been broken... Added notes about fixing it.\r\n* test_all.sh -> Wrote a script to go through every directory with go files and run the tests\r\n* timeseries_storage/blueflood -> Blueflood's config now takes a GraphiteConverter because the MetricMetadataAPI no longer provides it and thus cannot be reached via the FetchTimeseries* Request objects. But it's required, because we don't actually have a generic blueflood implementation- graphite names must be reconstructed at query time.\r\n* util/graphite_converter -> New graphite converter that takes []string and produces api.TaggedMetric and in reverse. This didn't make sense as part of a generic MetricMetadataAPI and is going to be phased out into a util/contrib package. At some point we have to remove references for this from the blueflood implementation.","created_at":"2015-09-02T21:59:32Z","updated_at":"2015-09-03T01:22:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0a8483033fec3967981e0c9eb9ab2fce0b005eaf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/square/metrics/pulls/199/commits","review_comments_url":"https://api.github.com/repos/square/metrics/pulls/199/comments","review_comment_url":"https://api.github.com/repos/square/metrics/pulls/comments{/number}","comments_url":"https://api.github.com/repos/square/metrics/issues/199/comments","statuses_url":"https://api.github.com/repos/square/metrics/statuses/4cdb3fba89b5589381830ca568768d626c9bada5","head":{"label":"square:cchandler-components","ref":"cchandler-components","sha":"4cdb3fba89b5589381830ca568768d626c9bada5","user":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"repo":{"id":34279409,"name":"metrics","full_name":"square/metrics","owner":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/square/metrics","description":"Metrics Query Engine","fork":false,"url":"https://api.github.com/repos/square/metrics","forks_url":"https://api.github.com/repos/square/metrics/forks","keys_url":"https://api.github.com/repos/square/metrics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/square/metrics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/square/metrics/teams","hooks_url":"https://api.github.com/repos/square/metrics/hooks","issue_events_url":"https://api.github.com/repos/square/metrics/issues/events{/number}","events_url":"https://api.github.com/repos/square/metrics/events","assignees_url":"https://api.github.com/repos/square/metrics/assignees{/user}","branches_url":"https://api.github.com/repos/square/metrics/branches{/branch}","tags_url":"https://api.github.com/repos/square/metrics/tags","blobs_url":"https://api.github.com/repos/square/metrics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/square/metrics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/square/metrics/git/refs{/sha}","trees_url":"https://api.github.com/repos/square/metrics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/square/metrics/statuses/{sha}","languages_url":"https://api.github.com/repos/square/metrics/languages","stargazers_url":"https://api.github.com/repos/square/metrics/stargazers","contributors_url":"https://api.github.com/repos/square/metrics/contributors","subscribers_url":"https://api.github.com/repos/square/metrics/subscribers","subscription_url":"https://api.github.com/repos/square/metrics/subscription","commits_url":"https://api.github.com/repos/square/metrics/commits{/sha}","git_commits_url":"https://api.github.com/repos/square/metrics/git/commits{/sha}","comments_url":"https://api.github.com/repos/square/metrics/comments{/number}","issue_comment_url":"https://api.github.com/repos/square/metrics/issues/comments{/number}","contents_url":"https://api.github.com/repos/square/metrics/contents/{+path}","compare_url":"https://api.github.com/repos/square/metrics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/square/metrics/merges","archive_url":"https://api.github.com/repos/square/metrics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/square/metrics/downloads","issues_url":"https://api.github.com/repos/square/metrics/issues{/number}","pulls_url":"https://api.github.com/repos/square/metrics/pulls{/number}","milestones_url":"https://api.github.com/repos/square/metrics/milestones{/number}","notifications_url":"https://api.github.com/repos/square/metrics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/square/metrics/labels{/name}","releases_url":"https://api.github.com/repos/square/metrics/releases{/id}","created_at":"2015-04-20T18:43:35Z","updated_at":"2015-09-01T11:07:37Z","pushed_at":"2015-09-02T21:59:32Z","git_url":"git://github.com/square/metrics.git","ssh_url":"git@github.com:square/metrics.git","clone_url":"https://github.com/square/metrics.git","svn_url":"https://github.com/square/metrics","homepage":"","size":3753,"stargazers_count":22,"watchers_count":22,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":5,"forks":6,"open_issues":5,"watchers":22,"default_branch":"master"}},"base":{"label":"square:master","ref":"master","sha":"e77c0c21ee6c1965062e1f2db8fe961bee2ca531","user":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"repo":{"id":34279409,"name":"metrics","full_name":"square/metrics","owner":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/square/metrics","description":"Metrics Query Engine","fork":false,"url":"https://api.github.com/repos/square/metrics","forks_url":"https://api.github.com/repos/square/metrics/forks","keys_url":"https://api.github.com/repos/square/metrics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/square/metrics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/square/metrics/teams","hooks_url":"https://api.github.com/repos/square/metrics/hooks","issue_events_url":"https://api.github.com/repos/square/metrics/issues/events{/number}","events_url":"https://api.github.com/repos/square/metrics/events","assignees_url":"https://api.github.com/repos/square/metrics/assignees{/user}","branches_url":"https://api.github.com/repos/square/metrics/branches{/branch}","tags_url":"https://api.github.com/repos/square/metrics/tags","blobs_url":"https://api.github.com/repos/square/metrics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/square/metrics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/square/metrics/git/refs{/sha}","trees_url":"https://api.github.com/repos/square/metrics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/square/metrics/statuses/{sha}","languages_url":"https://api.github.com/repos/square/metrics/languages","stargazers_url":"https://api.github.com/repos/square/metrics/stargazers","contributors_url":"https://api.github.com/repos/square/metrics/contributors","subscribers_url":"https://api.github.com/repos/square/metrics/subscribers","subscription_url":"https://api.github.com/repos/square/metrics/subscription","commits_url":"https://api.github.com/repos/square/metrics/commits{/sha}","git_commits_url":"https://api.github.com/repos/square/metrics/git/commits{/sha}","comments_url":"https://api.github.com/repos/square/metrics/comments{/number}","issue_comment_url":"https://api.github.com/repos/square/metrics/issues/comments{/number}","contents_url":"https://api.github.com/repos/square/metrics/contents/{+path}","compare_url":"https://api.github.com/repos/square/metrics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/square/metrics/merges","archive_url":"https://api.github.com/repos/square/metrics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/square/metrics/downloads","issues_url":"https://api.github.com/repos/square/metrics/issues{/number}","pulls_url":"https://api.github.com/repos/square/metrics/pulls{/number}","milestones_url":"https://api.github.com/repos/square/metrics/milestones{/number}","notifications_url":"https://api.github.com/repos/square/metrics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/square/metrics/labels{/name}","releases_url":"https://api.github.com/repos/square/metrics/releases{/id}","created_at":"2015-04-20T18:43:35Z","updated_at":"2015-09-01T11:07:37Z","pushed_at":"2015-09-02T21:59:32Z","git_url":"git://github.com/square/metrics.git","ssh_url":"git@github.com:square/metrics.git","clone_url":"https://github.com/square/metrics.git","svn_url":"https://github.com/square/metrics","homepage":"","size":3753,"stargazers_count":22,"watchers_count":22,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":5,"forks":6,"open_issues":5,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/square/metrics/pulls/199"},"html":{"href":"https://github.com/square/metrics/pull/199"},"issue":{"href":"https://api.github.com/repos/square/metrics/issues/199"},"comments":{"href":"https://api.github.com/repos/square/metrics/issues/199/comments"},"review_comments":{"href":"https://api.github.com/repos/square/metrics/pulls/199/comments"},"review_comment":{"href":"https://api.github.com/repos/square/metrics/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/square/metrics/pulls/199/commits"},"statuses":{"href":"https://api.github.com/repos/square/metrics/statuses/4cdb3fba89b5589381830ca568768d626c9bada5"}}}}