{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/comments/186499628","pull_request_review_id":118089705,"id":186499628,"diff_hunk":"@@ -248,6 +248,17 @@ export function serializeTimeProfile(\n export function serializeHeapProfile(\n     prof: AllocationProfileNode, startTimeNanos: number,\n     intervalBytes: number): perftools.profiles.IProfile {\n+  // add node for external memory usage.\n+  // tslint:disable-next-line: no-any","path":"ts/src/profilers/profile-serializer.ts","position":5,"original_position":5,"commit_id":"a1f5248e695c0badbfdfbc6649b7f5cc183956fb","original_commit_id":"a1f5248e695c0badbfdfbc6649b7f5cc183956fb","user":{"login":"nolanmar511","id":14046562,"avatar_url":"https://avatars0.githubusercontent.com/u/14046562?v=4","gravatar_id":"","url":"https://api.github.com/users/nolanmar511","html_url":"https://github.com/nolanmar511","followers_url":"https://api.github.com/users/nolanmar511/followers","following_url":"https://api.github.com/users/nolanmar511/following{/other_user}","gists_url":"https://api.github.com/users/nolanmar511/gists{/gist_id}","starred_url":"https://api.github.com/users/nolanmar511/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolanmar511/subscriptions","organizations_url":"https://api.github.com/users/nolanmar511/orgs","repos_url":"https://api.github.com/users/nolanmar511/repos","events_url":"https://api.github.com/users/nolanmar511/events{/privacy}","received_events_url":"https://api.github.com/users/nolanmar511/received_events","type":"User","site_admin":false},"body":"Made https://github.com/DefinitelyTyped/DefinitelyTyped/pull/25580 to add `external` to `MemoryUsage`. ","created_at":"2018-05-07T17:59:53Z","updated_at":"2018-05-07T17:59:53Z","html_url":"https://github.com/GoogleCloudPlatform/cloud-profiler-nodejs/pull/192#discussion_r186499628","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/192","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/comments/186499628"},"html":{"href":"https://github.com/GoogleCloudPlatform/cloud-profiler-nodejs/pull/192#discussion_r186499628"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/192"}},"in_reply_to_id":186480227},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/192","id":186132687,"html_url":"https://github.com/GoogleCloudPlatform/cloud-profiler-nodejs/pull/192","diff_url":"https://github.com/GoogleCloudPlatform/cloud-profiler-nodejs/pull/192.diff","patch_url":"https://github.com/GoogleCloudPlatform/cloud-profiler-nodejs/pull/192.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/issues/192","number":192,"state":"open","locked":false,"title":"fix: add node in profile to track external memory","user":{"login":"nolanmar511","id":14046562,"avatar_url":"https://avatars0.githubusercontent.com/u/14046562?v=4","gravatar_id":"","url":"https://api.github.com/users/nolanmar511","html_url":"https://github.com/nolanmar511","followers_url":"https://api.github.com/users/nolanmar511/followers","following_url":"https://api.github.com/users/nolanmar511/following{/other_user}","gists_url":"https://api.github.com/users/nolanmar511/gists{/gist_id}","starred_url":"https://api.github.com/users/nolanmar511/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolanmar511/subscriptions","organizations_url":"https://api.github.com/users/nolanmar511/orgs","repos_url":"https://api.github.com/users/nolanmar511/repos","events_url":"https://api.github.com/users/nolanmar511/events{/privacy}","received_events_url":"https://api.github.com/users/nolanmar511/received_events","type":"User","site_admin":false},"body":"Fixes #157 \r\nFixes #120 \r\n\r\nTesting:\r\n\r\nRan this script:\r\n```js\r\nconst profiler = require('./out/src/index.js')\r\nprofiler.start({\r\n\tprojectId: 'nolanmar-test',\r\n\tlogLevel: 5,\r\n\tserviceContext: {\r\n\t\tservice: 'test-external',\r\n\t\tversion: '3'\r\n  },\r\n  // baseApiUrl: 'https://test-cloudprofiler.sandbox.googleapis.com/v2',\r\n});\r\n\r\nconst startTime = Date.now();\r\nconst testArr = [];\r\nconst testBuf = [];\r\n\r\n/**\r\n * Fills several arrays, then calls itself with setImmediate.\r\n * It continues to do this until durationSeconds after the startTime.\r\n */\r\nfunction busyLoop(durationSeconds) {\r\n  for (let i = 0; i < testBuf.length; i++) {\r\n    for (let j = 0; j < testBuf[i].length; j++) {\r\n      testBuf[i][j] = Math.sqrt(j * testBuf[i][j]);\r\n    }\r\n  }\r\n  if (Date.now() - startTime < 1000 * durationSeconds) {\r\n    setTimeout(() => busyLoop(durationSeconds), 5);\r\n  }\r\n}\r\n\r\nfunction benchmark(durationSeconds) {\r\n  // Allocate 16 MiB in 64 KiB chunks.\r\n  for (let i = 0; i < 16*16; i++) {\r\n    testBuf[i] = new Buffer(64 * 1024);\r\n  }\r\n\r\n  busyLoop(durationSeconds)\r\n}\r\n\r\nconst durationSeconds = process.argv.length > 2 ? process.argv[2] : 600; \r\nsetTimeout(()=>benchmark(durationSeconds), 1000);\r\n```\r\n\r\nThis profile, with 16MiB in external, was uploaded:\r\n![image](https://user-images.githubusercontent.com/14046562/39658379-5dfffc4e-4fc8-11e8-8f6b-5775f80e4eaf.png)\r\n\r\n*EDIT:ofrobots: add syntax highlighting*","created_at":"2018-05-05T01:25:35Z","updated_at":"2018-05-07T17:59:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"91ddbd677aaad3abfe8cdc37f9ff15cca0185e63","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":318684021,"url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/labels/cla:%20yes","name":"cla: yes","color":"bfd4f2","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/192/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/192/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/issues/192/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/statuses/a1f5248e695c0badbfdfbc6649b7f5cc183956fb","head":{"label":"nolanmar511:external-node","ref":"external-node","sha":"a1f5248e695c0badbfdfbc6649b7f5cc183956fb","user":{"login":"nolanmar511","id":14046562,"avatar_url":"https://avatars0.githubusercontent.com/u/14046562?v=4","gravatar_id":"","url":"https://api.github.com/users/nolanmar511","html_url":"https://github.com/nolanmar511","followers_url":"https://api.github.com/users/nolanmar511/followers","following_url":"https://api.github.com/users/nolanmar511/following{/other_user}","gists_url":"https://api.github.com/users/nolanmar511/gists{/gist_id}","starred_url":"https://api.github.com/users/nolanmar511/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolanmar511/subscriptions","organizations_url":"https://api.github.com/users/nolanmar511/orgs","repos_url":"https://api.github.com/users/nolanmar511/repos","events_url":"https://api.github.com/users/nolanmar511/events{/privacy}","received_events_url":"https://api.github.com/users/nolanmar511/received_events","type":"User","site_admin":false},"repo":{"id":100729494,"name":"cloud-profiler-nodejs","full_name":"nolanmar511/cloud-profiler-nodejs","owner":{"login":"nolanmar511","id":14046562,"avatar_url":"https://avatars0.githubusercontent.com/u/14046562?v=4","gravatar_id":"","url":"https://api.github.com/users/nolanmar511","html_url":"https://github.com/nolanmar511","followers_url":"https://api.github.com/users/nolanmar511/followers","following_url":"https://api.github.com/users/nolanmar511/following{/other_user}","gists_url":"https://api.github.com/users/nolanmar511/gists{/gist_id}","starred_url":"https://api.github.com/users/nolanmar511/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolanmar511/subscriptions","organizations_url":"https://api.github.com/users/nolanmar511/orgs","repos_url":"https://api.github.com/users/nolanmar511/repos","events_url":"https://api.github.com/users/nolanmar511/events{/privacy}","received_events_url":"https://api.github.com/users/nolanmar511/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nolanmar511/cloud-profiler-nodejs","description":null,"fork":true,"url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs","forks_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/forks","keys_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/teams","hooks_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/hooks","issue_events_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/issues/events{/number}","events_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/events","assignees_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/assignees{/user}","branches_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/branches{/branch}","tags_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/tags","blobs_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/git/refs{/sha}","trees_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/statuses/{sha}","languages_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/languages","stargazers_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/stargazers","contributors_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/contributors","subscribers_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/subscribers","subscription_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/subscription","commits_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/commits{/sha}","git_commits_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/git/commits{/sha}","comments_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/comments{/number}","issue_comment_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/issues/comments{/number}","contents_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/contents/{+path}","compare_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/merges","archive_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/downloads","issues_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/issues{/number}","pulls_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/pulls{/number}","milestones_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/milestones{/number}","notifications_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/labels{/name}","releases_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/releases{/id}","deployments_url":"https://api.github.com/repos/nolanmar511/cloud-profiler-nodejs/deployments","created_at":"2017-08-18T16:11:07Z","updated_at":"2017-11-13T20:07:22Z","pushed_at":"2018-05-07T16:38:42Z","git_url":"git://github.com/nolanmar511/cloud-profiler-nodejs.git","ssh_url":"git@github.com:nolanmar511/cloud-profiler-nodejs.git","clone_url":"https://github.com/nolanmar511/cloud-profiler-nodejs.git","svn_url":"https://github.com/nolanmar511/cloud-profiler-nodejs","homepage":null,"size":2248,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"33cd53193408353446f3440272ecd858a114f936","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars0.githubusercontent.com/u/2810941?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":50680973,"name":"cloud-profiler-nodejs","full_name":"GoogleCloudPlatform/cloud-profiler-nodejs","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars0.githubusercontent.com/u/2810941?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/cloud-profiler-nodejs","description":null,"fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/deployments","created_at":"2016-01-29T18:06:50Z","updated_at":"2018-05-06T22:44:00Z","pushed_at":"2018-05-07T16:38:43Z","git_url":"git://github.com/GoogleCloudPlatform/cloud-profiler-nodejs.git","ssh_url":"git@github.com:GoogleCloudPlatform/cloud-profiler-nodejs.git","clone_url":"https://github.com/GoogleCloudPlatform/cloud-profiler-nodejs.git","svn_url":"https://github.com/GoogleCloudPlatform/cloud-profiler-nodejs","homepage":null,"size":2133,"stargazers_count":15,"watchers_count":15,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":18,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":12,"open_issues":18,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/192"},"html":{"href":"https://github.com/GoogleCloudPlatform/cloud-profiler-nodejs/pull/192"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/issues/192"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/issues/192/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/192/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/192/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/statuses/a1f5248e695c0badbfdfbc6649b7f5cc183956fb"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"nolanmar511"}}