{"action":"created","comment":{"url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/pulls/comments/216417984","pull_request_review_id":153893678,"id":216417984,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNjQxNzk4NA==","diff_hunk":"@@ -0,0 +1,47 @@\n+\n+monitor_memory_usage() {\n+  local output_file=$1\n+  local command=\"${@:2}\"\n+\n+  # Run the command in the background\n+  exec $command &","path":"lib/monitor.sh","position":7,"original_position":7,"commit_id":"5020ecfcffabd05a626cbae3544fe72f92afbd41","original_commit_id":"5020ecfcffabd05a626cbae3544fe72f92afbd41","user":{"login":"dzuelke","id":27900,"node_id":"MDQ6VXNlcjI3OTAw","avatar_url":"https://avatars2.githubusercontent.com/u/27900?v=4","gravatar_id":"","url":"https://api.github.com/users/dzuelke","html_url":"https://github.com/dzuelke","followers_url":"https://api.github.com/users/dzuelke/followers","following_url":"https://api.github.com/users/dzuelke/following{/other_user}","gists_url":"https://api.github.com/users/dzuelke/gists{/gist_id}","starred_url":"https://api.github.com/users/dzuelke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dzuelke/subscriptions","organizations_url":"https://api.github.com/users/dzuelke/orgs","repos_url":"https://api.github.com/users/dzuelke/repos","events_url":"https://api.github.com/users/dzuelke/events{/privacy}","received_events_url":"https://api.github.com/users/dzuelke/received_events","type":"User","site_admin":false},"body":"I am not certain about the quoting implications here, I think this may break with spaces in arguments.\r\n\r\nI would do the following:\r\n\r\n```\r\nlocal output_file=\"$1\"\r\nshift # drop $1 and leave other arguments in place but with new numbering\r\nexec \"$@\" &\r\n```\r\n","created_at":"2018-09-10T17:59:39Z","updated_at":"2018-09-10T17:59:53Z","html_url":"https://github.com/heroku/heroku-buildpack-nodejs/pull/566#discussion_r216417984","pull_request_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/pulls/566","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/pulls/comments/216417984"},"html":{"href":"https://github.com/heroku/heroku-buildpack-nodejs/pull/566#discussion_r216417984"},"pull_request":{"href":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/pulls/566"}}},"pull_request":{"url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/pulls/566","id":214025027,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE0MDI1MDI3","html_url":"https://github.com/heroku/heroku-buildpack-nodejs/pull/566","diff_url":"https://github.com/heroku/heroku-buildpack-nodejs/pull/566.diff","patch_url":"https://github.com/heroku/heroku-buildpack-nodejs/pull/566.patch","issue_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/issues/566","number":566,"state":"open","locked":false,"title":"Monitor subcommand memory usage","user":{"login":"jmorrell","id":175496,"node_id":"MDQ6VXNlcjE3NTQ5Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/175496?v=4","gravatar_id":"","url":"https://api.github.com/users/jmorrell","html_url":"https://github.com/jmorrell","followers_url":"https://api.github.com/users/jmorrell/followers","following_url":"https://api.github.com/users/jmorrell/following{/other_user}","gists_url":"https://api.github.com/users/jmorrell/gists{/gist_id}","starred_url":"https://api.github.com/users/jmorrell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmorrell/subscriptions","organizations_url":"https://api.github.com/users/jmorrell/orgs","repos_url":"https://api.github.com/users/jmorrell/repos","events_url":"https://api.github.com/users/jmorrell/events{/privacy}","received_events_url":"https://api.github.com/users/jmorrell/received_events","type":"User","site_admin":false},"body":"This adds a utility to monitor peak memory usage of build commands. This is the first step towards @harrybiddle's suggestion in https://github.com/heroku/heroku-buildpack-nodejs/issues/549. In a follow-up PR we'll add warnings for users whose memory usage is high.\r\n\r\nThe instruments the `heroku-prebuild` and `heroku-postbuild` scripts as well as all of the npm and yarn install commands to capture build commands in a `postinstall` script.","created_at":"2018-09-07T19:57:19Z","updated_at":"2018-09-10T17:59:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f8e4c37f54d12de541cb2eb1febc8b9c6c899452","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1045690718,"node_id":"MDU6TGFiZWwxMDQ1NjkwNzE4","url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/labels/languages-health-squad-review","name":"languages-health-squad-review","color":"c40963","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/pulls/566/commits","review_comments_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/pulls/566/comments","review_comment_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/issues/566/comments","statuses_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/statuses/5020ecfcffabd05a626cbae3544fe72f92afbd41","head":{"label":"heroku:monitor-build","ref":"monitor-build","sha":"5020ecfcffabd05a626cbae3544fe72f92afbd41","user":{"login":"heroku","id":23211,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMjEx","avatar_url":"https://avatars3.githubusercontent.com/u/23211?v=4","gravatar_id":"","url":"https://api.github.com/users/heroku","html_url":"https://github.com/heroku","followers_url":"https://api.github.com/users/heroku/followers","following_url":"https://api.github.com/users/heroku/following{/other_user}","gists_url":"https://api.github.com/users/heroku/gists{/gist_id}","starred_url":"https://api.github.com/users/heroku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heroku/subscriptions","organizations_url":"https://api.github.com/users/heroku/orgs","repos_url":"https://api.github.com/users/heroku/repos","events_url":"https://api.github.com/users/heroku/events{/privacy}","received_events_url":"https://api.github.com/users/heroku/received_events","type":"Organization","site_admin":false},"repo":{"id":1767089,"node_id":"MDEwOlJlcG9zaXRvcnkxNzY3MDg5","name":"heroku-buildpack-nodejs","full_name":"heroku/heroku-buildpack-nodejs","owner":{"login":"heroku","id":23211,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMjEx","avatar_url":"https://avatars3.githubusercontent.com/u/23211?v=4","gravatar_id":"","url":"https://api.github.com/users/heroku","html_url":"https://github.com/heroku","followers_url":"https://api.github.com/users/heroku/followers","following_url":"https://api.github.com/users/heroku/following{/other_user}","gists_url":"https://api.github.com/users/heroku/gists{/gist_id}","starred_url":"https://api.github.com/users/heroku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heroku/subscriptions","organizations_url":"https://api.github.com/users/heroku/orgs","repos_url":"https://api.github.com/users/heroku/repos","events_url":"https://api.github.com/users/heroku/events{/privacy}","received_events_url":"https://api.github.com/users/heroku/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/heroku/heroku-buildpack-nodejs","description":"The official Heroku buildpack for Node.js apps.","fork":false,"url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs","forks_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/forks","keys_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/teams","hooks_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/hooks","issue_events_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/issues/events{/number}","events_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/events","assignees_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/assignees{/user}","branches_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/branches{/branch}","tags_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/tags","blobs_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/git/refs{/sha}","trees_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/statuses/{sha}","languages_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/languages","stargazers_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/stargazers","contributors_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/contributors","subscribers_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/subscribers","subscription_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/subscription","commits_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/commits{/sha}","git_commits_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/git/commits{/sha}","comments_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/comments{/number}","issue_comment_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/issues/comments{/number}","contents_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/contents/{+path}","compare_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/merges","archive_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/downloads","issues_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/issues{/number}","pulls_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/pulls{/number}","milestones_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/milestones{/number}","notifications_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/labels{/name}","releases_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/releases{/id}","deployments_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/deployments","created_at":"2011-05-18T17:00:45Z","updated_at":"2018-09-07T21:42:49Z","pushed_at":"2018-09-07T21:42:47Z","git_url":"git://github.com/heroku/heroku-buildpack-nodejs.git","ssh_url":"git@github.com:heroku/heroku-buildpack-nodejs.git","clone_url":"https://github.com/heroku/heroku-buildpack-nodejs.git","svn_url":"https://github.com/heroku/heroku-buildpack-nodejs","homepage":"https://devcenter.heroku.com/articles/buildpacks","size":9464,"stargazers_count":920,"watchers_count":920,"language":"Shell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2327,"mirror_url":null,"archived":false,"open_issues_count":31,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2327,"open_issues":31,"watchers":920,"default_branch":"master"}},"base":{"label":"heroku:master","ref":"master","sha":"2c3db890e810566190874ee738b5cc5f78373830","user":{"login":"heroku","id":23211,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMjEx","avatar_url":"https://avatars3.githubusercontent.com/u/23211?v=4","gravatar_id":"","url":"https://api.github.com/users/heroku","html_url":"https://github.com/heroku","followers_url":"https://api.github.com/users/heroku/followers","following_url":"https://api.github.com/users/heroku/following{/other_user}","gists_url":"https://api.github.com/users/heroku/gists{/gist_id}","starred_url":"https://api.github.com/users/heroku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heroku/subscriptions","organizations_url":"https://api.github.com/users/heroku/orgs","repos_url":"https://api.github.com/users/heroku/repos","events_url":"https://api.github.com/users/heroku/events{/privacy}","received_events_url":"https://api.github.com/users/heroku/received_events","type":"Organization","site_admin":false},"repo":{"id":1767089,"node_id":"MDEwOlJlcG9zaXRvcnkxNzY3MDg5","name":"heroku-buildpack-nodejs","full_name":"heroku/heroku-buildpack-nodejs","owner":{"login":"heroku","id":23211,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMjEx","avatar_url":"https://avatars3.githubusercontent.com/u/23211?v=4","gravatar_id":"","url":"https://api.github.com/users/heroku","html_url":"https://github.com/heroku","followers_url":"https://api.github.com/users/heroku/followers","following_url":"https://api.github.com/users/heroku/following{/other_user}","gists_url":"https://api.github.com/users/heroku/gists{/gist_id}","starred_url":"https://api.github.com/users/heroku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heroku/subscriptions","organizations_url":"https://api.github.com/users/heroku/orgs","repos_url":"https://api.github.com/users/heroku/repos","events_url":"https://api.github.com/users/heroku/events{/privacy}","received_events_url":"https://api.github.com/users/heroku/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/heroku/heroku-buildpack-nodejs","description":"The official Heroku buildpack for Node.js apps.","fork":false,"url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs","forks_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/forks","keys_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/teams","hooks_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/hooks","issue_events_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/issues/events{/number}","events_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/events","assignees_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/assignees{/user}","branches_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/branches{/branch}","tags_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/tags","blobs_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/git/refs{/sha}","trees_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/statuses/{sha}","languages_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/languages","stargazers_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/stargazers","contributors_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/contributors","subscribers_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/subscribers","subscription_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/subscription","commits_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/commits{/sha}","git_commits_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/git/commits{/sha}","comments_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/comments{/number}","issue_comment_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/issues/comments{/number}","contents_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/contents/{+path}","compare_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/merges","archive_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/downloads","issues_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/issues{/number}","pulls_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/pulls{/number}","milestones_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/milestones{/number}","notifications_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/labels{/name}","releases_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/releases{/id}","deployments_url":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/deployments","created_at":"2011-05-18T17:00:45Z","updated_at":"2018-09-07T21:42:49Z","pushed_at":"2018-09-07T21:42:47Z","git_url":"git://github.com/heroku/heroku-buildpack-nodejs.git","ssh_url":"git@github.com:heroku/heroku-buildpack-nodejs.git","clone_url":"https://github.com/heroku/heroku-buildpack-nodejs.git","svn_url":"https://github.com/heroku/heroku-buildpack-nodejs","homepage":"https://devcenter.heroku.com/articles/buildpacks","size":9464,"stargazers_count":920,"watchers_count":920,"language":"Shell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2327,"mirror_url":null,"archived":false,"open_issues_count":31,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2327,"open_issues":31,"watchers":920,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/pulls/566"},"html":{"href":"https://github.com/heroku/heroku-buildpack-nodejs/pull/566"},"issue":{"href":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/issues/566"},"comments":{"href":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/issues/566/comments"},"review_comments":{"href":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/pulls/566/comments"},"review_comment":{"href":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/pulls/566/commits"},"statuses":{"href":"https://api.github.com/repos/heroku/heroku-buildpack-nodejs/statuses/5020ecfcffabd05a626cbae3544fe72f92afbd41"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dzuelke"}}