{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/59290805","id":59290805,"diff_hunk":"@@ -495,6 +495,29 @@ An example of the possible output looks like:\n \n If `process.connected` is false, it is no longer possible to send messages.\n \n+## process.cpuUsage()\n+\n+Returns the user and system cpu time usage of the current process, in an object\n+with properties `user` and `system`, whose values are arrays of integers as\n+`[seconds, nanoseconds]` tuples. These values measure time spent in user and\n+system code respectively, and may end up being greater than actual elapsed time\n+if multiple cpu cores are performing work for this process.\n+\n+You may pass in the result of a previous call to `process.cpuUsage()` to get a\n+diff reading.\n+\n+```js\n+var startUsage  = process.cpuUsage();\n+// { user: [ 0, 35884000 ], system: [ 0, 7320000 ] }\n+\n+// spin the CPU for 500 milliseconds\n+var now = Date.now();\n+while (Date.now() - now < 500);\n+\n+console.log(process.cpuUsage(startUsage));\n+// { user: [ 0, 509627000 ], system: [ 0, 9993000 ] }","path":"doc/api/process.markdown","position":24,"original_position":24,"commit_id":"c9aae2dfad942b60a6d887830319cdd20ec47897","original_commit_id":"c9aae2dfad942b60a6d887830319cdd20ec47897","user":{"login":"eljefedelrodeodeljefe","id":3899684,"avatar_url":"https://avatars.githubusercontent.com/u/3899684?v=3","gravatar_id":"","url":"https://api.github.com/users/eljefedelrodeodeljefe","html_url":"https://github.com/eljefedelrodeodeljefe","followers_url":"https://api.github.com/users/eljefedelrodeodeljefe/followers","following_url":"https://api.github.com/users/eljefedelrodeodeljefe/following{/other_user}","gists_url":"https://api.github.com/users/eljefedelrodeodeljefe/gists{/gist_id}","starred_url":"https://api.github.com/users/eljefedelrodeodeljefe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eljefedelrodeodeljefe/subscriptions","organizations_url":"https://api.github.com/users/eljefedelrodeodeljefe/orgs","repos_url":"https://api.github.com/users/eljefedelrodeodeljefe/repos","events_url":"https://api.github.com/users/eljefedelrodeodeljefe/events{/privacy}","received_events_url":"https://api.github.com/users/eljefedelrodeodeljefe/received_events","type":"User","site_admin":false},"body":"nit: `const`","created_at":"2016-04-11T22:11:30Z","updated_at":"2016-04-11T22:11:30Z","html_url":"https://github.com/nodejs/node/pull/6157#discussion_r59290805","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/6157","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/59290805"},"html":{"href":"https://github.com/nodejs/node/pull/6157#discussion_r59290805"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/6157"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/6157","id":66068424,"html_url":"https://github.com/nodejs/node/pull/6157","diff_url":"https://github.com/nodejs/node/pull/6157.diff","patch_url":"https://github.com/nodejs/node/pull/6157.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/6157","number":6157,"state":"open","locked":false,"title":"process.cpuUsage() - implementation, doc, tests","user":{"login":"pmuellr","id":25117,"avatar_url":"https://avatars.githubusercontent.com/u/25117?v=3","gravatar_id":"","url":"https://api.github.com/users/pmuellr","html_url":"https://github.com/pmuellr","followers_url":"https://api.github.com/users/pmuellr/followers","following_url":"https://api.github.com/users/pmuellr/following{/other_user}","gists_url":"https://api.github.com/users/pmuellr/gists{/gist_id}","starred_url":"https://api.github.com/users/pmuellr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmuellr/subscriptions","organizations_url":"https://api.github.com/users/pmuellr/orgs","repos_url":"https://api.github.com/users/pmuellr/repos","events_url":"https://api.github.com/users/pmuellr/events{/privacy}","received_events_url":"https://api.github.com/users/pmuellr/received_events","type":"User","site_admin":false},"body":"<!--\r\nThank you for submitting a pull request to Node.js. Before you submit, please\r\nreview below requirements and walk through the checklist. You can 'tick'\r\na box by using the letter \"x\": [x].\r\n\r\nRun the test suite by invoking: `make -j4 lint test` on linux or\r\n`vcbuild test nosign` on Windows.\r\n\r\nIf this aims to fix a regression or you’re adding a feature, make sure you also\r\nwrite a test. Finally – if possible – a benchmark that quantifies your changes.\r\n\r\nFinally, read through our contributors guide and make adjustments as necessary:\r\nhttps://github.com/nodejs/node/blob/master/CONTRIBUTING.md\r\n-->\r\n\r\n##### Checklist\r\n\r\n<!-- remove lines that do not apply to you -->\r\n\r\n- [x] tests and code linting passes\r\n- [x] a test and/or benchmark is included\r\n- [x] documentation is changed or added\r\n- [ ] the commit message follows commit guidelines\r\n\r\n(not sure the commit message meets guidelines - it's very short, but WFM)\r\n\r\n##### Affected core subsystem(s)\r\n\r\n`process` module\r\n\r\n\r\n##### Description of change\r\n\r\nadd the function `cpuUsage()` to `process`\r\n","created_at":"2016-04-11T21:49:17Z","updated_at":"2016-04-11T22:11:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2c8bf42dcee0305267fb56e6a4fb11372c939928","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/6157/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/6157/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/6157/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/c9aae2dfad942b60a6d887830319cdd20ec47897","head":{"label":"pmuellr:cpuUsage2","ref":"cpuUsage2","sha":"c9aae2dfad942b60a6d887830319cdd20ec47897","user":{"login":"pmuellr","id":25117,"avatar_url":"https://avatars.githubusercontent.com/u/25117?v=3","gravatar_id":"","url":"https://api.github.com/users/pmuellr","html_url":"https://github.com/pmuellr","followers_url":"https://api.github.com/users/pmuellr/followers","following_url":"https://api.github.com/users/pmuellr/following{/other_user}","gists_url":"https://api.github.com/users/pmuellr/gists{/gist_id}","starred_url":"https://api.github.com/users/pmuellr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmuellr/subscriptions","organizations_url":"https://api.github.com/users/pmuellr/orgs","repos_url":"https://api.github.com/users/pmuellr/repos","events_url":"https://api.github.com/users/pmuellr/events{/privacy}","received_events_url":"https://api.github.com/users/pmuellr/received_events","type":"User","site_admin":false},"repo":{"id":43399193,"name":"node","full_name":"pmuellr/node","owner":{"login":"pmuellr","id":25117,"avatar_url":"https://avatars.githubusercontent.com/u/25117?v=3","gravatar_id":"","url":"https://api.github.com/users/pmuellr","html_url":"https://github.com/pmuellr","followers_url":"https://api.github.com/users/pmuellr/followers","following_url":"https://api.github.com/users/pmuellr/following{/other_user}","gists_url":"https://api.github.com/users/pmuellr/gists{/gist_id}","starred_url":"https://api.github.com/users/pmuellr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmuellr/subscriptions","organizations_url":"https://api.github.com/users/pmuellr/orgs","repos_url":"https://api.github.com/users/pmuellr/repos","events_url":"https://api.github.com/users/pmuellr/events{/privacy}","received_events_url":"https://api.github.com/users/pmuellr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pmuellr/node","description":"✨Node.js  ✨","fork":true,"url":"https://api.github.com/repos/pmuellr/node","forks_url":"https://api.github.com/repos/pmuellr/node/forks","keys_url":"https://api.github.com/repos/pmuellr/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pmuellr/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pmuellr/node/teams","hooks_url":"https://api.github.com/repos/pmuellr/node/hooks","issue_events_url":"https://api.github.com/repos/pmuellr/node/issues/events{/number}","events_url":"https://api.github.com/repos/pmuellr/node/events","assignees_url":"https://api.github.com/repos/pmuellr/node/assignees{/user}","branches_url":"https://api.github.com/repos/pmuellr/node/branches{/branch}","tags_url":"https://api.github.com/repos/pmuellr/node/tags","blobs_url":"https://api.github.com/repos/pmuellr/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pmuellr/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pmuellr/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/pmuellr/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pmuellr/node/statuses/{sha}","languages_url":"https://api.github.com/repos/pmuellr/node/languages","stargazers_url":"https://api.github.com/repos/pmuellr/node/stargazers","contributors_url":"https://api.github.com/repos/pmuellr/node/contributors","subscribers_url":"https://api.github.com/repos/pmuellr/node/subscribers","subscription_url":"https://api.github.com/repos/pmuellr/node/subscription","commits_url":"https://api.github.com/repos/pmuellr/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/pmuellr/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/pmuellr/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/pmuellr/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/pmuellr/node/contents/{+path}","compare_url":"https://api.github.com/repos/pmuellr/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pmuellr/node/merges","archive_url":"https://api.github.com/repos/pmuellr/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pmuellr/node/downloads","issues_url":"https://api.github.com/repos/pmuellr/node/issues{/number}","pulls_url":"https://api.github.com/repos/pmuellr/node/pulls{/number}","milestones_url":"https://api.github.com/repos/pmuellr/node/milestones{/number}","notifications_url":"https://api.github.com/repos/pmuellr/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pmuellr/node/labels{/name}","releases_url":"https://api.github.com/repos/pmuellr/node/releases{/id}","deployments_url":"https://api.github.com/repos/pmuellr/node/deployments","created_at":"2015-09-29T22:58:34Z","updated_at":"2016-03-03T06:31:25Z","pushed_at":"2016-04-11T21:40:15Z","git_url":"git://github.com/pmuellr/node.git","ssh_url":"git@github.com:pmuellr/node.git","clone_url":"https://github.com/pmuellr/node.git","svn_url":"https://github.com/pmuellr/node","homepage":"https://nodejs.org","size":187568,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nodejs:master","ref":"master","sha":"59d23ad63dc75c68631480b2bdd98cbb67265d9d","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"name":"node","full_name":"nodejs/node","owner":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":false,"url":"https://api.github.com/repos/nodejs/node","forks_url":"https://api.github.com/repos/nodejs/node/forks","keys_url":"https://api.github.com/repos/nodejs/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/node/teams","hooks_url":"https://api.github.com/repos/nodejs/node/hooks","issue_events_url":"https://api.github.com/repos/nodejs/node/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/node/events","assignees_url":"https://api.github.com/repos/nodejs/node/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/node/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/node/tags","blobs_url":"https://api.github.com/repos/nodejs/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/node/languages","stargazers_url":"https://api.github.com/repos/nodejs/node/stargazers","contributors_url":"https://api.github.com/repos/nodejs/node/contributors","subscribers_url":"https://api.github.com/repos/nodejs/node/subscribers","subscription_url":"https://api.github.com/repos/nodejs/node/subscription","commits_url":"https://api.github.com/repos/nodejs/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/node/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/node/merges","archive_url":"https://api.github.com/repos/nodejs/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/node/downloads","issues_url":"https://api.github.com/repos/nodejs/node/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/node/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/node/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/node/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/node/releases{/id}","deployments_url":"https://api.github.com/repos/nodejs/node/deployments","created_at":"2014-11-26T19:57:11Z","updated_at":"2016-04-11T22:09:25Z","pushed_at":"2016-04-11T22:05:18Z","git_url":"git://github.com/nodejs/node.git","ssh_url":"git@github.com:nodejs/node.git","clone_url":"https://github.com/nodejs/node.git","svn_url":"https://github.com/nodejs/node","homepage":"https://nodejs.org","size":232709,"stargazers_count":21940,"watchers_count":21940,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2946,"mirror_url":null,"open_issues_count":687,"forks":2946,"open_issues":687,"watchers":21940,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/6157"},"html":{"href":"https://github.com/nodejs/node/pull/6157"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/6157"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/6157/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/6157/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/6157/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/c9aae2dfad942b60a6d887830319cdd20ec47897"}}}}