{"action":"created","comment":{"url":"https://api.github.com/repos/google/instrumentation-java/pulls/comments/89255237","pull_request_review_id":9801861,"id":89255237,"diff_hunk":"@@ -0,0 +1,148 @@\n+/*\n+ * Copyright 2016, Google Inc.\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+ *     http://www.apache.org/licenses/LICENSE-2.0\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+\n+package com.google.instrumentation.stats;\n+\n+import com.google.instrumentation.common.Duration;\n+import com.google.instrumentation.common.MatchFunction;\n+\n+import java.util.ArrayList;\n+import java.util.Collections;\n+import java.util.List;\n+import javax.annotation.Nullable;\n+\n+/**\n+ * An {@link AggregationDescriptor} describes an Aggregation, which is a series of individual\n+ * measurements.\n+ */\n+public abstract class AggregationDescriptor {\n+  /**\n+   * Applies the given match function to the underlying data type.\n+   */\n+  public abstract <T> T match(\n+      MatchFunction<DistributionAggregationDescriptor, T> p0,\n+      MatchFunction<IntervalAggregationDescriptor, T> p1);\n+\n+  // Seals the disjoint union.\n+  private AggregationDescriptor() {\n+  }\n+\n+  /**\n+   * An {@link AggregationDescriptor} based on distributions.\n+   *\n+   * <p>A distribution aggregation may optionally contain a histogram of the values in the\n+   * population. The bucket boundaries for that histogram are described by\n+   * {@link getBucketBoundaries}, which defines {@code getBucketBoundaries.size() + 1 (= N)}\n+   * buckets. The boundaries for bucket index i are:\n+   * <ul>\n+   * <li>[-infinity, bounds[i]) for i == 0\n+   * <li>[bounds[i-1], bounds[i]) for 0 &lt; i &lt; N-2\n+   * <li>[bounds[i-1], +infinity) for i == N-1\n+   * </ul>\n+   * i.e. an underflow bucket (number 0), zero or more finite buckets (1 through N - 2, and an\n+   * overflow bucket (N - 1), with inclusive lower bounds and exclusive upper bounds.\n+   *\n+   * <p>Note: If N = 1, there are no finite buckets and the single bucket is both the overflow\n+   * and underflow bucket.\n+   */\n+  public static final class DistributionAggregationDescriptor extends AggregationDescriptor {\n+    /**\n+     * Constructs a new {@link DistributionAggregationDescriptor}.\n+     */\n+    public static DistributionAggregationDescriptor create(List<Double> bucketBoundaries) {\n+      return new DistributionAggregationDescriptor(\n+          Collections.unmodifiableList(new ArrayList<Double>(bucketBoundaries)));\n+    }\n+\n+    /**\n+     * Constructs a new {@link DistributionAggregationDescriptor} without the optional\n+     * histogram bucket boundaries.\n+     */\n+    public static DistributionAggregationDescriptor create() {\n+      return new DistributionAggregationDescriptor(null);\n+    }\n+\n+    /**\n+     * The (possibly null) histogram bucket boundaries for a distribution.\n+     *\n+     * <p>Note: The returned list is unmodifiable, attempts to update it will throw an\n+     * UnsupportedOperationException.\n+     */\n+    @Nullable\n+    public List<Double> getBucketBoundaries() {","path":"core/java/com/google/instrumentation/stats/AggregationDescriptor.java","position":82,"original_position":82,"commit_id":"cf9c9718196f2541866e3c3a9594166c2d2d0adc","original_commit_id":"cf9c9718196f2541866e3c3a9594166c2d2d0adc","user":{"login":"sebright","id":19807615,"avatar_url":"https://avatars.githubusercontent.com/u/19807615?v=3","gravatar_id":"","url":"https://api.github.com/users/sebright","html_url":"https://github.com/sebright","followers_url":"https://api.github.com/users/sebright/followers","following_url":"https://api.github.com/users/sebright/following{/other_user}","gists_url":"https://api.github.com/users/sebright/gists{/gist_id}","starred_url":"https://api.github.com/users/sebright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebright/subscriptions","organizations_url":"https://api.github.com/users/sebright/orgs","repos_url":"https://api.github.com/users/sebright/repos","events_url":"https://api.github.com/users/sebright/events{/privacy}","received_events_url":"https://api.github.com/users/sebright/received_events","type":"User","site_admin":false},"body":"When would this be null?","created_at":"2016-11-23T04:24:45Z","updated_at":"2016-11-23T04:24:45Z","html_url":"https://github.com/google/instrumentation-java/pull/52#discussion_r89255237","pull_request_url":"https://api.github.com/repos/google/instrumentation-java/pulls/52","_links":{"self":{"href":"https://api.github.com/repos/google/instrumentation-java/pulls/comments/89255237"},"html":{"href":"https://github.com/google/instrumentation-java/pull/52#discussion_r89255237"},"pull_request":{"href":"https://api.github.com/repos/google/instrumentation-java/pulls/52"}}},"pull_request":{"url":"https://api.github.com/repos/google/instrumentation-java/pulls/52","id":94910181,"html_url":"https://github.com/google/instrumentation-java/pull/52","diff_url":"https://github.com/google/instrumentation-java/pull/52.diff","patch_url":"https://github.com/google/instrumentation-java/pull/52.patch","issue_url":"https://api.github.com/repos/google/instrumentation-java/issues/52","number":52,"state":"open","locked":false,"title":"Adds Aggregation and View descriptor classes.","user":{"login":"dinooliva","id":12284450,"avatar_url":"https://avatars.githubusercontent.com/u/12284450?v=3","gravatar_id":"","url":"https://api.github.com/users/dinooliva","html_url":"https://github.com/dinooliva","followers_url":"https://api.github.com/users/dinooliva/followers","following_url":"https://api.github.com/users/dinooliva/following{/other_user}","gists_url":"https://api.github.com/users/dinooliva/gists{/gist_id}","starred_url":"https://api.github.com/users/dinooliva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinooliva/subscriptions","organizations_url":"https://api.github.com/users/dinooliva/orgs","repos_url":"https://api.github.com/users/dinooliva/repos","events_url":"https://api.github.com/users/dinooliva/events{/privacy}","received_events_url":"https://api.github.com/users/dinooliva/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-22T22:22:27Z","updated_at":"2016-11-23T04:24:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5eb7a4f00fb4d0b32914e00020e5f564ceae1117","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/instrumentation-java/pulls/52/commits","review_comments_url":"https://api.github.com/repos/google/instrumentation-java/pulls/52/comments","review_comment_url":"https://api.github.com/repos/google/instrumentation-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/instrumentation-java/issues/52/comments","statuses_url":"https://api.github.com/repos/google/instrumentation-java/statuses/cf9c9718196f2541866e3c3a9594166c2d2d0adc","head":{"label":"dinooliva:descriptors","ref":"descriptors","sha":"cf9c9718196f2541866e3c3a9594166c2d2d0adc","user":{"login":"dinooliva","id":12284450,"avatar_url":"https://avatars.githubusercontent.com/u/12284450?v=3","gravatar_id":"","url":"https://api.github.com/users/dinooliva","html_url":"https://github.com/dinooliva","followers_url":"https://api.github.com/users/dinooliva/followers","following_url":"https://api.github.com/users/dinooliva/following{/other_user}","gists_url":"https://api.github.com/users/dinooliva/gists{/gist_id}","starred_url":"https://api.github.com/users/dinooliva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinooliva/subscriptions","organizations_url":"https://api.github.com/users/dinooliva/orgs","repos_url":"https://api.github.com/users/dinooliva/repos","events_url":"https://api.github.com/users/dinooliva/events{/privacy}","received_events_url":"https://api.github.com/users/dinooliva/received_events","type":"User","site_admin":false},"repo":{"id":69295290,"name":"instrumentation-java","full_name":"dinooliva/instrumentation-java","owner":{"login":"dinooliva","id":12284450,"avatar_url":"https://avatars.githubusercontent.com/u/12284450?v=3","gravatar_id":"","url":"https://api.github.com/users/dinooliva","html_url":"https://github.com/dinooliva","followers_url":"https://api.github.com/users/dinooliva/followers","following_url":"https://api.github.com/users/dinooliva/following{/other_user}","gists_url":"https://api.github.com/users/dinooliva/gists{/gist_id}","starred_url":"https://api.github.com/users/dinooliva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dinooliva/subscriptions","organizations_url":"https://api.github.com/users/dinooliva/orgs","repos_url":"https://api.github.com/users/dinooliva/repos","events_url":"https://api.github.com/users/dinooliva/events{/privacy}","received_events_url":"https://api.github.com/users/dinooliva/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dinooliva/instrumentation-java","description":"A stats collection framework","fork":true,"url":"https://api.github.com/repos/dinooliva/instrumentation-java","forks_url":"https://api.github.com/repos/dinooliva/instrumentation-java/forks","keys_url":"https://api.github.com/repos/dinooliva/instrumentation-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dinooliva/instrumentation-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dinooliva/instrumentation-java/teams","hooks_url":"https://api.github.com/repos/dinooliva/instrumentation-java/hooks","issue_events_url":"https://api.github.com/repos/dinooliva/instrumentation-java/issues/events{/number}","events_url":"https://api.github.com/repos/dinooliva/instrumentation-java/events","assignees_url":"https://api.github.com/repos/dinooliva/instrumentation-java/assignees{/user}","branches_url":"https://api.github.com/repos/dinooliva/instrumentation-java/branches{/branch}","tags_url":"https://api.github.com/repos/dinooliva/instrumentation-java/tags","blobs_url":"https://api.github.com/repos/dinooliva/instrumentation-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dinooliva/instrumentation-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dinooliva/instrumentation-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/dinooliva/instrumentation-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dinooliva/instrumentation-java/statuses/{sha}","languages_url":"https://api.github.com/repos/dinooliva/instrumentation-java/languages","stargazers_url":"https://api.github.com/repos/dinooliva/instrumentation-java/stargazers","contributors_url":"https://api.github.com/repos/dinooliva/instrumentation-java/contributors","subscribers_url":"https://api.github.com/repos/dinooliva/instrumentation-java/subscribers","subscription_url":"https://api.github.com/repos/dinooliva/instrumentation-java/subscription","commits_url":"https://api.github.com/repos/dinooliva/instrumentation-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/dinooliva/instrumentation-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/dinooliva/instrumentation-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/dinooliva/instrumentation-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/dinooliva/instrumentation-java/contents/{+path}","compare_url":"https://api.github.com/repos/dinooliva/instrumentation-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dinooliva/instrumentation-java/merges","archive_url":"https://api.github.com/repos/dinooliva/instrumentation-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dinooliva/instrumentation-java/downloads","issues_url":"https://api.github.com/repos/dinooliva/instrumentation-java/issues{/number}","pulls_url":"https://api.github.com/repos/dinooliva/instrumentation-java/pulls{/number}","milestones_url":"https://api.github.com/repos/dinooliva/instrumentation-java/milestones{/number}","notifications_url":"https://api.github.com/repos/dinooliva/instrumentation-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dinooliva/instrumentation-java/labels{/name}","releases_url":"https://api.github.com/repos/dinooliva/instrumentation-java/releases{/id}","deployments_url":"https://api.github.com/repos/dinooliva/instrumentation-java/deployments","created_at":"2016-09-26T21:42:20Z","updated_at":"2016-11-10T20:51:33Z","pushed_at":"2016-11-23T01:23:14Z","git_url":"git://github.com/dinooliva/instrumentation-java.git","ssh_url":"git@github.com:dinooliva/instrumentation-java.git","clone_url":"https://github.com/dinooliva/instrumentation-java.git","svn_url":"https://github.com/dinooliva/instrumentation-java","homepage":"","size":231,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"763d2cc2808799870755e574c4ff1149ddbbafb7","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":64431348,"name":"instrumentation-java","full_name":"google/instrumentation-java","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/instrumentation-java","description":"A stats collection framework","fork":false,"url":"https://api.github.com/repos/google/instrumentation-java","forks_url":"https://api.github.com/repos/google/instrumentation-java/forks","keys_url":"https://api.github.com/repos/google/instrumentation-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/instrumentation-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/instrumentation-java/teams","hooks_url":"https://api.github.com/repos/google/instrumentation-java/hooks","issue_events_url":"https://api.github.com/repos/google/instrumentation-java/issues/events{/number}","events_url":"https://api.github.com/repos/google/instrumentation-java/events","assignees_url":"https://api.github.com/repos/google/instrumentation-java/assignees{/user}","branches_url":"https://api.github.com/repos/google/instrumentation-java/branches{/branch}","tags_url":"https://api.github.com/repos/google/instrumentation-java/tags","blobs_url":"https://api.github.com/repos/google/instrumentation-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/instrumentation-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/instrumentation-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/instrumentation-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/instrumentation-java/statuses/{sha}","languages_url":"https://api.github.com/repos/google/instrumentation-java/languages","stargazers_url":"https://api.github.com/repos/google/instrumentation-java/stargazers","contributors_url":"https://api.github.com/repos/google/instrumentation-java/contributors","subscribers_url":"https://api.github.com/repos/google/instrumentation-java/subscribers","subscription_url":"https://api.github.com/repos/google/instrumentation-java/subscription","commits_url":"https://api.github.com/repos/google/instrumentation-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/instrumentation-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/instrumentation-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/instrumentation-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/instrumentation-java/contents/{+path}","compare_url":"https://api.github.com/repos/google/instrumentation-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/instrumentation-java/merges","archive_url":"https://api.github.com/repos/google/instrumentation-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/instrumentation-java/downloads","issues_url":"https://api.github.com/repos/google/instrumentation-java/issues{/number}","pulls_url":"https://api.github.com/repos/google/instrumentation-java/pulls{/number}","milestones_url":"https://api.github.com/repos/google/instrumentation-java/milestones{/number}","notifications_url":"https://api.github.com/repos/google/instrumentation-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/instrumentation-java/labels{/name}","releases_url":"https://api.github.com/repos/google/instrumentation-java/releases{/id}","deployments_url":"https://api.github.com/repos/google/instrumentation-java/deployments","created_at":"2016-07-28T22:10:03Z","updated_at":"2016-11-21T09:46:36Z","pushed_at":"2016-11-23T01:23:14Z","git_url":"git://github.com/google/instrumentation-java.git","ssh_url":"git@github.com:google/instrumentation-java.git","clone_url":"https://github.com/google/instrumentation-java.git","svn_url":"https://github.com/google/instrumentation-java","homepage":"","size":226,"stargazers_count":21,"watchers_count":21,"language":"Java","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":17,"forks":5,"open_issues":17,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/instrumentation-java/pulls/52"},"html":{"href":"https://github.com/google/instrumentation-java/pull/52"},"issue":{"href":"https://api.github.com/repos/google/instrumentation-java/issues/52"},"comments":{"href":"https://api.github.com/repos/google/instrumentation-java/issues/52/comments"},"review_comments":{"href":"https://api.github.com/repos/google/instrumentation-java/pulls/52/comments"},"review_comment":{"href":"https://api.github.com/repos/google/instrumentation-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/instrumentation-java/pulls/52/commits"},"statuses":{"href":"https://api.github.com/repos/google/instrumentation-java/statuses/cf9c9718196f2541866e3c3a9594166c2d2d0adc"}}}}
{"actor":{"display_login":"sebright"}}