{"action":"created","comment":{"url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/comments/82311987","pull_request_review_id":3229614,"id":82311987,"diff_hunk":"@@ -0,0 +1,119 @@\n+package edu.wpi.grip.core.metrics;\n+\n+import com.google.common.base.MoreObjects;\n+\n+import javax.annotation.concurrent.Immutable;\n+\n+import static com.google.common.base.Preconditions.checkNotNull;\n+\n+/**\n+ * Statistics analysis. Contains:\n+ * <ul>\n+ * <li>Number of samples ({@code n})</li>\n+ * <li>Mean value ({@code mean})</li>\n+ * <li>Standard deviation ({@code s})</li>\n+ * </ul>\n+ */\n+@Immutable\n+public final class Statistics {\n+\n+  private final int n;\n+  private final double sum;\n+  private final double mean;\n+  private final double s;\n+\n+  /**\n+   * \"null\" statistics with every value set to zero.\n+   */\n+  public static final Statistics NIL = new Statistics(0, 0, 0, 0);\n+\n+  /**\n+   * Calculates the statistics of the given samples.\n+   *\n+   * @param samples the samples to analyze\n+   * @return a statistical analysis of the given samples\n+   */\n+  public static Statistics of(double... samples) {\n+    checkNotNull(samples);\n+    final int n = samples.length;\n+    double sum = 0;\n+    for (double d : samples) {\n+      sum += d;\n+    }\n+    final double mean = n == 0 ? 0 : sum / n;\n+    double variance = 0;\n+    for (double d : samples) {\n+      variance += ((d - mean) * (d - mean)) / n;\n+    }\n+    final double s = Math.sqrt(variance);\n+    return new Statistics(n, sum, mean, s);\n+  }\n+\n+  private Statistics(int n, double sum, double mean, double s) {\n+    this.n = n;\n+    this.sum = sum;\n+    this.mean = mean;\n+    this.s = s;\n+  }\n+\n+  @Override\n+  public String toString() {\n+    return MoreObjects.toStringHelper(this)\n+        .add(\"n\", n)\n+        .add(\"mean\", mean)\n+        .add(\"s\", s)\n+        .toString();\n+  }\n+\n+  /**\n+   * Gets the number of samples.\n+   */\n+  public int getN() {\n+    return n;\n+  }\n+\n+  /**\n+   * Gets the sum of all the samples.\n+   */\n+  public double getSum() {\n+    return sum;\n+  }\n+\n+  /**\n+   * Gets the arithmetic mean of the samples.\n+   */\n+  public double getMean() {\n+    return mean;\n+  }\n+\n+  /**\n+   * Gets the standard deviation in the samples.\n+   */\n+  public double getStandardDeviation() {\n+    return s;\n+  }\n+\n+  /**\n+   * Calculates the 'hotness' of the given value based on these statistics. Using a {@code value}\n+   * that is not in the data set used to create these statistics will most likely have a useless\n+   * result.\n+   *\n+   * <p>If this set of statistics was calculated from less than two data points, 'hotness' doesn't\n+   * mean anything and this method will always return zero.\n+   *\n+   * @param value the value to calculate the hotness of\n+   * @return the hotness of the given value.\n+   */\n+  public double hotness(double value) {","path":"core/src/main/java/edu/wpi/grip/core/metrics/Statistics.java","position":107,"original_position":107,"commit_id":"7c3b79d005e3f28c63d3c565c17c70d8eab163ad","original_commit_id":"7c3b79d005e3f28c63d3c565c17c70d8eab163ad","user":{"login":"SamCarlberg","id":6320992,"avatar_url":"https://avatars.githubusercontent.com/u/6320992?v=3","gravatar_id":"","url":"https://api.github.com/users/SamCarlberg","html_url":"https://github.com/SamCarlberg","followers_url":"https://api.github.com/users/SamCarlberg/followers","following_url":"https://api.github.com/users/SamCarlberg/following{/other_user}","gists_url":"https://api.github.com/users/SamCarlberg/gists{/gist_id}","starred_url":"https://api.github.com/users/SamCarlberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamCarlberg/subscriptions","organizations_url":"https://api.github.com/users/SamCarlberg/orgs","repos_url":"https://api.github.com/users/SamCarlberg/repos","events_url":"https://api.github.com/users/SamCarlberg/events{/privacy}","received_events_url":"https://api.github.com/users/SamCarlberg/received_events","type":"User","site_admin":false},"body":"Hotness can be any number >= 0. The current implementation is just the number of standard deviations above the mean","created_at":"2016-10-07T00:24:48Z","updated_at":"2016-10-07T00:24:48Z","html_url":"https://github.com/WPIRoboticsProjects/GRIP/pull/613#discussion_r82311987","pull_request_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/613","_links":{"self":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/comments/82311987"},"html":{"href":"https://github.com/WPIRoboticsProjects/GRIP/pull/613#discussion_r82311987"},"pull_request":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/613"}}},"pull_request":{"url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/613","id":76615678,"html_url":"https://github.com/WPIRoboticsProjects/GRIP/pull/613","diff_url":"https://github.com/WPIRoboticsProjects/GRIP/pull/613.diff","patch_url":"https://github.com/WPIRoboticsProjects/GRIP/pull/613.patch","issue_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/613","number":613,"state":"open","locked":false,"title":"Add support for timing steps and pipelines","user":{"login":"SamCarlberg","id":6320992,"avatar_url":"https://avatars.githubusercontent.com/u/6320992?v=3","gravatar_id":"","url":"https://api.github.com/users/SamCarlberg","html_url":"https://github.com/SamCarlberg","followers_url":"https://api.github.com/users/SamCarlberg/followers","following_url":"https://api.github.com/users/SamCarlberg/following{/other_user}","gists_url":"https://api.github.com/users/SamCarlberg/gists{/gist_id}","starred_url":"https://api.github.com/users/SamCarlberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamCarlberg/subscriptions","organizations_url":"https://api.github.com/users/SamCarlberg/orgs","repos_url":"https://api.github.com/users/SamCarlberg/repos","events_url":"https://api.github.com/users/SamCarlberg/events{/privacy}","received_events_url":"https://api.github.com/users/SamCarlberg/received_events","type":"User","site_admin":false},"body":"This lets users know which parts of their pipelines take the most time, and how long the pipeline takes as a whole.\r\n\r\n![timing-and-analysis.png](https://cloud.githubusercontent.com/assets/6320992/16816075/7ff4e9ca-490a-11e6-862d-8e6b13366d60.png)\r\n","created_at":"2016-07-07T15:28:59Z","updated_at":"2016-10-07T00:24:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"df920a7ea3a9cc82a595b2ab0ab7e86a8de28d66","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/milestones/9","html_url":"https://github.com/WPIRoboticsProjects/GRIP/milestones/v1.5.0","labels_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/milestones/9/labels","id":1912209,"number":9,"title":"v1.5.0","description":"","creator":{"login":"AustinShalit","id":3799260,"avatar_url":"https://avatars.githubusercontent.com/u/3799260?v=3","gravatar_id":"","url":"https://api.github.com/users/AustinShalit","html_url":"https://github.com/AustinShalit","followers_url":"https://api.github.com/users/AustinShalit/followers","following_url":"https://api.github.com/users/AustinShalit/following{/other_user}","gists_url":"https://api.github.com/users/AustinShalit/gists{/gist_id}","starred_url":"https://api.github.com/users/AustinShalit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AustinShalit/subscriptions","organizations_url":"https://api.github.com/users/AustinShalit/orgs","repos_url":"https://api.github.com/users/AustinShalit/repos","events_url":"https://api.github.com/users/AustinShalit/events{/privacy}","received_events_url":"https://api.github.com/users/AustinShalit/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":63,"state":"open","created_at":"2016-07-29T16:52:36Z","updated_at":"2016-10-06T18:39:16Z","due_on":"2016-10-08T00:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/613/commits","review_comments_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/613/comments","review_comment_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/613/comments","statuses_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/statuses/7c3b79d005e3f28c63d3c565c17c70d8eab163ad","head":{"label":"SamCarlberg:feat/timing","ref":"feat/timing","sha":"7c3b79d005e3f28c63d3c565c17c70d8eab163ad","user":{"login":"SamCarlberg","id":6320992,"avatar_url":"https://avatars.githubusercontent.com/u/6320992?v=3","gravatar_id":"","url":"https://api.github.com/users/SamCarlberg","html_url":"https://github.com/SamCarlberg","followers_url":"https://api.github.com/users/SamCarlberg/followers","following_url":"https://api.github.com/users/SamCarlberg/following{/other_user}","gists_url":"https://api.github.com/users/SamCarlberg/gists{/gist_id}","starred_url":"https://api.github.com/users/SamCarlberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamCarlberg/subscriptions","organizations_url":"https://api.github.com/users/SamCarlberg/orgs","repos_url":"https://api.github.com/users/SamCarlberg/repos","events_url":"https://api.github.com/users/SamCarlberg/events{/privacy}","received_events_url":"https://api.github.com/users/SamCarlberg/received_events","type":"User","site_admin":false},"repo":{"id":54142171,"name":"GRIP","full_name":"SamCarlberg/GRIP","owner":{"login":"SamCarlberg","id":6320992,"avatar_url":"https://avatars.githubusercontent.com/u/6320992?v=3","gravatar_id":"","url":"https://api.github.com/users/SamCarlberg","html_url":"https://github.com/SamCarlberg","followers_url":"https://api.github.com/users/SamCarlberg/followers","following_url":"https://api.github.com/users/SamCarlberg/following{/other_user}","gists_url":"https://api.github.com/users/SamCarlberg/gists{/gist_id}","starred_url":"https://api.github.com/users/SamCarlberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamCarlberg/subscriptions","organizations_url":"https://api.github.com/users/SamCarlberg/orgs","repos_url":"https://api.github.com/users/SamCarlberg/repos","events_url":"https://api.github.com/users/SamCarlberg/events{/privacy}","received_events_url":"https://api.github.com/users/SamCarlberg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SamCarlberg/GRIP","description":"Program for rapidly developing computer vision applications","fork":true,"url":"https://api.github.com/repos/SamCarlberg/GRIP","forks_url":"https://api.github.com/repos/SamCarlberg/GRIP/forks","keys_url":"https://api.github.com/repos/SamCarlberg/GRIP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SamCarlberg/GRIP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SamCarlberg/GRIP/teams","hooks_url":"https://api.github.com/repos/SamCarlberg/GRIP/hooks","issue_events_url":"https://api.github.com/repos/SamCarlberg/GRIP/issues/events{/number}","events_url":"https://api.github.com/repos/SamCarlberg/GRIP/events","assignees_url":"https://api.github.com/repos/SamCarlberg/GRIP/assignees{/user}","branches_url":"https://api.github.com/repos/SamCarlberg/GRIP/branches{/branch}","tags_url":"https://api.github.com/repos/SamCarlberg/GRIP/tags","blobs_url":"https://api.github.com/repos/SamCarlberg/GRIP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SamCarlberg/GRIP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SamCarlberg/GRIP/git/refs{/sha}","trees_url":"https://api.github.com/repos/SamCarlberg/GRIP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SamCarlberg/GRIP/statuses/{sha}","languages_url":"https://api.github.com/repos/SamCarlberg/GRIP/languages","stargazers_url":"https://api.github.com/repos/SamCarlberg/GRIP/stargazers","contributors_url":"https://api.github.com/repos/SamCarlberg/GRIP/contributors","subscribers_url":"https://api.github.com/repos/SamCarlberg/GRIP/subscribers","subscription_url":"https://api.github.com/repos/SamCarlberg/GRIP/subscription","commits_url":"https://api.github.com/repos/SamCarlberg/GRIP/commits{/sha}","git_commits_url":"https://api.github.com/repos/SamCarlberg/GRIP/git/commits{/sha}","comments_url":"https://api.github.com/repos/SamCarlberg/GRIP/comments{/number}","issue_comment_url":"https://api.github.com/repos/SamCarlberg/GRIP/issues/comments{/number}","contents_url":"https://api.github.com/repos/SamCarlberg/GRIP/contents/{+path}","compare_url":"https://api.github.com/repos/SamCarlberg/GRIP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SamCarlberg/GRIP/merges","archive_url":"https://api.github.com/repos/SamCarlberg/GRIP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SamCarlberg/GRIP/downloads","issues_url":"https://api.github.com/repos/SamCarlberg/GRIP/issues{/number}","pulls_url":"https://api.github.com/repos/SamCarlberg/GRIP/pulls{/number}","milestones_url":"https://api.github.com/repos/SamCarlberg/GRIP/milestones{/number}","notifications_url":"https://api.github.com/repos/SamCarlberg/GRIP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SamCarlberg/GRIP/labels{/name}","releases_url":"https://api.github.com/repos/SamCarlberg/GRIP/releases{/id}","deployments_url":"https://api.github.com/repos/SamCarlberg/GRIP/deployments","created_at":"2016-03-17T18:30:55Z","updated_at":"2016-03-17T18:30:56Z","pushed_at":"2016-10-06T18:58:15Z","git_url":"git://github.com/SamCarlberg/GRIP.git","ssh_url":"git@github.com:SamCarlberg/GRIP.git","clone_url":"https://github.com/SamCarlberg/GRIP.git","svn_url":"https://github.com/SamCarlberg/GRIP","homepage":"http://wpiroboticsprojects.github.io/GRIP","size":20785,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"WPIRoboticsProjects:master","ref":"master","sha":"953c09e31ec6fa433e526d9b8312c768d6f08d5b","user":{"login":"WPIRoboticsProjects","id":14004340,"avatar_url":"https://avatars.githubusercontent.com/u/14004340?v=3","gravatar_id":"","url":"https://api.github.com/users/WPIRoboticsProjects","html_url":"https://github.com/WPIRoboticsProjects","followers_url":"https://api.github.com/users/WPIRoboticsProjects/followers","following_url":"https://api.github.com/users/WPIRoboticsProjects/following{/other_user}","gists_url":"https://api.github.com/users/WPIRoboticsProjects/gists{/gist_id}","starred_url":"https://api.github.com/users/WPIRoboticsProjects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WPIRoboticsProjects/subscriptions","organizations_url":"https://api.github.com/users/WPIRoboticsProjects/orgs","repos_url":"https://api.github.com/users/WPIRoboticsProjects/repos","events_url":"https://api.github.com/users/WPIRoboticsProjects/events{/privacy}","received_events_url":"https://api.github.com/users/WPIRoboticsProjects/received_events","type":"Organization","site_admin":false},"repo":{"id":41505521,"name":"GRIP","full_name":"WPIRoboticsProjects/GRIP","owner":{"login":"WPIRoboticsProjects","id":14004340,"avatar_url":"https://avatars.githubusercontent.com/u/14004340?v=3","gravatar_id":"","url":"https://api.github.com/users/WPIRoboticsProjects","html_url":"https://github.com/WPIRoboticsProjects","followers_url":"https://api.github.com/users/WPIRoboticsProjects/followers","following_url":"https://api.github.com/users/WPIRoboticsProjects/following{/other_user}","gists_url":"https://api.github.com/users/WPIRoboticsProjects/gists{/gist_id}","starred_url":"https://api.github.com/users/WPIRoboticsProjects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WPIRoboticsProjects/subscriptions","organizations_url":"https://api.github.com/users/WPIRoboticsProjects/orgs","repos_url":"https://api.github.com/users/WPIRoboticsProjects/repos","events_url":"https://api.github.com/users/WPIRoboticsProjects/events{/privacy}","received_events_url":"https://api.github.com/users/WPIRoboticsProjects/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WPIRoboticsProjects/GRIP","description":"Program for rapidly developing computer vision applications","fork":false,"url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP","forks_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/forks","keys_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/teams","hooks_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/hooks","issue_events_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/events{/number}","events_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/events","assignees_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/assignees{/user}","branches_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/branches{/branch}","tags_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/tags","blobs_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/refs{/sha}","trees_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/statuses/{sha}","languages_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/languages","stargazers_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/stargazers","contributors_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/contributors","subscribers_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/subscribers","subscription_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/subscription","commits_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/commits{/sha}","git_commits_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/git/commits{/sha}","comments_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/comments{/number}","issue_comment_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/comments{/number}","contents_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/contents/{+path}","compare_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/merges","archive_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/downloads","issues_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues{/number}","pulls_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls{/number}","milestones_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/milestones{/number}","notifications_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/labels{/name}","releases_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/releases{/id}","deployments_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/deployments","created_at":"2015-08-27T18:59:07Z","updated_at":"2016-10-05T20:09:26Z","pushed_at":"2016-10-06T19:00:26Z","git_url":"git://github.com/WPIRoboticsProjects/GRIP.git","ssh_url":"git@github.com:WPIRoboticsProjects/GRIP.git","clone_url":"https://github.com/WPIRoboticsProjects/GRIP.git","svn_url":"https://github.com/WPIRoboticsProjects/GRIP","homepage":"http://wpiroboticsprojects.github.io/GRIP","size":59422,"stargazers_count":118,"watchers_count":118,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":52,"mirror_url":null,"open_issues_count":90,"forks":52,"open_issues":90,"watchers":118,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/613"},"html":{"href":"https://github.com/WPIRoboticsProjects/GRIP/pull/613"},"issue":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/613"},"comments":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/issues/613/comments"},"review_comments":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/613/comments"},"review_comment":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/613/commits"},"statuses":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/statuses/7c3b79d005e3f28c63d3c565c17c70d8eab163ad"}}}}
{"actor":{"display_login":"SamCarlberg"}}