{"action":"created","comment":{"url":"https://api.github.com/repos/influxdata/chronograf/pulls/comments/229054444","pull_request_review_id":169462465,"id":229054444,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTA1NDQ0NA==","diff_hunk":"@@ -137,9 +144,10 @@ class TimeSeries extends PureComponent<Props, State> {\n     if (\n       this.props.uuid !== prevProps.uuid ||\n       queriesDifferent ||\n-      this.state.isFirstFetch\n+      this.state.isFirstFetch ||\n+      this.props.xPixels !== prevProps.xPixels\n     ) {\n-      this.executeQueries()\n+      this.debouncer.call(this.executeQueries, EXECUTE_QUERIES_DEBOUNCE_MS)","path":"ui/src/shared/components/time_series/TimeSeries.tsx","position":74,"original_position":74,"commit_id":"e40a92184c7f910574203edf5884f508e5695cdb","original_commit_id":"e40a92184c7f910574203edf5884f508e5695cdb","user":{"login":"chnn","id":638955,"node_id":"MDQ6VXNlcjYzODk1NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/638955?v=4","gravatar_id":"","url":"https://api.github.com/users/chnn","html_url":"https://github.com/chnn","followers_url":"https://api.github.com/users/chnn/followers","following_url":"https://api.github.com/users/chnn/following{/other_user}","gists_url":"https://api.github.com/users/chnn/gists{/gist_id}","starred_url":"https://api.github.com/users/chnn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chnn/subscriptions","organizations_url":"https://api.github.com/users/chnn/orgs","repos_url":"https://api.github.com/users/chnn/repos","events_url":"https://api.github.com/users/chnn/events{/privacy}","received_events_url":"https://api.github.com/users/chnn/received_events","type":"User","site_admin":false},"body":"I feel uneasy putting this debounce logic in the `TimeSeries` component, which only exists since the `xPixels` prop can be updated dozens of times a second during a dashboard cell drag event. If it wasn't here, we would also be executing dozens of queries per second. \r\n\r\nI think a better solution would be to modify the parent, which provides `xPixels`, to only provide the prop as often as needed (basically to hoist the debounce logic). I found this a hard change to make though—it felt like I was hacking around the always-up-to-date and declarative rendering model in React. \r\n\r\nI would love if anyone has a better idea here.","created_at":"2018-10-29T18:49:39Z","updated_at":"2018-10-29T18:49:39Z","html_url":"https://github.com/influxdata/chronograf/pull/4663#discussion_r229054444","pull_request_url":"https://api.github.com/repos/influxdata/chronograf/pulls/4663","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/influxdata/chronograf/pulls/comments/229054444"},"html":{"href":"https://github.com/influxdata/chronograf/pull/4663#discussion_r229054444"},"pull_request":{"href":"https://api.github.com/repos/influxdata/chronograf/pulls/4663"}}},"pull_request":{"url":"https://api.github.com/repos/influxdata/chronograf/pulls/4663","id":226672511,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2NjcyNTEx","html_url":"https://github.com/influxdata/chronograf/pull/4663","diff_url":"https://github.com/influxdata/chronograf/pull/4663.diff","patch_url":"https://github.com/influxdata/chronograf/pull/4663.patch","issue_url":"https://api.github.com/repos/influxdata/chronograf/issues/4663","number":4663,"state":"open","locked":false,"title":"Measure plot dimensions for auto group by queries","user":{"login":"chnn","id":638955,"node_id":"MDQ6VXNlcjYzODk1NQ==","avatar_url":"https://avatars0.githubusercontent.com/u/638955?v=4","gravatar_id":"","url":"https://api.github.com/users/chnn","html_url":"https://github.com/chnn","followers_url":"https://api.github.com/users/chnn/followers","following_url":"https://api.github.com/users/chnn/following{/other_user}","gists_url":"https://api.github.com/users/chnn/gists{/gist_id}","starred_url":"https://api.github.com/users/chnn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chnn/subscriptions","organizations_url":"https://api.github.com/users/chnn/orgs","repos_url":"https://api.github.com/users/chnn/repos","events_url":"https://api.github.com/users/chnn/events{/privacy}","received_events_url":"https://api.github.com/users/chnn/received_events","type":"User","site_admin":false},"body":"Closes influxdata/applications-team-issues#168\r\n\r\nTo compute the auto group by template variables (`:interval:` and `autoInterval`), we need to measure the number of pixels in the _x_ dimension of a plot. Previously, we used a hardcoded value of `700` for this measurement. \r\n\r\nNow, the `RefreshingGraph` will measure the actual value, and the `TimeSeries` component will consume it.\r\n\r\nI also took this opportunity to extract some getters from the `render` method of the `RefreshingGraph`, which has become quite unwieldy. Unfortunately, adding in the measurement logic has exasperated the issue 😞 \r\n\r\n![resampling](https://user-images.githubusercontent.com/638955/47672538-87bd8f00-db6f-11e8-9c3b-80ccd9472129.gif)\r\n","created_at":"2018-10-29T18:44:14Z","updated_at":"2018-10-29T18:49:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7194b34e4ee5102ecbd2d6137a0338755cc3ef6e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/influxdata/chronograf/pulls/4663/commits","review_comments_url":"https://api.github.com/repos/influxdata/chronograf/pulls/4663/comments","review_comment_url":"https://api.github.com/repos/influxdata/chronograf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/influxdata/chronograf/issues/4663/comments","statuses_url":"https://api.github.com/repos/influxdata/chronograf/statuses/e40a92184c7f910574203edf5884f508e5695cdb","head":{"label":"influxdata:auto-group-by-x-pixels","ref":"auto-group-by-x-pixels","sha":"e40a92184c7f910574203edf5884f508e5695cdb","user":{"login":"influxdata","id":5713248,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3MTMyNDg=","avatar_url":"https://avatars2.githubusercontent.com/u/5713248?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnk2NjUwNjk2Mg==","name":"chronograf","full_name":"influxdata/chronograf","private":false,"owner":{"login":"influxdata","id":5713248,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3MTMyNDg=","avatar_url":"https://avatars2.githubusercontent.com/u/5713248?v=4","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},"html_url":"https://github.com/influxdata/chronograf","description":"Open source monitoring and visualization UI for the 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":"2018-10-29T18:22:58Z","pushed_at":"2018-10-29T18:44:14Z","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":72175,"stargazers_count":763,"watchers_count":763,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":157,"mirror_url":null,"archived":false,"open_issues_count":735,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":157,"open_issues":735,"watchers":763,"default_branch":"master"}},"base":{"label":"influxdata:master","ref":"master","sha":"f295467d40d4514af483030f0c79bcfb98c7d42e","user":{"login":"influxdata","id":5713248,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3MTMyNDg=","avatar_url":"https://avatars2.githubusercontent.com/u/5713248?v=4","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,"node_id":"MDEwOlJlcG9zaXRvcnk2NjUwNjk2Mg==","name":"chronograf","full_name":"influxdata/chronograf","private":false,"owner":{"login":"influxdata","id":5713248,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU3MTMyNDg=","avatar_url":"https://avatars2.githubusercontent.com/u/5713248?v=4","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},"html_url":"https://github.com/influxdata/chronograf","description":"Open source monitoring and visualization UI for the 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":"2018-10-29T18:22:58Z","pushed_at":"2018-10-29T18:44:14Z","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":72175,"stargazers_count":763,"watchers_count":763,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":157,"mirror_url":null,"archived":false,"open_issues_count":735,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":157,"open_issues":735,"watchers":763,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/influxdata/chronograf/pulls/4663"},"html":{"href":"https://github.com/influxdata/chronograf/pull/4663"},"issue":{"href":"https://api.github.com/repos/influxdata/chronograf/issues/4663"},"comments":{"href":"https://api.github.com/repos/influxdata/chronograf/issues/4663/comments"},"review_comments":{"href":"https://api.github.com/repos/influxdata/chronograf/pulls/4663/comments"},"review_comment":{"href":"https://api.github.com/repos/influxdata/chronograf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/influxdata/chronograf/pulls/4663/commits"},"statuses":{"href":"https://api.github.com/repos/influxdata/chronograf/statuses/e40a92184c7f910574203edf5884f508e5695cdb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"chnn"}}