{"action":"created","comment":{"url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/comments/70554343","id":70554343,"diff_hunk":"@@ -0,0 +1,68 @@\n+package edu.wpi.grip.core.metrics;\n+\n+import org.junit.Test;\n+\n+import static org.junit.Assert.assertEquals;\n+import static org.junit.Assert.fail;\n+\n+/**\n+ * Tests for {@link MovingAverage}.\n+ */\n+public class MovingAverageTest {\n+\n+  @Test(expected = IllegalArgumentException.class)\n+  public void testNegativeWindowSize() {\n+    new MovingAverage(-1);\n+    fail(\"Negative window size should error\");\n+  }\n+\n+  @Test(expected = IllegalArgumentException.class)\n+  public void testZeroWindowSize() {\n+    new MovingAverage(0);\n+    fail(\"Zero window size should error\");\n+  }\n+\n+  @Test\n+  public void testAverageSingle() {\n+    MovingAverage a = new MovingAverage(1);\n+    double value = 123;\n+    double average = a.average(value);\n+    assertEquals(value, average, 0);\n+  }\n+\n+  @Test\n+  public void testAverageMulti() {\n+    MovingAverage a = new MovingAverage(5);\n+    double[] values = {1, 2, 3, 4, 5};\n+    double avg = 0;\n+    for (double d : values) {\n+      avg = a.average(d);\n+    }\n+    assertEquals(3, avg, 0);\n+  }\n+\n+  @Test\n+  public void testMoving() {\n+    MovingAverage a = new MovingAverage(2);\n+    double average;\n+    a.average(1);\n+    average = a.average(2);\n+    assertEquals(1.5, average, 0);\n+    average = a.average(3);\n+    assertEquals(2.5, average, 0);","path":"core/src/test/java/edu/wpi/grip/core/metrics/MovingAverageTest.java","position":52,"original_position":52,"commit_id":"c79f8c3a7f375f6c2c0ca6a3fb735d6c74d13135","original_commit_id":"c79f8c3a7f375f6c2c0ca6a3fb735d6c74d13135","user":{"login":"codacy-bot","id":19940114,"avatar_url":"https://avatars.githubusercontent.com/u/19940114?v=3","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [JUnit assertions should include a message](https://www.codacy.com/app/WPIRoboticsProjects/GRIP/file/2975744327/issues/source?bid=2943107&fileBranchId=3413130#l52)","created_at":"2016-07-13T01:55:24Z","updated_at":"2016-07-13T01:55:24Z","html_url":"https://github.com/WPIRoboticsProjects/GRIP/pull/613#discussion_r70554343","pull_request_url":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/613","_links":{"self":{"href":"https://api.github.com/repos/WPIRoboticsProjects/GRIP/pulls/comments/70554343"},"html":{"href":"https://github.com/WPIRoboticsProjects/GRIP/pull/613#discussion_r70554343"},"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![Sample pipeline](https://cloud.githubusercontent.com/assets/6320992/16660803/e9722c18-443d-11e6-8e1f-9a0fb24a2c9a.png)","created_at":"2016-07-07T15:28:59Z","updated_at":"2016-07-13T01:55:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0b4945b53b39efe065da0993a372231bf9aa478b","assignee":null,"assignees":[],"milestone":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/c79f8c3a7f375f6c2c0ca6a3fb735d6c74d13135","head":{"label":"SamCarlberg:feat/timing","ref":"feat/timing","sha":"c79f8c3a7f375f6c2c0ca6a3fb735d6c74d13135","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-07-13T01:52:56Z","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":41315,"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":"b3ff91c02eb84b31158a2546c7e740a6ef76b068","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-06-06T10:25:39Z","pushed_at":"2016-07-13T01:52:57Z","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":52345,"stargazers_count":105,"watchers_count":105,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":50,"mirror_url":null,"open_issues_count":105,"forks":50,"open_issues":105,"watchers":105,"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/c79f8c3a7f375f6c2c0ca6a3fb735d6c74d13135"}}}}
{"actor":{"display_login":"codacy-bot"}}