{"action":"created","comment":{"url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/pulls/comments/174339373","pull_request_review_id":103676492,"id":174339373,"diff_hunk":"@@ -66,13 +71,25 @@ def wait_for_geometry(self):\n     def run(self) -> None:\n         self.wait_for_geometry()\n         self.logger.debug('Running with process ID {}'.format(os.getpid()))\n+        if PROFILE_AI:\n+            self.pr = cProfile.Profile()\n+            self.pr.enable()\n+        cycle_tick_count = 0\n         try:\n             while True:\n                 self.main_loop()\n                 self.print_frame_rate()\n                 sleep(self.cfg['GAME']['ai_timestamp'])\n+                cycle_tick_count += 1\n+                if cycle_tick_count == PROFILE_DATA_TICK_NUMBER:\n+                    cycle_tick_count = 0\n+                    if PROFILE_AI:\n+                        self.pr.dump_stats(PROFILE_DATA_FILENAME)\n+                        print('ai profile data written.')\n \n         except KeyboardInterrupt:\n+            self.pr.dump_stats(PROFILE_DATA_FILENAME)\n+            print('ai profile data written during keyboard interrupt.')","path":"ai/coach.py","position":41,"original_position":41,"commit_id":"9ce2b6709550f59b805f3029d1b85713ea285b3b","original_commit_id":"9ce2b6709550f59b805f3029d1b85713ea285b3b","user":{"login":"sim0504","id":12924452,"avatar_url":"https://avatars0.githubusercontent.com/u/12924452?v=4","gravatar_id":"","url":"https://api.github.com/users/sim0504","html_url":"https://github.com/sim0504","followers_url":"https://api.github.com/users/sim0504/followers","following_url":"https://api.github.com/users/sim0504/following{/other_user}","gists_url":"https://api.github.com/users/sim0504/gists{/gist_id}","starred_url":"https://api.github.com/users/sim0504/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sim0504/subscriptions","organizations_url":"https://api.github.com/users/sim0504/orgs","repos_url":"https://api.github.com/users/sim0504/repos","events_url":"https://api.github.com/users/sim0504/events{/privacy}","received_events_url":"https://api.github.com/users/sim0504/received_events","type":"User","site_admin":false},"body":"Use self.logger.debug(...)","created_at":"2018-03-14T02:37:23Z","updated_at":"2018-03-14T02:40:14Z","html_url":"https://github.com/RoboCupULaval/StrategyAI/pull/344#discussion_r174339373","pull_request_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/pulls/344","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/RoboCupULaval/StrategyAI/pulls/comments/174339373"},"html":{"href":"https://github.com/RoboCupULaval/StrategyAI/pull/344#discussion_r174339373"},"pull_request":{"href":"https://api.github.com/repos/RoboCupULaval/StrategyAI/pulls/344"}}},"pull_request":{"url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/pulls/344","id":174839286,"html_url":"https://github.com/RoboCupULaval/StrategyAI/pull/344","diff_url":"https://github.com/RoboCupULaval/StrategyAI/pull/344.diff","patch_url":"https://github.com/RoboCupULaval/StrategyAI/pull/344.patch","issue_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/issues/344","number":344,"state":"open","locked":false,"title":"added cprofile logic to the coach code","user":{"login":"frstp64","id":13425798,"avatar_url":"https://avatars1.githubusercontent.com/u/13425798?v=4","gravatar_id":"","url":"https://api.github.com/users/frstp64","html_url":"https://github.com/frstp64","followers_url":"https://api.github.com/users/frstp64/followers","following_url":"https://api.github.com/users/frstp64/following{/other_user}","gists_url":"https://api.github.com/users/frstp64/gists{/gist_id}","starred_url":"https://api.github.com/users/frstp64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frstp64/subscriptions","organizations_url":"https://api.github.com/users/frstp64/orgs","repos_url":"https://api.github.com/users/frstp64/repos","events_url":"https://api.github.com/users/frstp64/events{/privacy}","received_events_url":"https://api.github.com/users/frstp64/received_events","type":"User","site_admin":false},"body":"- Can be turned off via a constant variable\r\n- Comes with an helper script to read the profiling data file\r\n- Called in the right process (the one that does the bulk of the computing)\r\n\r\nNote: this cannot be dealt with in the start and __del__ methods because they are called as an object in a different process (the caller process), thus creating mostly useless data in that case, hence why they are placed around the loop code.\r\n\r\nSome simple tick count code was added to prevent having to write the profiling data often, it does so every 3-4 seconds on my computer with the current tick count constant value.","created_at":"2018-03-14T02:31:56Z","updated_at":"2018-03-14T02:40:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ac54f19c8d181d295674d7d05579342e1866a495","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/pulls/344/commits","review_comments_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/pulls/344/comments","review_comment_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/issues/344/comments","statuses_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/statuses/9ce2b6709550f59b805f3029d1b85713ea285b3b","head":{"label":"frstp64:feature+cprofile","ref":"feature+cprofile","sha":"9ce2b6709550f59b805f3029d1b85713ea285b3b","user":{"login":"frstp64","id":13425798,"avatar_url":"https://avatars1.githubusercontent.com/u/13425798?v=4","gravatar_id":"","url":"https://api.github.com/users/frstp64","html_url":"https://github.com/frstp64","followers_url":"https://api.github.com/users/frstp64/followers","following_url":"https://api.github.com/users/frstp64/following{/other_user}","gists_url":"https://api.github.com/users/frstp64/gists{/gist_id}","starred_url":"https://api.github.com/users/frstp64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frstp64/subscriptions","organizations_url":"https://api.github.com/users/frstp64/orgs","repos_url":"https://api.github.com/users/frstp64/repos","events_url":"https://api.github.com/users/frstp64/events{/privacy}","received_events_url":"https://api.github.com/users/frstp64/received_events","type":"User","site_admin":false},"repo":{"id":117122147,"name":"StrategyIA","full_name":"frstp64/StrategyIA","owner":{"login":"frstp64","id":13425798,"avatar_url":"https://avatars1.githubusercontent.com/u/13425798?v=4","gravatar_id":"","url":"https://api.github.com/users/frstp64","html_url":"https://github.com/frstp64","followers_url":"https://api.github.com/users/frstp64/followers","following_url":"https://api.github.com/users/frstp64/following{/other_user}","gists_url":"https://api.github.com/users/frstp64/gists{/gist_id}","starred_url":"https://api.github.com/users/frstp64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frstp64/subscriptions","organizations_url":"https://api.github.com/users/frstp64/orgs","repos_url":"https://api.github.com/users/frstp64/repos","events_url":"https://api.github.com/users/frstp64/events{/privacy}","received_events_url":"https://api.github.com/users/frstp64/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/frstp64/StrategyIA","description":null,"fork":true,"url":"https://api.github.com/repos/frstp64/StrategyIA","forks_url":"https://api.github.com/repos/frstp64/StrategyIA/forks","keys_url":"https://api.github.com/repos/frstp64/StrategyIA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/frstp64/StrategyIA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/frstp64/StrategyIA/teams","hooks_url":"https://api.github.com/repos/frstp64/StrategyIA/hooks","issue_events_url":"https://api.github.com/repos/frstp64/StrategyIA/issues/events{/number}","events_url":"https://api.github.com/repos/frstp64/StrategyIA/events","assignees_url":"https://api.github.com/repos/frstp64/StrategyIA/assignees{/user}","branches_url":"https://api.github.com/repos/frstp64/StrategyIA/branches{/branch}","tags_url":"https://api.github.com/repos/frstp64/StrategyIA/tags","blobs_url":"https://api.github.com/repos/frstp64/StrategyIA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/frstp64/StrategyIA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/frstp64/StrategyIA/git/refs{/sha}","trees_url":"https://api.github.com/repos/frstp64/StrategyIA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/frstp64/StrategyIA/statuses/{sha}","languages_url":"https://api.github.com/repos/frstp64/StrategyIA/languages","stargazers_url":"https://api.github.com/repos/frstp64/StrategyIA/stargazers","contributors_url":"https://api.github.com/repos/frstp64/StrategyIA/contributors","subscribers_url":"https://api.github.com/repos/frstp64/StrategyIA/subscribers","subscription_url":"https://api.github.com/repos/frstp64/StrategyIA/subscription","commits_url":"https://api.github.com/repos/frstp64/StrategyIA/commits{/sha}","git_commits_url":"https://api.github.com/repos/frstp64/StrategyIA/git/commits{/sha}","comments_url":"https://api.github.com/repos/frstp64/StrategyIA/comments{/number}","issue_comment_url":"https://api.github.com/repos/frstp64/StrategyIA/issues/comments{/number}","contents_url":"https://api.github.com/repos/frstp64/StrategyIA/contents/{+path}","compare_url":"https://api.github.com/repos/frstp64/StrategyIA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/frstp64/StrategyIA/merges","archive_url":"https://api.github.com/repos/frstp64/StrategyIA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/frstp64/StrategyIA/downloads","issues_url":"https://api.github.com/repos/frstp64/StrategyIA/issues{/number}","pulls_url":"https://api.github.com/repos/frstp64/StrategyIA/pulls{/number}","milestones_url":"https://api.github.com/repos/frstp64/StrategyIA/milestones{/number}","notifications_url":"https://api.github.com/repos/frstp64/StrategyIA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/frstp64/StrategyIA/labels{/name}","releases_url":"https://api.github.com/repos/frstp64/StrategyIA/releases{/id}","deployments_url":"https://api.github.com/repos/frstp64/StrategyIA/deployments","created_at":"2018-01-11T16:11:13Z","updated_at":"2018-03-14T00:31:57Z","pushed_at":"2018-03-14T02:20:47Z","git_url":"git://github.com/frstp64/StrategyIA.git","ssh_url":"git@github.com:frstp64/StrategyIA.git","clone_url":"https://github.com/frstp64/StrategyIA.git","svn_url":"https://github.com/frstp64/StrategyIA","homepage":null,"size":6502,"stargazers_count":0,"watchers_count":0,"language":"Python","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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"RoboCupULaval:dev","ref":"dev","sha":"69cc2482776ed69fbb9bd733a25600afccb5512d","user":{"login":"RoboCupULaval","id":4028216,"avatar_url":"https://avatars2.githubusercontent.com/u/4028216?v=4","gravatar_id":"","url":"https://api.github.com/users/RoboCupULaval","html_url":"https://github.com/RoboCupULaval","followers_url":"https://api.github.com/users/RoboCupULaval/followers","following_url":"https://api.github.com/users/RoboCupULaval/following{/other_user}","gists_url":"https://api.github.com/users/RoboCupULaval/gists{/gist_id}","starred_url":"https://api.github.com/users/RoboCupULaval/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoboCupULaval/subscriptions","organizations_url":"https://api.github.com/users/RoboCupULaval/orgs","repos_url":"https://api.github.com/users/RoboCupULaval/repos","events_url":"https://api.github.com/users/RoboCupULaval/events{/privacy}","received_events_url":"https://api.github.com/users/RoboCupULaval/received_events","type":"Organization","site_admin":false},"repo":{"id":36185030,"name":"StrategyAI","full_name":"RoboCupULaval/StrategyAI","owner":{"login":"RoboCupULaval","id":4028216,"avatar_url":"https://avatars2.githubusercontent.com/u/4028216?v=4","gravatar_id":"","url":"https://api.github.com/users/RoboCupULaval","html_url":"https://github.com/RoboCupULaval","followers_url":"https://api.github.com/users/RoboCupULaval/followers","following_url":"https://api.github.com/users/RoboCupULaval/following{/other_user}","gists_url":"https://api.github.com/users/RoboCupULaval/gists{/gist_id}","starred_url":"https://api.github.com/users/RoboCupULaval/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoboCupULaval/subscriptions","organizations_url":"https://api.github.com/users/RoboCupULaval/orgs","repos_url":"https://api.github.com/users/RoboCupULaval/repos","events_url":"https://api.github.com/users/RoboCupULaval/events{/privacy}","received_events_url":"https://api.github.com/users/RoboCupULaval/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RoboCupULaval/StrategyAI","description":"Robocup ULaval's artificial intelligence software","fork":false,"url":"https://api.github.com/repos/RoboCupULaval/StrategyAI","forks_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/forks","keys_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/teams","hooks_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/hooks","issue_events_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/issues/events{/number}","events_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/events","assignees_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/assignees{/user}","branches_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/branches{/branch}","tags_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/tags","blobs_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/git/refs{/sha}","trees_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/statuses/{sha}","languages_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/languages","stargazers_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/stargazers","contributors_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/contributors","subscribers_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/subscribers","subscription_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/subscription","commits_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/commits{/sha}","git_commits_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/git/commits{/sha}","comments_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/comments{/number}","issue_comment_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/issues/comments{/number}","contents_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/contents/{+path}","compare_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/merges","archive_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/downloads","issues_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/issues{/number}","pulls_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/pulls{/number}","milestones_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/milestones{/number}","notifications_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/labels{/name}","releases_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/releases{/id}","deployments_url":"https://api.github.com/repos/RoboCupULaval/StrategyAI/deployments","created_at":"2015-05-24T17:54:50Z","updated_at":"2018-03-13T23:41:48Z","pushed_at":"2018-03-14T02:31:57Z","git_url":"git://github.com/RoboCupULaval/StrategyAI.git","ssh_url":"git@github.com:RoboCupULaval/StrategyAI.git","clone_url":"https://github.com/RoboCupULaval/StrategyAI.git","svn_url":"https://github.com/RoboCupULaval/StrategyAI","homepage":"http://www.robocupulaval.com","size":6563,"stargazers_count":11,"watchers_count":11,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":23,"mirror_url":null,"archived":false,"open_issues_count":27,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":23,"open_issues":27,"watchers":11,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/RoboCupULaval/StrategyAI/pulls/344"},"html":{"href":"https://github.com/RoboCupULaval/StrategyAI/pull/344"},"issue":{"href":"https://api.github.com/repos/RoboCupULaval/StrategyAI/issues/344"},"comments":{"href":"https://api.github.com/repos/RoboCupULaval/StrategyAI/issues/344/comments"},"review_comments":{"href":"https://api.github.com/repos/RoboCupULaval/StrategyAI/pulls/344/comments"},"review_comment":{"href":"https://api.github.com/repos/RoboCupULaval/StrategyAI/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RoboCupULaval/StrategyAI/pulls/344/commits"},"statuses":{"href":"https://api.github.com/repos/RoboCupULaval/StrategyAI/statuses/9ce2b6709550f59b805f3029d1b85713ea285b3b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"sim0504"}}