{"action":"created","comment":{"url":"https://api.github.com/repos/influxdata/chronograf/pulls/comments/89914249","pull_request_review_id":10443310,"id":89914249,"diff_hunk":"@@ -33,22 +33,25 @@ export const HostPage = React.createClass({\n   },\n \n   componentDidMount() {\n-    const hosts = {[this.props.params.hostID]: {name: this.props.params.hostID}};\n-    const {source} = this.props;\n+    const {source, params} = this.props;\n+    const hosts = {[params.hostID]: {name: params.hostID}};\n \n     // fetching layouts and mappings can be done at the same time\n     fetchLayouts().then(({data: {layouts}}) => {\n       getMappings().then(({data: {mappings}}) => {\n         getAppsForHosts(source.links.proxy, hosts, mappings, source.telegraf).then((newHosts) => {\n-          const host = newHosts[this.props.params.hostID];\n-          const filteredLayouts = layouts.filter((layout) => {\n-            const focusedApp = this.props.location.query.app;\n-            if (focusedApp) {\n-              return layout.app === focusedApp;\n-            }\n-            return host.apps && host.apps.includes(layout.app);\n+          getMeasurementsForHost(source, params.hostID).then((measurements) => {\n+            const host = newHosts[this.props.params.hostID];\n+            const filteredLayouts = layouts.filter((layout) => {\n+              const focusedApp = this.props.location.query.app;\n+              if (focusedApp) {\n+                return layout.app === focusedApp;\n+              }\n+\n+              return host.apps && host.apps.includes(layout.app) && measurements.includes(layout.measurement);\n+            });\n+            this.setState({layouts: filteredLayouts});","path":"ui/src/hosts/containers/HostPage.js","position":39,"original_position":39,"commit_id":"aed61ada9f5f86940f38c664032d0d69e376a948","original_commit_id":"aed61ada9f5f86940f38c664032d0d69e376a948","user":{"login":"willpiers","id":2482470,"avatar_url":"https://avatars.githubusercontent.com/u/2482470?v=3","gravatar_id":"","url":"https://api.github.com/users/willpiers","html_url":"https://github.com/willpiers","followers_url":"https://api.github.com/users/willpiers/followers","following_url":"https://api.github.com/users/willpiers/following{/other_user}","gists_url":"https://api.github.com/users/willpiers/gists{/gist_id}","starred_url":"https://api.github.com/users/willpiers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willpiers/subscriptions","organizations_url":"https://api.github.com/users/willpiers/orgs","repos_url":"https://api.github.com/users/willpiers/repos","events_url":"https://api.github.com/users/willpiers/events{/privacy}","received_events_url":"https://api.github.com/users/willpiers/received_events","type":"User","site_admin":false},"body":"Okay actually line 37 seems to address some of the over-fetching. Still looks like the first two requests can go in parallel, as well as the final two requests","created_at":"2016-11-29T00:00:55Z","updated_at":"2016-11-29T00:00:55Z","html_url":"https://github.com/influxdata/chronograf/pull/601#discussion_r89914249","pull_request_url":"https://api.github.com/repos/influxdata/chronograf/pulls/601","_links":{"self":{"href":"https://api.github.com/repos/influxdata/chronograf/pulls/comments/89914249"},"html":{"href":"https://github.com/influxdata/chronograf/pull/601#discussion_r89914249"},"pull_request":{"href":"https://api.github.com/repos/influxdata/chronograf/pulls/601"}}},"pull_request":{"url":"https://api.github.com/repos/influxdata/chronograf/pulls/601","id":94883209,"html_url":"https://github.com/influxdata/chronograf/pull/601","diff_url":"https://github.com/influxdata/chronograf/pull/601.diff","patch_url":"https://github.com/influxdata/chronograf/pull/601.patch","issue_url":"https://api.github.com/repos/influxdata/chronograf/issues/601","number":601,"state":"open","locked":false,"title":"Fix layout being displayed when measurement not present","user":{"login":"121watts","id":7582765,"avatar_url":"https://avatars.githubusercontent.com/u/7582765?v=3","gravatar_id":"","url":"https://api.github.com/users/121watts","html_url":"https://github.com/121watts","followers_url":"https://api.github.com/users/121watts/followers","following_url":"https://api.github.com/users/121watts/following{/other_user}","gists_url":"https://api.github.com/users/121watts/gists{/gist_id}","starred_url":"https://api.github.com/users/121watts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/121watts/subscriptions","organizations_url":"https://api.github.com/users/121watts/orgs","repos_url":"https://api.github.com/users/121watts/repos","events_url":"https://api.github.com/users/121watts/events{/privacy}","received_events_url":"https://api.github.com/users/121watts/received_events","type":"User","site_admin":false},"body":"  - [ ] CHANGELOG.md updated\r\n  - [ ] Rebased/mergable\r\n  - [ ] Tests pass\r\n  - [ ] Sign [CLA](https://influxdata.com/community/cla/) (if not already signed)\r\n\r\nConnect #494 \r\n\r\n### The problem\r\nWe are populating the host view with empty layouts because we are not detecting whether a particular host even has a layout's measurement.\r\n\r\n### The Solution\r\nGet the measurements for a host and filter the layouts based on said measurements. \r\n\r\n### Before\r\n![screen shot 2016-11-22 at 11 27 06 am](https://cloud.githubusercontent.com/assets/7582765/20538808/9af4d9ec-b0a7-11e6-9976-e509f91eab7a.png)\r\n### After\r\n![screen shot 2016-11-22 at 11 27 24 am](https://cloud.githubusercontent.com/assets/7582765/20538820/a020b260-b0a7-11e6-9639-a0e74a06bcc5.png)\r\n\r\n\r\n\r\n\r\n","created_at":"2016-11-22T19:37:29Z","updated_at":"2016-11-29T00:00:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e0cab0e102ea7d34eaa5252cc468df4a3594dd32","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/influxdata/chronograf/pulls/601/commits","review_comments_url":"https://api.github.com/repos/influxdata/chronograf/pulls/601/comments","review_comment_url":"https://api.github.com/repos/influxdata/chronograf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/influxdata/chronograf/issues/601/comments","statuses_url":"https://api.github.com/repos/influxdata/chronograf/statuses/aed61ada9f5f86940f38c664032d0d69e376a948","head":{"label":"influxdata:measurement-present","ref":"measurement-present","sha":"aed61ada9f5f86940f38c664032d0d69e376a948","user":{"login":"influxdata","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdata","html_url":"https://github.com/influxdata","followers_url":"https://api.github.com/users/influxdata/followers","following_url":"https://api.github.com/users/influxdata/following{/other_user}","gists_url":"https://api.github.com/users/influxdata/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdata/subscriptions","organizations_url":"https://api.github.com/users/influxdata/orgs","repos_url":"https://api.github.com/users/influxdata/repos","events_url":"https://api.github.com/users/influxdata/events{/privacy}","received_events_url":"https://api.github.com/users/influxdata/received_events","type":"Organization","site_admin":false},"repo":{"id":66506962,"name":"chronograf","full_name":"influxdata/chronograf","owner":{"login":"influxdata","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdata","html_url":"https://github.com/influxdata","followers_url":"https://api.github.com/users/influxdata/followers","following_url":"https://api.github.com/users/influxdata/following{/other_user}","gists_url":"https://api.github.com/users/influxdata/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdata/subscriptions","organizations_url":"https://api.github.com/users/influxdata/orgs","repos_url":"https://api.github.com/users/influxdata/repos","events_url":"https://api.github.com/users/influxdata/events{/privacy}","received_events_url":"https://api.github.com/users/influxdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influxdata/chronograf","description":"Open source monitoring and visualization UI for the entire TICK stack","fork":false,"url":"https://api.github.com/repos/influxdata/chronograf","forks_url":"https://api.github.com/repos/influxdata/chronograf/forks","keys_url":"https://api.github.com/repos/influxdata/chronograf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influxdata/chronograf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influxdata/chronograf/teams","hooks_url":"https://api.github.com/repos/influxdata/chronograf/hooks","issue_events_url":"https://api.github.com/repos/influxdata/chronograf/issues/events{/number}","events_url":"https://api.github.com/repos/influxdata/chronograf/events","assignees_url":"https://api.github.com/repos/influxdata/chronograf/assignees{/user}","branches_url":"https://api.github.com/repos/influxdata/chronograf/branches{/branch}","tags_url":"https://api.github.com/repos/influxdata/chronograf/tags","blobs_url":"https://api.github.com/repos/influxdata/chronograf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influxdata/chronograf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influxdata/chronograf/git/refs{/sha}","trees_url":"https://api.github.com/repos/influxdata/chronograf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influxdata/chronograf/statuses/{sha}","languages_url":"https://api.github.com/repos/influxdata/chronograf/languages","stargazers_url":"https://api.github.com/repos/influxdata/chronograf/stargazers","contributors_url":"https://api.github.com/repos/influxdata/chronograf/contributors","subscribers_url":"https://api.github.com/repos/influxdata/chronograf/subscribers","subscription_url":"https://api.github.com/repos/influxdata/chronograf/subscription","commits_url":"https://api.github.com/repos/influxdata/chronograf/commits{/sha}","git_commits_url":"https://api.github.com/repos/influxdata/chronograf/git/commits{/sha}","comments_url":"https://api.github.com/repos/influxdata/chronograf/comments{/number}","issue_comment_url":"https://api.github.com/repos/influxdata/chronograf/issues/comments{/number}","contents_url":"https://api.github.com/repos/influxdata/chronograf/contents/{+path}","compare_url":"https://api.github.com/repos/influxdata/chronograf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influxdata/chronograf/merges","archive_url":"https://api.github.com/repos/influxdata/chronograf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influxdata/chronograf/downloads","issues_url":"https://api.github.com/repos/influxdata/chronograf/issues{/number}","pulls_url":"https://api.github.com/repos/influxdata/chronograf/pulls{/number}","milestones_url":"https://api.github.com/repos/influxdata/chronograf/milestones{/number}","notifications_url":"https://api.github.com/repos/influxdata/chronograf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influxdata/chronograf/labels{/name}","releases_url":"https://api.github.com/repos/influxdata/chronograf/releases{/id}","deployments_url":"https://api.github.com/repos/influxdata/chronograf/deployments","created_at":"2016-08-24T23:28:56Z","updated_at":"2016-11-25T12:58:03Z","pushed_at":"2016-11-28T23:52:45Z","git_url":"git://github.com/influxdata/chronograf.git","ssh_url":"git@github.com:influxdata/chronograf.git","clone_url":"https://github.com/influxdata/chronograf.git","svn_url":"https://github.com/influxdata/chronograf","homepage":"https://www.influxdata.com/time-series-platform/chronograf/","size":30405,"stargazers_count":43,"watchers_count":43,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":111,"forks":6,"open_issues":111,"watchers":43,"default_branch":"master"}},"base":{"label":"influxdata:master","ref":"master","sha":"76bf76e362970ebf613da7fffb1978dc0dd51123","user":{"login":"influxdata","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdata","html_url":"https://github.com/influxdata","followers_url":"https://api.github.com/users/influxdata/followers","following_url":"https://api.github.com/users/influxdata/following{/other_user}","gists_url":"https://api.github.com/users/influxdata/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdata/subscriptions","organizations_url":"https://api.github.com/users/influxdata/orgs","repos_url":"https://api.github.com/users/influxdata/repos","events_url":"https://api.github.com/users/influxdata/events{/privacy}","received_events_url":"https://api.github.com/users/influxdata/received_events","type":"Organization","site_admin":false},"repo":{"id":66506962,"name":"chronograf","full_name":"influxdata/chronograf","owner":{"login":"influxdata","id":5713248,"avatar_url":"https://avatars.githubusercontent.com/u/5713248?v=3","gravatar_id":"","url":"https://api.github.com/users/influxdata","html_url":"https://github.com/influxdata","followers_url":"https://api.github.com/users/influxdata/followers","following_url":"https://api.github.com/users/influxdata/following{/other_user}","gists_url":"https://api.github.com/users/influxdata/gists{/gist_id}","starred_url":"https://api.github.com/users/influxdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influxdata/subscriptions","organizations_url":"https://api.github.com/users/influxdata/orgs","repos_url":"https://api.github.com/users/influxdata/repos","events_url":"https://api.github.com/users/influxdata/events{/privacy}","received_events_url":"https://api.github.com/users/influxdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influxdata/chronograf","description":"Open source monitoring and visualization UI for the entire TICK stack","fork":false,"url":"https://api.github.com/repos/influxdata/chronograf","forks_url":"https://api.github.com/repos/influxdata/chronograf/forks","keys_url":"https://api.github.com/repos/influxdata/chronograf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influxdata/chronograf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influxdata/chronograf/teams","hooks_url":"https://api.github.com/repos/influxdata/chronograf/hooks","issue_events_url":"https://api.github.com/repos/influxdata/chronograf/issues/events{/number}","events_url":"https://api.github.com/repos/influxdata/chronograf/events","assignees_url":"https://api.github.com/repos/influxdata/chronograf/assignees{/user}","branches_url":"https://api.github.com/repos/influxdata/chronograf/branches{/branch}","tags_url":"https://api.github.com/repos/influxdata/chronograf/tags","blobs_url":"https://api.github.com/repos/influxdata/chronograf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influxdata/chronograf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influxdata/chronograf/git/refs{/sha}","trees_url":"https://api.github.com/repos/influxdata/chronograf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influxdata/chronograf/statuses/{sha}","languages_url":"https://api.github.com/repos/influxdata/chronograf/languages","stargazers_url":"https://api.github.com/repos/influxdata/chronograf/stargazers","contributors_url":"https://api.github.com/repos/influxdata/chronograf/contributors","subscribers_url":"https://api.github.com/repos/influxdata/chronograf/subscribers","subscription_url":"https://api.github.com/repos/influxdata/chronograf/subscription","commits_url":"https://api.github.com/repos/influxdata/chronograf/commits{/sha}","git_commits_url":"https://api.github.com/repos/influxdata/chronograf/git/commits{/sha}","comments_url":"https://api.github.com/repos/influxdata/chronograf/comments{/number}","issue_comment_url":"https://api.github.com/repos/influxdata/chronograf/issues/comments{/number}","contents_url":"https://api.github.com/repos/influxdata/chronograf/contents/{+path}","compare_url":"https://api.github.com/repos/influxdata/chronograf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influxdata/chronograf/merges","archive_url":"https://api.github.com/repos/influxdata/chronograf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influxdata/chronograf/downloads","issues_url":"https://api.github.com/repos/influxdata/chronograf/issues{/number}","pulls_url":"https://api.github.com/repos/influxdata/chronograf/pulls{/number}","milestones_url":"https://api.github.com/repos/influxdata/chronograf/milestones{/number}","notifications_url":"https://api.github.com/repos/influxdata/chronograf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influxdata/chronograf/labels{/name}","releases_url":"https://api.github.com/repos/influxdata/chronograf/releases{/id}","deployments_url":"https://api.github.com/repos/influxdata/chronograf/deployments","created_at":"2016-08-24T23:28:56Z","updated_at":"2016-11-25T12:58:03Z","pushed_at":"2016-11-28T23:52:45Z","git_url":"git://github.com/influxdata/chronograf.git","ssh_url":"git@github.com:influxdata/chronograf.git","clone_url":"https://github.com/influxdata/chronograf.git","svn_url":"https://github.com/influxdata/chronograf","homepage":"https://www.influxdata.com/time-series-platform/chronograf/","size":30405,"stargazers_count":43,"watchers_count":43,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":111,"forks":6,"open_issues":111,"watchers":43,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/influxdata/chronograf/pulls/601"},"html":{"href":"https://github.com/influxdata/chronograf/pull/601"},"issue":{"href":"https://api.github.com/repos/influxdata/chronograf/issues/601"},"comments":{"href":"https://api.github.com/repos/influxdata/chronograf/issues/601/comments"},"review_comments":{"href":"https://api.github.com/repos/influxdata/chronograf/pulls/601/comments"},"review_comment":{"href":"https://api.github.com/repos/influxdata/chronograf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/influxdata/chronograf/pulls/601/commits"},"statuses":{"href":"https://api.github.com/repos/influxdata/chronograf/statuses/aed61ada9f5f86940f38c664032d0d69e376a948"}}}}
{"actor":{"display_login":"willpiers"}}