{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/mdv2/pulls/comments/200695244","pull_request_review_id":135066268,"id":200695244,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDY5NTI0NA==","diff_hunk":"@@ -6,82 +6,104 @@ import {MetricSelector} from \"./Components/MetricSelector.js\";\n import {VersionSelector} from \"./Components/VersionSelector.js\";\n import {ChannelSelector} from \"./Components/ChannelSelector.js\";\n import metricData from \"./data/metrics.js\";\n+import GC_MS_nightly_62 from \"./data/GC_MS_nightly_62.json\";\n \n class App extends React.Component {\n   constructor(props) {\n     super(props);\n     this.state = {\n-      currentData: [\n-        {\n-          \"start\": 0,\n-          \"end\": 1,\n-          \"count\": 1623,\n-          \"proportion\": 0.000011537046015254444\n-        },\n-        {\n-          \"start\": 1,\n-          \"end\": 2,\n-          \"count\": 41,\n-          \"proportion\": 2.8913714335682874e-7\n-        },\n-        {\n-          \"start\": 2,\n-          \"end\": 3,\n-          \"count\": 201,\n-          \"proportion\": 0.0000014314658572747914\n-        },\n-        {\n-          \"start\": 3,\n-          \"end\": 4,\n-          \"count\": 878,\n-          \"proportion\": 0.000006240148348020738\n-        },\n-        {\n-          \"start\": 4,\n-          \"end\": 5,\n-          \"count\": 2101,\n-          \"proportion\": 0.00001493796241457452\n-        },\n-      ],\n+      currentData: GC_MS_nightly_62,\n       change: \"\",\n-      nfifthPercentile: 99,\n-      median: 42,\n-      lastMedian: 40,\n+      nfifthPercentile: \"\",\n+      median: \"\",\n+      lastMedian: 400,\n       activeMetric: \"GC_MS\",\n       metricOptions: metricData,\n       activeVersion: \"62\",\n       versionOptions: [\"60\", \"61\", \"62\"],\n       activeChannel: \"nightly\",\n       channelOptions: [\"nightly\", \"beta\", \"dev edition\", \"release\"],\n-    }\n+    };\n+  }\n+\n+  componentWillMount = () => {\n+    var med = this.getPercentile(50).toFixed(2);\n+    var nfifth = this.getPercentile(95).toFixed(2);\n+    this.setState({\n+      median: med,\n+      nfifthPercentile: nfifth,\n+    });\n   }\n \n   componentDidMount = () => {\n     this.getChange();\n   }\n \n+  getLastBucketUpper = () => {\n+    var buckets = this.state.currentData.map(item => item.start);\n+    var lastBucketUpper;\n+    console.log(buckets);\n+    if (this.state.currentData.length === 1) {\n+      lastBucketUpper = buckets[0] + 1;\n+    } else {\n+      /*if (this.state.activeMetric.type === \"linear\" || this.state.activeMetric.type === \"flag\" || this.state.activeMetric.type ===","path":"src/App.js","position":80,"original_position":80,"commit_id":"afd97bf4ff3013b4358c37e546bc61ff89598bd1","original_commit_id":"afd97bf4ff3013b4358c37e546bc61ff89598bd1","user":{"login":"ecomerford","id":35710168,"node_id":"MDQ6VXNlcjM1NzEwMTY4","avatar_url":"https://avatars0.githubusercontent.com/u/35710168?v=4","gravatar_id":"","url":"https://api.github.com/users/ecomerford","html_url":"https://github.com/ecomerford","followers_url":"https://api.github.com/users/ecomerford/followers","following_url":"https://api.github.com/users/ecomerford/following{/other_user}","gists_url":"https://api.github.com/users/ecomerford/gists{/gist_id}","starred_url":"https://api.github.com/users/ecomerford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecomerford/subscriptions","organizations_url":"https://api.github.com/users/ecomerford/orgs","repos_url":"https://api.github.com/users/ecomerford/repos","events_url":"https://api.github.com/users/ecomerford/events{/privacy}","received_events_url":"https://api.github.com/users/ecomerford/received_events","type":"User","site_admin":false},"body":"At the moment, I haven't configured the `type` property, but I didn't want to leave this part out of the code completely. Should I have done that differently?","created_at":"2018-07-06T15:50:32Z","updated_at":"2018-07-06T15:50:32Z","html_url":"https://github.com/mozilla/mdv2/pull/23#discussion_r200695244","pull_request_url":"https://api.github.com/repos/mozilla/mdv2/pulls/23","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/mozilla/mdv2/pulls/comments/200695244"},"html":{"href":"https://github.com/mozilla/mdv2/pull/23#discussion_r200695244"},"pull_request":{"href":"https://api.github.com/repos/mozilla/mdv2/pulls/23"}},"in_reply_to_id":200689008},"pull_request":{"url":"https://api.github.com/repos/mozilla/mdv2/pulls/23","id":199641810,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5NjQxODEw","html_url":"https://github.com/mozilla/mdv2/pull/23","diff_url":"https://github.com/mozilla/mdv2/pull/23.diff","patch_url":"https://github.com/mozilla/mdv2/pull/23.patch","issue_url":"https://api.github.com/repos/mozilla/mdv2/issues/23","number":23,"state":"open","locked":false,"title":"Add percentile function ","user":{"login":"ecomerford","id":35710168,"node_id":"MDQ6VXNlcjM1NzEwMTY4","avatar_url":"https://avatars0.githubusercontent.com/u/35710168?v=4","gravatar_id":"","url":"https://api.github.com/users/ecomerford","html_url":"https://github.com/ecomerford","followers_url":"https://api.github.com/users/ecomerford/followers","following_url":"https://api.github.com/users/ecomerford/following{/other_user}","gists_url":"https://api.github.com/users/ecomerford/gists{/gist_id}","starred_url":"https://api.github.com/users/ecomerford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecomerford/subscriptions","organizations_url":"https://api.github.com/users/ecomerford/orgs","repos_url":"https://api.github.com/users/ecomerford/repos","events_url":"https://api.github.com/users/ecomerford/events{/privacy}","received_events_url":"https://api.github.com/users/ecomerford/received_events","type":"User","site_admin":false},"body":"@georgf @chutten this PR contains the `getPercentile` function, as well as a call for the median and 95th percentile in a `componentWillMount` function.\r\n\r\nI added the data file back in locally so that we can test the functions while I'm still working on making the fetch for the data function.\r\n\r\nI also added an eslint rule to warn about missing semicolons, as @chutten recommended, and was warned about quite a few ( 😅 ), so I made those smaller changes.","created_at":"2018-07-06T04:22:45Z","updated_at":"2018-07-06T15:50:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"64b1eddc7edd1791b32e1f4da2ec37bd71c0934f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/mdv2/pulls/23/commits","review_comments_url":"https://api.github.com/repos/mozilla/mdv2/pulls/23/comments","review_comment_url":"https://api.github.com/repos/mozilla/mdv2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/mdv2/issues/23/comments","statuses_url":"https://api.github.com/repos/mozilla/mdv2/statuses/afd97bf4ff3013b4358c37e546bc61ff89598bd1","head":{"label":"ecomerford:percentile-function","ref":"percentile-function","sha":"afd97bf4ff3013b4358c37e546bc61ff89598bd1","user":{"login":"ecomerford","id":35710168,"node_id":"MDQ6VXNlcjM1NzEwMTY4","avatar_url":"https://avatars0.githubusercontent.com/u/35710168?v=4","gravatar_id":"","url":"https://api.github.com/users/ecomerford","html_url":"https://github.com/ecomerford","followers_url":"https://api.github.com/users/ecomerford/followers","following_url":"https://api.github.com/users/ecomerford/following{/other_user}","gists_url":"https://api.github.com/users/ecomerford/gists{/gist_id}","starred_url":"https://api.github.com/users/ecomerford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecomerford/subscriptions","organizations_url":"https://api.github.com/users/ecomerford/orgs","repos_url":"https://api.github.com/users/ecomerford/repos","events_url":"https://api.github.com/users/ecomerford/events{/privacy}","received_events_url":"https://api.github.com/users/ecomerford/received_events","type":"User","site_admin":false},"repo":{"id":138062246,"node_id":"MDEwOlJlcG9zaXRvcnkxMzgwNjIyNDY=","name":"mdv2","full_name":"ecomerford/mdv2","owner":{"login":"ecomerford","id":35710168,"node_id":"MDQ6VXNlcjM1NzEwMTY4","avatar_url":"https://avatars0.githubusercontent.com/u/35710168?v=4","gravatar_id":"","url":"https://api.github.com/users/ecomerford","html_url":"https://github.com/ecomerford","followers_url":"https://api.github.com/users/ecomerford/followers","following_url":"https://api.github.com/users/ecomerford/following{/other_user}","gists_url":"https://api.github.com/users/ecomerford/gists{/gist_id}","starred_url":"https://api.github.com/users/ecomerford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecomerford/subscriptions","organizations_url":"https://api.github.com/users/ecomerford/orgs","repos_url":"https://api.github.com/users/ecomerford/repos","events_url":"https://api.github.com/users/ecomerford/events{/privacy}","received_events_url":"https://api.github.com/users/ecomerford/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ecomerford/mdv2","description":"Prototype for the Mozilla Measurement Dashboard Version 2","fork":true,"url":"https://api.github.com/repos/ecomerford/mdv2","forks_url":"https://api.github.com/repos/ecomerford/mdv2/forks","keys_url":"https://api.github.com/repos/ecomerford/mdv2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ecomerford/mdv2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ecomerford/mdv2/teams","hooks_url":"https://api.github.com/repos/ecomerford/mdv2/hooks","issue_events_url":"https://api.github.com/repos/ecomerford/mdv2/issues/events{/number}","events_url":"https://api.github.com/repos/ecomerford/mdv2/events","assignees_url":"https://api.github.com/repos/ecomerford/mdv2/assignees{/user}","branches_url":"https://api.github.com/repos/ecomerford/mdv2/branches{/branch}","tags_url":"https://api.github.com/repos/ecomerford/mdv2/tags","blobs_url":"https://api.github.com/repos/ecomerford/mdv2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ecomerford/mdv2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ecomerford/mdv2/git/refs{/sha}","trees_url":"https://api.github.com/repos/ecomerford/mdv2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ecomerford/mdv2/statuses/{sha}","languages_url":"https://api.github.com/repos/ecomerford/mdv2/languages","stargazers_url":"https://api.github.com/repos/ecomerford/mdv2/stargazers","contributors_url":"https://api.github.com/repos/ecomerford/mdv2/contributors","subscribers_url":"https://api.github.com/repos/ecomerford/mdv2/subscribers","subscription_url":"https://api.github.com/repos/ecomerford/mdv2/subscription","commits_url":"https://api.github.com/repos/ecomerford/mdv2/commits{/sha}","git_commits_url":"https://api.github.com/repos/ecomerford/mdv2/git/commits{/sha}","comments_url":"https://api.github.com/repos/ecomerford/mdv2/comments{/number}","issue_comment_url":"https://api.github.com/repos/ecomerford/mdv2/issues/comments{/number}","contents_url":"https://api.github.com/repos/ecomerford/mdv2/contents/{+path}","compare_url":"https://api.github.com/repos/ecomerford/mdv2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ecomerford/mdv2/merges","archive_url":"https://api.github.com/repos/ecomerford/mdv2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ecomerford/mdv2/downloads","issues_url":"https://api.github.com/repos/ecomerford/mdv2/issues{/number}","pulls_url":"https://api.github.com/repos/ecomerford/mdv2/pulls{/number}","milestones_url":"https://api.github.com/repos/ecomerford/mdv2/milestones{/number}","notifications_url":"https://api.github.com/repos/ecomerford/mdv2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ecomerford/mdv2/labels{/name}","releases_url":"https://api.github.com/repos/ecomerford/mdv2/releases{/id}","deployments_url":"https://api.github.com/repos/ecomerford/mdv2/deployments","created_at":"2018-06-20T17:03:07Z","updated_at":"2018-07-05T20:44:42Z","pushed_at":"2018-07-06T04:19:13Z","git_url":"git://github.com/ecomerford/mdv2.git","ssh_url":"git@github.com:ecomerford/mdv2.git","clone_url":"https://github.com/ecomerford/mdv2.git","svn_url":"https://github.com/ecomerford/mdv2","homepage":null,"size":28260,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"514f424e071a657b4f6a49377a695727ec0594f7","user":{"login":"mozilla","id":131524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMTUyNA==","avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":137409268,"node_id":"MDEwOlJlcG9zaXRvcnkxMzc0MDkyNjg=","name":"mdv2","full_name":"mozilla/mdv2","owner":{"login":"mozilla","id":131524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMTUyNA==","avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/mdv2","description":"Prototype for the Mozilla Measurement Dashboard Version 2","fork":false,"url":"https://api.github.com/repos/mozilla/mdv2","forks_url":"https://api.github.com/repos/mozilla/mdv2/forks","keys_url":"https://api.github.com/repos/mozilla/mdv2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/mdv2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/mdv2/teams","hooks_url":"https://api.github.com/repos/mozilla/mdv2/hooks","issue_events_url":"https://api.github.com/repos/mozilla/mdv2/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/mdv2/events","assignees_url":"https://api.github.com/repos/mozilla/mdv2/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/mdv2/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/mdv2/tags","blobs_url":"https://api.github.com/repos/mozilla/mdv2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/mdv2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/mdv2/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/mdv2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/mdv2/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/mdv2/languages","stargazers_url":"https://api.github.com/repos/mozilla/mdv2/stargazers","contributors_url":"https://api.github.com/repos/mozilla/mdv2/contributors","subscribers_url":"https://api.github.com/repos/mozilla/mdv2/subscribers","subscription_url":"https://api.github.com/repos/mozilla/mdv2/subscription","commits_url":"https://api.github.com/repos/mozilla/mdv2/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/mdv2/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/mdv2/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/mdv2/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/mdv2/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/mdv2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/mdv2/merges","archive_url":"https://api.github.com/repos/mozilla/mdv2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/mdv2/downloads","issues_url":"https://api.github.com/repos/mozilla/mdv2/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/mdv2/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/mdv2/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/mdv2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/mdv2/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/mdv2/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/mdv2/deployments","created_at":"2018-06-14T21:04:56Z","updated_at":"2018-07-06T03:12:49Z","pushed_at":"2018-07-06T04:22:46Z","git_url":"git://github.com/mozilla/mdv2.git","ssh_url":"git@github.com:mozilla/mdv2.git","clone_url":"https://github.com/mozilla/mdv2.git","svn_url":"https://github.com/mozilla/mdv2","homepage":null,"size":29595,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":4,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":4,"open_issues":2,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/mdv2/pulls/23"},"html":{"href":"https://github.com/mozilla/mdv2/pull/23"},"issue":{"href":"https://api.github.com/repos/mozilla/mdv2/issues/23"},"comments":{"href":"https://api.github.com/repos/mozilla/mdv2/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/mdv2/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/mdv2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/mdv2/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/mdv2/statuses/afd97bf4ff3013b4358c37e546bc61ff89598bd1"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"ecomerford"}}