{"action":"created","comment":{"url":"https://api.github.com/repos/i0natan/node-chaos-monkey/pulls/comments/228092662","pull_request_review_id":168279290,"id":228092662,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODA5MjY2Mg==","diff_hunk":"@@ -0,0 +1,16 @@\n+// do no use directly this prank!\n+const {\n+    createCipheriv\n+} = require(\"crypto\");\n+const {\n+    generate\n+} = require(\"randomstring\");\n+\n+while (true) {\n+    const cipher = createCipheriv('aes-256-gcm', generate(32), generate(12));\n+    cipher.update(generate(2048));\n+    cipher.final();\n+    // we use here eval to make the compiler do less optimization\n+    // otherwise this loop can be optimized to do nothing\n+    eval();","path":"pranks/cpu-load-worker-internal.js","position":15,"original_position":15,"commit_id":"1f823f2250dbf59131f686218bd004377eac6e00","original_commit_id":"1f823f2250dbf59131f686218bd004377eac6e00","user":{"login":"benjamingr","id":1315533,"node_id":"MDQ6VXNlcjEzMTU1MzM=","avatar_url":"https://avatars2.githubusercontent.com/u/1315533?v=4","gravatar_id":"","url":"https://api.github.com/users/benjamingr","html_url":"https://github.com/benjamingr","followers_url":"https://api.github.com/users/benjamingr/followers","following_url":"https://api.github.com/users/benjamingr/following{/other_user}","gists_url":"https://api.github.com/users/benjamingr/gists{/gist_id}","starred_url":"https://api.github.com/users/benjamingr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjamingr/subscriptions","organizations_url":"https://api.github.com/users/benjamingr/orgs","repos_url":"https://api.github.com/users/benjamingr/repos","events_url":"https://api.github.com/users/benjamingr/events{/privacy}","received_events_url":"https://api.github.com/users/benjamingr/received_events","type":"User","site_admin":false},"body":"Why would it be optimized for nothing? `createCipheriv` crosses the boundary to C++ and I don't think V8 is smart enough to DCE optimize this. (Is it?)","created_at":"2018-10-25T09:09:28Z","updated_at":"2018-10-25T09:09:29Z","html_url":"https://github.com/i0natan/node-chaos-monkey/pull/1#discussion_r228092662","pull_request_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/i0natan/node-chaos-monkey/pulls/comments/228092662"},"html":{"href":"https://github.com/i0natan/node-chaos-monkey/pull/1#discussion_r228092662"},"pull_request":{"href":"https://api.github.com/repos/i0natan/node-chaos-monkey/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/i0natan/node-chaos-monkey/pulls/1","id":199681097,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5NjgxMDk3","html_url":"https://github.com/i0natan/node-chaos-monkey/pull/1","diff_url":"https://github.com/i0natan/node-chaos-monkey/pull/1.diff","patch_url":"https://github.com/i0natan/node-chaos-monkey/pull/1.patch","issue_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/issues/1","number":1,"state":"open","locked":false,"title":"Optimization + real CPU memory prank ","user":{"login":"KromDaniel","id":17231281,"node_id":"MDQ6VXNlcjE3MjMxMjgx","avatar_url":"https://avatars2.githubusercontent.com/u/17231281?v=4","gravatar_id":"","url":"https://api.github.com/users/KromDaniel","html_url":"https://github.com/KromDaniel","followers_url":"https://api.github.com/users/KromDaniel/followers","following_url":"https://api.github.com/users/KromDaniel/following{/other_user}","gists_url":"https://api.github.com/users/KromDaniel/gists{/gist_id}","starred_url":"https://api.github.com/users/KromDaniel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KromDaniel/subscriptions","organizations_url":"https://api.github.com/users/KromDaniel/orgs","repos_url":"https://api.github.com/users/KromDaniel/repos","events_url":"https://api.github.com/users/KromDaniel/events{/privacy}","received_events_url":"https://api.github.com/users/KromDaniel/received_events","type":"User","site_admin":false},"body":"Hey,\r\nI made some changes to the project, the project is still not production ready but this is a good start\r\n\r\n\r\n## Size optimization:\r\n1. Added to .gitignore .history and .vscode and removed them from the git repo\r\n2. removed unused dependency as `underscore` (as a library, we want to be minimal size)\r\n3. removed `pranks/big-text-file`\r\n\r\npackage size:\r\n\r\n|      npm modules     | before | after  |\r\n|:--------------------:|--------|--------|\r\n| with node_modules    | 6.6MB  | 3.07MB |\r\n| without node_modules | 3.96MB | 512KB  |\r\n\r\n-----\r\n\r\n## CPU Load\r\nThe CPU load didn't really test any CPU load, it had a big impact on the memory, and had a minor impact on the event loop, but it's not really CPU intensive test.\r\n\r\nBasically we do want to have 3 different tests (each test should have minor as possible impact on the others)\r\n\r\n1. CPU load\r\n2. Memory load\r\n3. Event loop block\r\n\r\nI changed the CPU test to be memory light and none blocking event loop (it uses fork, the child process is fully blocked)\r\nbut now, it actually loads the CPU for 95-100% \r\n\r\nThe start is getting duration argument and now stop will actually stop the test\r\n\r\nThere's one thing I didn't change on the class which is this: (only added the comment)\r\n\r\n```js\r\nconstructor(expressApp) {\r\n\t// @todo, not to do this\r\n\tsuper(...arguments);\r\n}\r\n```\r\nin my opinion, this is a bad practice. I didn't change that because I wasn't sure what args the constructor gets and also the super class isn't used at all\r\n\r\nAnyway, let's take this project to good places!\r\n\r\n-----\r\nJust noticed a bug I have\r\n\r\n```\r\n\tstop() {\r\n\t\tthis.forks.forEach((f) => {\r\n\t\t\tf.kill(\"SIGKILL\");\r\n\t\t});\r\n\t\tthis.forks = [];\r\n\t}\r\n```\r\n\r\nshould also clear the existing timeout.\r\n`clearTimeout(this.stopTimeout)`\r\n\r\n","created_at":"2018-07-06T08:39:51Z","updated_at":"2018-10-25T09:09:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"71fa26dba447853a2f700b9eec98b3de906c9f0a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/pulls/1/commits","review_comments_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/pulls/1/comments","review_comment_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/pulls/comments{/number}","comments_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/issues/1/comments","statuses_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/statuses/1f823f2250dbf59131f686218bd004377eac6e00","head":{"label":"KromDaniel:master","ref":"master","sha":"1f823f2250dbf59131f686218bd004377eac6e00","user":{"login":"KromDaniel","id":17231281,"node_id":"MDQ6VXNlcjE3MjMxMjgx","avatar_url":"https://avatars2.githubusercontent.com/u/17231281?v=4","gravatar_id":"","url":"https://api.github.com/users/KromDaniel","html_url":"https://github.com/KromDaniel","followers_url":"https://api.github.com/users/KromDaniel/followers","following_url":"https://api.github.com/users/KromDaniel/following{/other_user}","gists_url":"https://api.github.com/users/KromDaniel/gists{/gist_id}","starred_url":"https://api.github.com/users/KromDaniel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KromDaniel/subscriptions","organizations_url":"https://api.github.com/users/KromDaniel/orgs","repos_url":"https://api.github.com/users/KromDaniel/repos","events_url":"https://api.github.com/users/KromDaniel/events{/privacy}","received_events_url":"https://api.github.com/users/KromDaniel/received_events","type":"User","site_admin":false},"repo":{"id":139946317,"node_id":"MDEwOlJlcG9zaXRvcnkxMzk5NDYzMTc=","name":"node-chaos-monkey","full_name":"KromDaniel/node-chaos-monkey","private":false,"owner":{"login":"KromDaniel","id":17231281,"node_id":"MDQ6VXNlcjE3MjMxMjgx","avatar_url":"https://avatars2.githubusercontent.com/u/17231281?v=4","gravatar_id":"","url":"https://api.github.com/users/KromDaniel","html_url":"https://github.com/KromDaniel","followers_url":"https://api.github.com/users/KromDaniel/followers","following_url":"https://api.github.com/users/KromDaniel/following{/other_user}","gists_url":"https://api.github.com/users/KromDaniel/gists{/gist_id}","starred_url":"https://api.github.com/users/KromDaniel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KromDaniel/subscriptions","organizations_url":"https://api.github.com/users/KromDaniel/orgs","repos_url":"https://api.github.com/users/KromDaniel/repos","events_url":"https://api.github.com/users/KromDaniel/events{/privacy}","received_events_url":"https://api.github.com/users/KromDaniel/received_events","type":"User","site_admin":false},"html_url":"https://github.com/KromDaniel/node-chaos-monkey","description":"Extremly naughty chaos monkey for Node.js","fork":true,"url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey","forks_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/forks","keys_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/teams","hooks_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/hooks","issue_events_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/issues/events{/number}","events_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/events","assignees_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/assignees{/user}","branches_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/branches{/branch}","tags_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/tags","blobs_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/git/refs{/sha}","trees_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/statuses/{sha}","languages_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/languages","stargazers_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/stargazers","contributors_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/contributors","subscribers_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/subscribers","subscription_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/subscription","commits_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/commits{/sha}","git_commits_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/git/commits{/sha}","comments_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/comments{/number}","issue_comment_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/issues/comments{/number}","contents_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/contents/{+path}","compare_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/merges","archive_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/downloads","issues_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/issues{/number}","pulls_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/pulls{/number}","milestones_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/milestones{/number}","notifications_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/labels{/name}","releases_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/releases{/id}","deployments_url":"https://api.github.com/repos/KromDaniel/node-chaos-monkey/deployments","created_at":"2018-07-06T07:03:21Z","updated_at":"2018-07-06T08:19:43Z","pushed_at":"2018-07-06T08:19:40Z","git_url":"git://github.com/KromDaniel/node-chaos-monkey.git","ssh_url":"git@github.com:KromDaniel/node-chaos-monkey.git","clone_url":"https://github.com/KromDaniel/node-chaos-monkey.git","svn_url":"https://github.com/KromDaniel/node-chaos-monkey","homepage":null,"size":270,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"master"}},"base":{"label":"i0natan:master","ref":"master","sha":"0d5c91d5321e06e43812a3251b2c9932fba64e03","user":{"login":"i0natan","id":8571500,"node_id":"MDQ6VXNlcjg1NzE1MDA=","avatar_url":"https://avatars2.githubusercontent.com/u/8571500?v=4","gravatar_id":"","url":"https://api.github.com/users/i0natan","html_url":"https://github.com/i0natan","followers_url":"https://api.github.com/users/i0natan/followers","following_url":"https://api.github.com/users/i0natan/following{/other_user}","gists_url":"https://api.github.com/users/i0natan/gists{/gist_id}","starred_url":"https://api.github.com/users/i0natan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/i0natan/subscriptions","organizations_url":"https://api.github.com/users/i0natan/orgs","repos_url":"https://api.github.com/users/i0natan/repos","events_url":"https://api.github.com/users/i0natan/events{/privacy}","received_events_url":"https://api.github.com/users/i0natan/received_events","type":"User","site_admin":false},"repo":{"id":124506331,"node_id":"MDEwOlJlcG9zaXRvcnkxMjQ1MDYzMzE=","name":"node-chaos-monkey","full_name":"i0natan/node-chaos-monkey","private":false,"owner":{"login":"i0natan","id":8571500,"node_id":"MDQ6VXNlcjg1NzE1MDA=","avatar_url":"https://avatars2.githubusercontent.com/u/8571500?v=4","gravatar_id":"","url":"https://api.github.com/users/i0natan","html_url":"https://github.com/i0natan","followers_url":"https://api.github.com/users/i0natan/followers","following_url":"https://api.github.com/users/i0natan/following{/other_user}","gists_url":"https://api.github.com/users/i0natan/gists{/gist_id}","starred_url":"https://api.github.com/users/i0natan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/i0natan/subscriptions","organizations_url":"https://api.github.com/users/i0natan/orgs","repos_url":"https://api.github.com/users/i0natan/repos","events_url":"https://api.github.com/users/i0natan/events{/privacy}","received_events_url":"https://api.github.com/users/i0natan/received_events","type":"User","site_admin":false},"html_url":"https://github.com/i0natan/node-chaos-monkey","description":"Extremly naughty chaos monkey for Node.js","fork":false,"url":"https://api.github.com/repos/i0natan/node-chaos-monkey","forks_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/forks","keys_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/keys{/key_id}","collaborators_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/teams","hooks_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/hooks","issue_events_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/issues/events{/number}","events_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/events","assignees_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/assignees{/user}","branches_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/branches{/branch}","tags_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/tags","blobs_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/git/refs{/sha}","trees_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/git/trees{/sha}","statuses_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/statuses/{sha}","languages_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/languages","stargazers_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/stargazers","contributors_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/contributors","subscribers_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/subscribers","subscription_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/subscription","commits_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/commits{/sha}","git_commits_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/git/commits{/sha}","comments_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/comments{/number}","issue_comment_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/issues/comments{/number}","contents_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/contents/{+path}","compare_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/compare/{base}...{head}","merges_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/merges","archive_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/downloads","issues_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/issues{/number}","pulls_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/pulls{/number}","milestones_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/milestones{/number}","notifications_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/labels{/name}","releases_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/releases{/id}","deployments_url":"https://api.github.com/repos/i0natan/node-chaos-monkey/deployments","created_at":"2018-03-09T07:46:13Z","updated_at":"2018-10-25T08:18:19Z","pushed_at":"2018-10-25T08:18:18Z","git_url":"git://github.com/i0natan/node-chaos-monkey.git","ssh_url":"git@github.com:i0natan/node-chaos-monkey.git","clone_url":"https://github.com/i0natan/node-chaos-monkey.git","svn_url":"https://github.com/i0natan/node-chaos-monkey","homepage":null,"size":1343,"stargazers_count":6,"watchers_count":6,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":5,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/i0natan/node-chaos-monkey/pulls/1"},"html":{"href":"https://github.com/i0natan/node-chaos-monkey/pull/1"},"issue":{"href":"https://api.github.com/repos/i0natan/node-chaos-monkey/issues/1"},"comments":{"href":"https://api.github.com/repos/i0natan/node-chaos-monkey/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/i0natan/node-chaos-monkey/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/i0natan/node-chaos-monkey/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/i0natan/node-chaos-monkey/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/i0natan/node-chaos-monkey/statuses/1f823f2250dbf59131f686218bd004377eac6e00"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"benjamingr"}}