{"action":"created","comment":{"url":"https://api.github.com/repos/carldata/script-engine/pulls/comments/139380392","pull_request_review_id":63300258,"id":139380392,"diff_hunk":"@@ -1,62 +1,68 @@\n import { Dispatch } from \"redux\";\n import { ThunkAction } from \"redux-thunk\"\n-import { IRow, ISubmitForm } from \"../containers/main\";\n+import { IDataPoint, ISubmitForm } from \"../interfaces\";\n import axios from \"axios\";\n+import { differenceInMilliseconds, differenceInSeconds, parse } from \"date-fns\";\n \n // input channel id changed\n export const mainActionsTypes = {\n-  INPUT_CHANNEL_ID_CHANGED : \"INPUT_CHANNEL_ID_CHANGED\",\n-  DATE_FROM_CHANGED : \"DATE_FROM_CHANGED\",\n-  DATE_TO_CHANGED : \"DATE_TO_CHANGED\",\n-  SCRIPT_CHANGED : \"SCRIPT_CHANGED\",\n-  SUBMIT_FORM_FETCHING : \"SUBMIT_FORM_FETCHING\",\n-  SUBMIT_FORM_FULLFILLED : \"SUBMIT_FORM_FULLFILLED\",\n-  SUBMIT_FORM_REJECTED : \"SUBMIT_FORM_REJECTED\",\n+  INPUT_CHANNEL_ID_CHANGED: \"INPUT_CHANNEL_ID_CHANGED\",\n+  DATE_FROM_CHANGED: \"DATE_FROM_CHANGED\",\n+  DATE_TO_CHANGED: \"DATE_TO_CHANGED\",\n+  SCRIPT_CHANGED: \"SCRIPT_CHANGED\",\n+  SUBMIT_FORM_FETCHING: \"SUBMIT_FORM_FETCHING\",\n+  SUBMIT_FORM_FULLFILLED: \"SUBMIT_FORM_FULLFILLED\",\n+  SUBMIT_FORM_REJECTED: \"SUBMIT_FORM_REJECTED\",\n }\n \n-export const mainActionCreators =\n-{\n-  inputChannelIdChanged : (inputChannelId: string) => {\n+export const mainActionCreators = {\n+  inputChannelIdChanged: (inputChannelId: string) => {\n     return (dispatch: Dispatch<{}>) => {\n       dispatch({ type: mainActionsTypes.INPUT_CHANNEL_ID_CHANGED, payload: inputChannelId })\n     }\n   },\n-  dateFromChanged : (startDate: string) => {\n+  dateFromChanged: (startDate: string) => {\n     return (dispatch: Dispatch<{}>) => {\n       dispatch({ type: mainActionsTypes.DATE_FROM_CHANGED, payload: startDate })\n     }\n   },\n-  dateToChanged : (endDate: string) => {\n+  dateToChanged: (endDate: string) => {\n     return (dispatch: Dispatch<{}>) => {\n       dispatch({ type: mainActionsTypes.DATE_TO_CHANGED, payload: endDate })\n     }\n   },\n-  scriptChanged : (script: string) => {\n+  scriptChanged: (script: string) => {\n     return (dispatch: Dispatch<{}>) => {\n       dispatch({ type: mainActionsTypes.SCRIPT_CHANGED, payload: script })\n     }\n   },\n-  submitForm : (form: ISubmitForm) => {\n+  submitForm: (form: ISubmitForm) => {\n     return (dispatch: Dispatch<{}>) => {\n       dispatch({ type: mainActionsTypes.SUBMIT_FORM_FETCHING });\n-  \n+\n+      let startApiCall = Date.now();\n       axios.post(\"/api/execute\", {\n         inputChannelId: form.inputChannelId,\n         startDate: form.startDate,\n         endDate: form.endDate,\n         script: [form.script]\n       }).then((result) => {\n+        let endApiCall = Date.now();\n+        console.log(\"main-actions api call timespan: (seconds)\", differenceInSeconds(endApiCall, startApiCall));\n         console.log(\"main-actions submitForm result\", result);\n         let resStr: string = result.data;\n         let arr: Array<String> = resStr.split(\"\\n\");","path":"test-site/src/actions/main-actions.ts","position":70,"original_position":70,"commit_id":"3d8b83685b2d8eb07fc160097fda0d9a101e51d0","original_commit_id":"3d8b83685b2d8eb07fc160097fda0d9a101e51d0","user":{"login":"sharpcoding","id":7655909,"avatar_url":"https://avatars2.githubusercontent.com/u/7655909?v=4","gravatar_id":"","url":"https://api.github.com/users/sharpcoding","html_url":"https://github.com/sharpcoding","followers_url":"https://api.github.com/users/sharpcoding/followers","following_url":"https://api.github.com/users/sharpcoding/following{/other_user}","gists_url":"https://api.github.com/users/sharpcoding/gists{/gist_id}","starred_url":"https://api.github.com/users/sharpcoding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharpcoding/subscriptions","organizations_url":"https://api.github.com/users/sharpcoding/orgs","repos_url":"https://api.github.com/users/sharpcoding/repos","events_url":"https://api.github.com/users/sharpcoding/events{/privacy}","received_events_url":"https://api.github.com/users/sharpcoding/received_events","type":"User","site_admin":false},"body":"please consider using lodash _.split() function","created_at":"2017-09-18T09:59:36Z","updated_at":"2017-09-18T10:01:39Z","html_url":"https://github.com/carldata/script-engine/pull/58#discussion_r139380392","pull_request_url":"https://api.github.com/repos/carldata/script-engine/pulls/58","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/carldata/script-engine/pulls/comments/139380392"},"html":{"href":"https://github.com/carldata/script-engine/pull/58#discussion_r139380392"},"pull_request":{"href":"https://api.github.com/repos/carldata/script-engine/pulls/58"}}},"pull_request":{"url":"https://api.github.com/repos/carldata/script-engine/pulls/58","id":141535879,"html_url":"https://github.com/carldata/script-engine/pull/58","diff_url":"https://github.com/carldata/script-engine/pull/58.diff","patch_url":"https://github.com/carldata/script-engine/pull/58.patch","issue_url":"https://api.github.com/repos/carldata/script-engine/issues/58","number":58,"state":"open","locked":false,"title":"Issue #55 optimize performance","user":{"login":"tpichlak","id":16462422,"avatar_url":"https://avatars1.githubusercontent.com/u/16462422?v=4","gravatar_id":"","url":"https://api.github.com/users/tpichlak","html_url":"https://github.com/tpichlak","followers_url":"https://api.github.com/users/tpichlak/followers","following_url":"https://api.github.com/users/tpichlak/following{/other_user}","gists_url":"https://api.github.com/users/tpichlak/gists{/gist_id}","starred_url":"https://api.github.com/users/tpichlak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tpichlak/subscriptions","organizations_url":"https://api.github.com/users/tpichlak/orgs","repos_url":"https://api.github.com/users/tpichlak/repos","events_url":"https://api.github.com/users/tpichlak/events{/privacy}","received_events_url":"https://api.github.com/users/tpichlak/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-09-18T07:19:17Z","updated_at":"2017-09-18T10:01:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4e5f35fc20be216f402d7cd9d56c58ab090a7928","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/carldata/script-engine/pulls/58/commits","review_comments_url":"https://api.github.com/repos/carldata/script-engine/pulls/58/comments","review_comment_url":"https://api.github.com/repos/carldata/script-engine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/carldata/script-engine/issues/58/comments","statuses_url":"https://api.github.com/repos/carldata/script-engine/statuses/3d8b83685b2d8eb07fc160097fda0d9a101e51d0","head":{"label":"carldata:Issue_#55_optimize_performance","ref":"Issue_#55_optimize_performance","sha":"3d8b83685b2d8eb07fc160097fda0d9a101e51d0","user":{"login":"carldata","id":22315557,"avatar_url":"https://avatars2.githubusercontent.com/u/22315557?v=4","gravatar_id":"","url":"https://api.github.com/users/carldata","html_url":"https://github.com/carldata","followers_url":"https://api.github.com/users/carldata/followers","following_url":"https://api.github.com/users/carldata/following{/other_user}","gists_url":"https://api.github.com/users/carldata/gists{/gist_id}","starred_url":"https://api.github.com/users/carldata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carldata/subscriptions","organizations_url":"https://api.github.com/users/carldata/orgs","repos_url":"https://api.github.com/users/carldata/repos","events_url":"https://api.github.com/users/carldata/events{/privacy}","received_events_url":"https://api.github.com/users/carldata/received_events","type":"Organization","site_admin":false},"repo":{"id":96533395,"name":"script-engine","full_name":"carldata/script-engine","owner":{"login":"carldata","id":22315557,"avatar_url":"https://avatars2.githubusercontent.com/u/22315557?v=4","gravatar_id":"","url":"https://api.github.com/users/carldata","html_url":"https://github.com/carldata","followers_url":"https://api.github.com/users/carldata/followers","following_url":"https://api.github.com/users/carldata/following{/other_user}","gists_url":"https://api.github.com/users/carldata/gists{/gist_id}","starred_url":"https://api.github.com/users/carldata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carldata/subscriptions","organizations_url":"https://api.github.com/users/carldata/orgs","repos_url":"https://api.github.com/users/carldata/repos","events_url":"https://api.github.com/users/carldata/events{/privacy}","received_events_url":"https://api.github.com/users/carldata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/carldata/script-engine","description":"Script Engine with the REST API","fork":false,"url":"https://api.github.com/repos/carldata/script-engine","forks_url":"https://api.github.com/repos/carldata/script-engine/forks","keys_url":"https://api.github.com/repos/carldata/script-engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/carldata/script-engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/carldata/script-engine/teams","hooks_url":"https://api.github.com/repos/carldata/script-engine/hooks","issue_events_url":"https://api.github.com/repos/carldata/script-engine/issues/events{/number}","events_url":"https://api.github.com/repos/carldata/script-engine/events","assignees_url":"https://api.github.com/repos/carldata/script-engine/assignees{/user}","branches_url":"https://api.github.com/repos/carldata/script-engine/branches{/branch}","tags_url":"https://api.github.com/repos/carldata/script-engine/tags","blobs_url":"https://api.github.com/repos/carldata/script-engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/carldata/script-engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/carldata/script-engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/carldata/script-engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/carldata/script-engine/statuses/{sha}","languages_url":"https://api.github.com/repos/carldata/script-engine/languages","stargazers_url":"https://api.github.com/repos/carldata/script-engine/stargazers","contributors_url":"https://api.github.com/repos/carldata/script-engine/contributors","subscribers_url":"https://api.github.com/repos/carldata/script-engine/subscribers","subscription_url":"https://api.github.com/repos/carldata/script-engine/subscription","commits_url":"https://api.github.com/repos/carldata/script-engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/carldata/script-engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/carldata/script-engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/carldata/script-engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/carldata/script-engine/contents/{+path}","compare_url":"https://api.github.com/repos/carldata/script-engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/carldata/script-engine/merges","archive_url":"https://api.github.com/repos/carldata/script-engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/carldata/script-engine/downloads","issues_url":"https://api.github.com/repos/carldata/script-engine/issues{/number}","pulls_url":"https://api.github.com/repos/carldata/script-engine/pulls{/number}","milestones_url":"https://api.github.com/repos/carldata/script-engine/milestones{/number}","notifications_url":"https://api.github.com/repos/carldata/script-engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/carldata/script-engine/labels{/name}","releases_url":"https://api.github.com/repos/carldata/script-engine/releases{/id}","deployments_url":"https://api.github.com/repos/carldata/script-engine/deployments","created_at":"2017-07-07T11:46:16Z","updated_at":"2017-09-11T13:38:04Z","pushed_at":"2017-09-18T07:19:17Z","git_url":"git://github.com/carldata/script-engine.git","ssh_url":"git@github.com:carldata/script-engine.git","clone_url":"https://github.com/carldata/script-engine.git","svn_url":"https://github.com/carldata/script-engine","homepage":"","size":121,"stargazers_count":1,"watchers_count":1,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":1,"default_branch":"master"}},"base":{"label":"carldata:master","ref":"master","sha":"84fca42968e5128fe21a64011b35db8a340bff2d","user":{"login":"carldata","id":22315557,"avatar_url":"https://avatars2.githubusercontent.com/u/22315557?v=4","gravatar_id":"","url":"https://api.github.com/users/carldata","html_url":"https://github.com/carldata","followers_url":"https://api.github.com/users/carldata/followers","following_url":"https://api.github.com/users/carldata/following{/other_user}","gists_url":"https://api.github.com/users/carldata/gists{/gist_id}","starred_url":"https://api.github.com/users/carldata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carldata/subscriptions","organizations_url":"https://api.github.com/users/carldata/orgs","repos_url":"https://api.github.com/users/carldata/repos","events_url":"https://api.github.com/users/carldata/events{/privacy}","received_events_url":"https://api.github.com/users/carldata/received_events","type":"Organization","site_admin":false},"repo":{"id":96533395,"name":"script-engine","full_name":"carldata/script-engine","owner":{"login":"carldata","id":22315557,"avatar_url":"https://avatars2.githubusercontent.com/u/22315557?v=4","gravatar_id":"","url":"https://api.github.com/users/carldata","html_url":"https://github.com/carldata","followers_url":"https://api.github.com/users/carldata/followers","following_url":"https://api.github.com/users/carldata/following{/other_user}","gists_url":"https://api.github.com/users/carldata/gists{/gist_id}","starred_url":"https://api.github.com/users/carldata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carldata/subscriptions","organizations_url":"https://api.github.com/users/carldata/orgs","repos_url":"https://api.github.com/users/carldata/repos","events_url":"https://api.github.com/users/carldata/events{/privacy}","received_events_url":"https://api.github.com/users/carldata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/carldata/script-engine","description":"Script Engine with the REST API","fork":false,"url":"https://api.github.com/repos/carldata/script-engine","forks_url":"https://api.github.com/repos/carldata/script-engine/forks","keys_url":"https://api.github.com/repos/carldata/script-engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/carldata/script-engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/carldata/script-engine/teams","hooks_url":"https://api.github.com/repos/carldata/script-engine/hooks","issue_events_url":"https://api.github.com/repos/carldata/script-engine/issues/events{/number}","events_url":"https://api.github.com/repos/carldata/script-engine/events","assignees_url":"https://api.github.com/repos/carldata/script-engine/assignees{/user}","branches_url":"https://api.github.com/repos/carldata/script-engine/branches{/branch}","tags_url":"https://api.github.com/repos/carldata/script-engine/tags","blobs_url":"https://api.github.com/repos/carldata/script-engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/carldata/script-engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/carldata/script-engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/carldata/script-engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/carldata/script-engine/statuses/{sha}","languages_url":"https://api.github.com/repos/carldata/script-engine/languages","stargazers_url":"https://api.github.com/repos/carldata/script-engine/stargazers","contributors_url":"https://api.github.com/repos/carldata/script-engine/contributors","subscribers_url":"https://api.github.com/repos/carldata/script-engine/subscribers","subscription_url":"https://api.github.com/repos/carldata/script-engine/subscription","commits_url":"https://api.github.com/repos/carldata/script-engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/carldata/script-engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/carldata/script-engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/carldata/script-engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/carldata/script-engine/contents/{+path}","compare_url":"https://api.github.com/repos/carldata/script-engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/carldata/script-engine/merges","archive_url":"https://api.github.com/repos/carldata/script-engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/carldata/script-engine/downloads","issues_url":"https://api.github.com/repos/carldata/script-engine/issues{/number}","pulls_url":"https://api.github.com/repos/carldata/script-engine/pulls{/number}","milestones_url":"https://api.github.com/repos/carldata/script-engine/milestones{/number}","notifications_url":"https://api.github.com/repos/carldata/script-engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/carldata/script-engine/labels{/name}","releases_url":"https://api.github.com/repos/carldata/script-engine/releases{/id}","deployments_url":"https://api.github.com/repos/carldata/script-engine/deployments","created_at":"2017-07-07T11:46:16Z","updated_at":"2017-09-11T13:38:04Z","pushed_at":"2017-09-18T07:19:17Z","git_url":"git://github.com/carldata/script-engine.git","ssh_url":"git@github.com:carldata/script-engine.git","clone_url":"https://github.com/carldata/script-engine.git","svn_url":"https://github.com/carldata/script-engine","homepage":"","size":121,"stargazers_count":1,"watchers_count":1,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/carldata/script-engine/pulls/58"},"html":{"href":"https://github.com/carldata/script-engine/pull/58"},"issue":{"href":"https://api.github.com/repos/carldata/script-engine/issues/58"},"comments":{"href":"https://api.github.com/repos/carldata/script-engine/issues/58/comments"},"review_comments":{"href":"https://api.github.com/repos/carldata/script-engine/pulls/58/comments"},"review_comment":{"href":"https://api.github.com/repos/carldata/script-engine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/carldata/script-engine/pulls/58/commits"},"statuses":{"href":"https://api.github.com/repos/carldata/script-engine/statuses/3d8b83685b2d8eb07fc160097fda0d9a101e51d0"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"sharpcoding"}}