{"action":"created","comment":{"url":"https://api.github.com/repos/learningequality/kolibri/pulls/comments/223756542","pull_request_review_id":162960645,"id":223756542,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzc1NjU0Mg==","diff_hunk":"@@ -0,0 +1,3 @@\n+\"\"\"macOS platform implementation.\"\"\"\n+from __future__ import absolute_import\n+from __future__ import division","path":"kolibri/core/analytics/pskolibri/_psosx.py","position":3,"original_position":3,"commit_id":"282a676d88c02d3b5abde42304fbe4d0bfd4b426","original_commit_id":"51bcd860adce763aa028226989cc27a9cd077faf","user":{"login":"jredrejo","id":1008178,"node_id":"MDQ6VXNlcjEwMDgxNzg=","avatar_url":"https://avatars3.githubusercontent.com/u/1008178?v=4","gravatar_id":"","url":"https://api.github.com/users/jredrejo","html_url":"https://github.com/jredrejo","followers_url":"https://api.github.com/users/jredrejo/followers","following_url":"https://api.github.com/users/jredrejo/following{/other_user}","gists_url":"https://api.github.com/users/jredrejo/gists{/gist_id}","starred_url":"https://api.github.com/users/jredrejo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jredrejo/subscriptions","organizations_url":"https://api.github.com/users/jredrejo/orgs","repos_url":"https://api.github.com/users/jredrejo/repos","events_url":"https://api.github.com/users/jredrejo/events{/privacy}","received_events_url":"https://api.github.com/users/jredrejo/received_events","type":"User","site_admin":false},"body":"It is. OSX version is not started, not even sure if it is worth doing it.","created_at":"2018-10-09T15:40:35Z","updated_at":"2018-10-09T15:40:35Z","html_url":"https://github.com/learningequality/kolibri/pull/4276#discussion_r223756542","pull_request_url":"https://api.github.com/repos/learningequality/kolibri/pulls/4276","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/learningequality/kolibri/pulls/comments/223756542"},"html":{"href":"https://github.com/learningequality/kolibri/pull/4276#discussion_r223756542"},"pull_request":{"href":"https://api.github.com/repos/learningequality/kolibri/pulls/4276"}},"in_reply_to_id":223477008},"pull_request":{"url":"https://api.github.com/repos/learningequality/kolibri/pulls/4276","id":216417033,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2NDE3MDMz","html_url":"https://github.com/learningequality/kolibri/pull/4276","diff_url":"https://github.com/learningequality/kolibri/pull/4276.diff","patch_url":"https://github.com/learningequality/kolibri/pull/4276.patch","issue_url":"https://api.github.com/repos/learningequality/kolibri/issues/4276","number":4276,"state":"open","locked":false,"title":"basic kolibri manage command for testing server performance","user":{"login":"jredrejo","id":1008178,"node_id":"MDQ6VXNlcjEwMDgxNzg=","avatar_url":"https://avatars3.githubusercontent.com/u/1008178?v=4","gravatar_id":"","url":"https://api.github.com/users/jredrejo","html_url":"https://github.com/jredrejo","followers_url":"https://api.github.com/users/jredrejo/followers","following_url":"https://api.github.com/users/jredrejo/following{/other_user}","gists_url":"https://api.github.com/users/jredrejo/gists{/gist_id}","starred_url":"https://api.github.com/users/jredrejo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jredrejo/subscriptions","organizations_url":"https://api.github.com/users/jredrejo/orgs","repos_url":"https://api.github.com/users/jredrejo/repos","events_url":"https://api.github.com/users/jredrejo/events{/privacy}","received_events_url":"https://api.github.com/users/jredrejo/received_events","type":"User","site_admin":false},"body":"### Summary\r\nThis PR creates two new commands that should help to get performance information of the machine where kolibri is being run. The new commands are called `profile` and `benchmark`\r\n\r\n##### profile command\r\n\r\nThe command can be executed, currently, in two ways:\r\n\r\n- `kolibri manage profile`\r\n- `kolibri manage profile --num_samples=60`\r\n\r\nIn both cases the information is written in the file KOLIBRI_HOME/performance.log. \r\n`--num_samples` is the number of times the information is collected and saved, every 10 seconds. 60 is the default value, thus the execution will last 10 minutes if num_samples is not changed.\r\n\r\nEach log line contains, in this order, this information:\r\n- Date and time of the command execution\r\n- Number of Kolibri active sessions (including guest sessions)\r\n- Number of Kolibri logged users\r\n- Number of Kolibri users that have done some interaction in the last minute\r\n- Total percentage of use of the CPU\r\n- Total used memory\r\n- Total available memory\r\n- Number of processes executed in the server\r\n- Percentage of cpu used by Kolibri\r\n- Percentage of memory used by Kolibri\r\n\r\nAlso, while the command is being executed, the Kolibri server will profile every request, writing the information on a second file at KOLIBRI_HOME/requests_performance.log. \r\nFor each request, one line with this information is saved:\r\n- Timestamp\r\n- Request path\r\n- Time spent processing the request\r\n- Memory (in Kbytes) used by the kolibri process when the request came in\r\n- Memory (in Kbytes) used by the kolibri process when the response was sent\r\n- Percentage of use of cpu by the Kolibri process when the request came in\r\n- Percentage of use of cpu by the Kolibri process when the response was sent\r\n- One flag indicating if this request is the slowest since the analysis was started\r\n\r\n##### benchmark command\r\n\r\nTo execute it \r\n`kolibri manage benchmark`\r\n\r\nIt will ouput grouped information about the server where Kolibri is being run and the resources kolibri is using. It must be considered as a snapshot of an instant, results can vary depending on the load the server has. \r\n![benchmark](https://user-images.githubusercontent.com/1008178/46422101-e3912580-c733-11e8-93b4-f7ed51ac3184.png)\r\n\r\n\r\n### Reviewer guidance\r\nThis is a finished work. It supports Windows and Linux, but not MacOs servers.\r\n\r\nSome things that should be take into account:\r\n- Profiling command will provide information of only one thread of the running server. Kolibri is thread safe so the information can't be shared between threads unless a persistent storage is used. For the future, if needed, a lock file might be used to replace the current mechanism (a request from the command to the server)\r\n- Benchmark command uses a few available urls that don't require authentication. The timing output is not very representative. We could think of creating some endpoints doing intensive cpu/database work to get a better idea on how comfortable Kolibri is in the server ¿ideas?\r\n\r\n### References\r\nResolves #4270 \r\n\r\n\r\n### Contributor Checklist\r\n\r\n- [ ] Contributor has fully tested the PR manually\r\n- [x] PR has the correct target branch and milestone\r\n- [x] PR has 'needs review' or 'work-in-progress' label\r\n- [ ] If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')\r\n- [ ] If there are any front-end changes, before/after screenshots are included\r\n- [ ] If this is an important user-facing change, PR or related issue has a 'changelog' label\r\n\r\n### Reviewer Checklist\r\n\r\n- [ ] Automated test coverage is satisfactory\r\n- [x] Reviewer has fully tested the PR manually\r\n- [x] PR has been tested for [accessibility regressions](http://kolibri-dev.readthedocs.io/en/develop/manual_testing.html#accessibility-a11y-testing)\r\n- [ ] External dependencies files were updated (`yarn` and `pip`)\r\n- [ ] Documentation is updated\r\n- [ ] Link to diff of internal dependency change is included\r\n- [ ] CHANGELOG.rst is updated for high-level changes\r\n- [x] Contributor is in AUTHORS.rst\r\n","created_at":"2018-09-18T19:25:12Z","updated_at":"2018-10-09T15:40:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4467c61b72cca8b2146a25b43546ada87c26a38c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":410338552,"node_id":"MDU6TGFiZWw0MTAzMzg1NTI=","url":"https://api.github.com/repos/learningequality/kolibri/labels/PR:%20needs%20review","name":"PR: needs review","color":"1f6ad6","default":false}],"milestone":{"url":"https://api.github.com/repos/learningequality/kolibri/milestones/22","html_url":"https://github.com/learningequality/kolibri/milestone/22","labels_url":"https://api.github.com/repos/learningequality/kolibri/milestones/22/labels","id":3254318,"node_id":"MDk6TWlsZXN0b25lMzI1NDMxOA==","number":22,"title":"0.11.0","description":"","creator":{"login":"indirectlylit","id":2367265,"node_id":"MDQ6VXNlcjIzNjcyNjU=","avatar_url":"https://avatars2.githubusercontent.com/u/2367265?v=4","gravatar_id":"","url":"https://api.github.com/users/indirectlylit","html_url":"https://github.com/indirectlylit","followers_url":"https://api.github.com/users/indirectlylit/followers","following_url":"https://api.github.com/users/indirectlylit/following{/other_user}","gists_url":"https://api.github.com/users/indirectlylit/gists{/gist_id}","starred_url":"https://api.github.com/users/indirectlylit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indirectlylit/subscriptions","organizations_url":"https://api.github.com/users/indirectlylit/orgs","repos_url":"https://api.github.com/users/indirectlylit/repos","events_url":"https://api.github.com/users/indirectlylit/events{/privacy}","received_events_url":"https://api.github.com/users/indirectlylit/received_events","type":"User","site_admin":false},"open_issues":23,"closed_issues":172,"state":"open","created_at":"2018-04-09T23:34:55Z","updated_at":"2018-10-08T17:54:13Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/learningequality/kolibri/pulls/4276/commits","review_comments_url":"https://api.github.com/repos/learningequality/kolibri/pulls/4276/comments","review_comment_url":"https://api.github.com/repos/learningequality/kolibri/pulls/comments{/number}","comments_url":"https://api.github.com/repos/learningequality/kolibri/issues/4276/comments","statuses_url":"https://api.github.com/repos/learningequality/kolibri/statuses/282a676d88c02d3b5abde42304fbe4d0bfd4b426","head":{"label":"jredrejo:performance_command","ref":"performance_command","sha":"282a676d88c02d3b5abde42304fbe4d0bfd4b426","user":{"login":"jredrejo","id":1008178,"node_id":"MDQ6VXNlcjEwMDgxNzg=","avatar_url":"https://avatars3.githubusercontent.com/u/1008178?v=4","gravatar_id":"","url":"https://api.github.com/users/jredrejo","html_url":"https://github.com/jredrejo","followers_url":"https://api.github.com/users/jredrejo/followers","following_url":"https://api.github.com/users/jredrejo/following{/other_user}","gists_url":"https://api.github.com/users/jredrejo/gists{/gist_id}","starred_url":"https://api.github.com/users/jredrejo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jredrejo/subscriptions","organizations_url":"https://api.github.com/users/jredrejo/orgs","repos_url":"https://api.github.com/users/jredrejo/repos","events_url":"https://api.github.com/users/jredrejo/events{/privacy}","received_events_url":"https://api.github.com/users/jredrejo/received_events","type":"User","site_admin":false},"repo":{"id":129278883,"node_id":"MDEwOlJlcG9zaXRvcnkxMjkyNzg4ODM=","name":"kolibri","full_name":"jredrejo/kolibri","private":false,"owner":{"login":"jredrejo","id":1008178,"node_id":"MDQ6VXNlcjEwMDgxNzg=","avatar_url":"https://avatars3.githubusercontent.com/u/1008178?v=4","gravatar_id":"","url":"https://api.github.com/users/jredrejo","html_url":"https://github.com/jredrejo","followers_url":"https://api.github.com/users/jredrejo/followers","following_url":"https://api.github.com/users/jredrejo/following{/other_user}","gists_url":"https://api.github.com/users/jredrejo/gists{/gist_id}","starred_url":"https://api.github.com/users/jredrejo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jredrejo/subscriptions","organizations_url":"https://api.github.com/users/jredrejo/orgs","repos_url":"https://api.github.com/users/jredrejo/repos","events_url":"https://api.github.com/users/jredrejo/events{/privacy}","received_events_url":"https://api.github.com/users/jredrejo/received_events","type":"User","site_admin":false},"html_url":"https://github.com/jredrejo/kolibri","description":"Kolibri: the offline app for universal education","fork":true,"url":"https://api.github.com/repos/jredrejo/kolibri","forks_url":"https://api.github.com/repos/jredrejo/kolibri/forks","keys_url":"https://api.github.com/repos/jredrejo/kolibri/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jredrejo/kolibri/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jredrejo/kolibri/teams","hooks_url":"https://api.github.com/repos/jredrejo/kolibri/hooks","issue_events_url":"https://api.github.com/repos/jredrejo/kolibri/issues/events{/number}","events_url":"https://api.github.com/repos/jredrejo/kolibri/events","assignees_url":"https://api.github.com/repos/jredrejo/kolibri/assignees{/user}","branches_url":"https://api.github.com/repos/jredrejo/kolibri/branches{/branch}","tags_url":"https://api.github.com/repos/jredrejo/kolibri/tags","blobs_url":"https://api.github.com/repos/jredrejo/kolibri/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jredrejo/kolibri/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jredrejo/kolibri/git/refs{/sha}","trees_url":"https://api.github.com/repos/jredrejo/kolibri/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jredrejo/kolibri/statuses/{sha}","languages_url":"https://api.github.com/repos/jredrejo/kolibri/languages","stargazers_url":"https://api.github.com/repos/jredrejo/kolibri/stargazers","contributors_url":"https://api.github.com/repos/jredrejo/kolibri/contributors","subscribers_url":"https://api.github.com/repos/jredrejo/kolibri/subscribers","subscription_url":"https://api.github.com/repos/jredrejo/kolibri/subscription","commits_url":"https://api.github.com/repos/jredrejo/kolibri/commits{/sha}","git_commits_url":"https://api.github.com/repos/jredrejo/kolibri/git/commits{/sha}","comments_url":"https://api.github.com/repos/jredrejo/kolibri/comments{/number}","issue_comment_url":"https://api.github.com/repos/jredrejo/kolibri/issues/comments{/number}","contents_url":"https://api.github.com/repos/jredrejo/kolibri/contents/{+path}","compare_url":"https://api.github.com/repos/jredrejo/kolibri/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jredrejo/kolibri/merges","archive_url":"https://api.github.com/repos/jredrejo/kolibri/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jredrejo/kolibri/downloads","issues_url":"https://api.github.com/repos/jredrejo/kolibri/issues{/number}","pulls_url":"https://api.github.com/repos/jredrejo/kolibri/pulls{/number}","milestones_url":"https://api.github.com/repos/jredrejo/kolibri/milestones{/number}","notifications_url":"https://api.github.com/repos/jredrejo/kolibri/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jredrejo/kolibri/labels{/name}","releases_url":"https://api.github.com/repos/jredrejo/kolibri/releases{/id}","deployments_url":"https://api.github.com/repos/jredrejo/kolibri/deployments","created_at":"2018-04-12T16:13:58Z","updated_at":"2018-10-04T07:08:54Z","pushed_at":"2018-10-08T20:49:36Z","git_url":"git://github.com/jredrejo/kolibri.git","ssh_url":"git@github.com:jredrejo/kolibri.git","clone_url":"https://github.com/jredrejo/kolibri.git","svn_url":"https://github.com/jredrejo/kolibri","homepage":"http://learningequality.org/kolibri/","size":45095,"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":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"learningequality:develop","ref":"develop","sha":"57496cc6e3e5eee2d5e211e3ac4455cfaa54458d","user":{"login":"learningequality","id":3926525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5MjY1MjU=","avatar_url":"https://avatars1.githubusercontent.com/u/3926525?v=4","gravatar_id":"","url":"https://api.github.com/users/learningequality","html_url":"https://github.com/learningequality","followers_url":"https://api.github.com/users/learningequality/followers","following_url":"https://api.github.com/users/learningequality/following{/other_user}","gists_url":"https://api.github.com/users/learningequality/gists{/gist_id}","starred_url":"https://api.github.com/users/learningequality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learningequality/subscriptions","organizations_url":"https://api.github.com/users/learningequality/orgs","repos_url":"https://api.github.com/users/learningequality/repos","events_url":"https://api.github.com/users/learningequality/events{/privacy}","received_events_url":"https://api.github.com/users/learningequality/received_events","type":"Organization","site_admin":false},"repo":{"id":49976939,"node_id":"MDEwOlJlcG9zaXRvcnk0OTk3NjkzOQ==","name":"kolibri","full_name":"learningequality/kolibri","private":false,"owner":{"login":"learningequality","id":3926525,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM5MjY1MjU=","avatar_url":"https://avatars1.githubusercontent.com/u/3926525?v=4","gravatar_id":"","url":"https://api.github.com/users/learningequality","html_url":"https://github.com/learningequality","followers_url":"https://api.github.com/users/learningequality/followers","following_url":"https://api.github.com/users/learningequality/following{/other_user}","gists_url":"https://api.github.com/users/learningequality/gists{/gist_id}","starred_url":"https://api.github.com/users/learningequality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learningequality/subscriptions","organizations_url":"https://api.github.com/users/learningequality/orgs","repos_url":"https://api.github.com/users/learningequality/repos","events_url":"https://api.github.com/users/learningequality/events{/privacy}","received_events_url":"https://api.github.com/users/learningequality/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/learningequality/kolibri","description":"Kolibri: the offline app for universal education","fork":false,"url":"https://api.github.com/repos/learningequality/kolibri","forks_url":"https://api.github.com/repos/learningequality/kolibri/forks","keys_url":"https://api.github.com/repos/learningequality/kolibri/keys{/key_id}","collaborators_url":"https://api.github.com/repos/learningequality/kolibri/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/learningequality/kolibri/teams","hooks_url":"https://api.github.com/repos/learningequality/kolibri/hooks","issue_events_url":"https://api.github.com/repos/learningequality/kolibri/issues/events{/number}","events_url":"https://api.github.com/repos/learningequality/kolibri/events","assignees_url":"https://api.github.com/repos/learningequality/kolibri/assignees{/user}","branches_url":"https://api.github.com/repos/learningequality/kolibri/branches{/branch}","tags_url":"https://api.github.com/repos/learningequality/kolibri/tags","blobs_url":"https://api.github.com/repos/learningequality/kolibri/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/learningequality/kolibri/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/learningequality/kolibri/git/refs{/sha}","trees_url":"https://api.github.com/repos/learningequality/kolibri/git/trees{/sha}","statuses_url":"https://api.github.com/repos/learningequality/kolibri/statuses/{sha}","languages_url":"https://api.github.com/repos/learningequality/kolibri/languages","stargazers_url":"https://api.github.com/repos/learningequality/kolibri/stargazers","contributors_url":"https://api.github.com/repos/learningequality/kolibri/contributors","subscribers_url":"https://api.github.com/repos/learningequality/kolibri/subscribers","subscription_url":"https://api.github.com/repos/learningequality/kolibri/subscription","commits_url":"https://api.github.com/repos/learningequality/kolibri/commits{/sha}","git_commits_url":"https://api.github.com/repos/learningequality/kolibri/git/commits{/sha}","comments_url":"https://api.github.com/repos/learningequality/kolibri/comments{/number}","issue_comment_url":"https://api.github.com/repos/learningequality/kolibri/issues/comments{/number}","contents_url":"https://api.github.com/repos/learningequality/kolibri/contents/{+path}","compare_url":"https://api.github.com/repos/learningequality/kolibri/compare/{base}...{head}","merges_url":"https://api.github.com/repos/learningequality/kolibri/merges","archive_url":"https://api.github.com/repos/learningequality/kolibri/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/learningequality/kolibri/downloads","issues_url":"https://api.github.com/repos/learningequality/kolibri/issues{/number}","pulls_url":"https://api.github.com/repos/learningequality/kolibri/pulls{/number}","milestones_url":"https://api.github.com/repos/learningequality/kolibri/milestones{/number}","notifications_url":"https://api.github.com/repos/learningequality/kolibri/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/learningequality/kolibri/labels{/name}","releases_url":"https://api.github.com/repos/learningequality/kolibri/releases{/id}","deployments_url":"https://api.github.com/repos/learningequality/kolibri/deployments","created_at":"2016-01-19T19:22:07Z","updated_at":"2018-10-09T13:14:49Z","pushed_at":"2018-10-09T12:32:04Z","git_url":"git://github.com/learningequality/kolibri.git","ssh_url":"git@github.com:learningequality/kolibri.git","clone_url":"https://github.com/learningequality/kolibri.git","svn_url":"https://github.com/learningequality/kolibri","homepage":"https://learningequality.org/kolibri/","size":50409,"stargazers_count":204,"watchers_count":204,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":144,"mirror_url":null,"archived":false,"open_issues_count":292,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":144,"open_issues":292,"watchers":204,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/learningequality/kolibri/pulls/4276"},"html":{"href":"https://github.com/learningequality/kolibri/pull/4276"},"issue":{"href":"https://api.github.com/repos/learningequality/kolibri/issues/4276"},"comments":{"href":"https://api.github.com/repos/learningequality/kolibri/issues/4276/comments"},"review_comments":{"href":"https://api.github.com/repos/learningequality/kolibri/pulls/4276/comments"},"review_comment":{"href":"https://api.github.com/repos/learningequality/kolibri/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/learningequality/kolibri/pulls/4276/commits"},"statuses":{"href":"https://api.github.com/repos/learningequality/kolibri/statuses/282a676d88c02d3b5abde42304fbe4d0bfd4b426"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jredrejo"}}