{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/comments/176879398","pull_request_review_id":106664800,"id":176879398,"diff_hunk":"@@ -0,0 +1,164 @@\n+/**\n+ * Copyright 2018 Google Inc. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+#ifndef SERIALIZE\n+#define SERIALIZE\n+\n+#include <memory>\n+#include <map>\n+#include \"v8-profiler.h\"\n+\n+std::vector<char> serializeHeapProfile(std::unique_ptr<v8::AllocationProfile>\n+  profile, int64_t intervalBytes, int64_t startTimeNanos);\n+\n+std::vector<char> serializeTimeProfile(std::unique_ptr<v8::CpuProfile>,\n+  int64_t samplingIntervalMicros, int64_t startTimeNanos);\n+\n+class ProtoMessage {","path":"bindings/serialize.h","position":30,"original_position":30,"commit_id":"6526ce6c03f4af8f0bf7d5648a3b8379914452c4","original_commit_id":"6526ce6c03f4af8f0bf7d5648a3b8379914452c4","user":{"login":"aalexand","id":1519040,"avatar_url":"https://avatars1.githubusercontent.com/u/1519040?v=4","gravatar_id":"","url":"https://api.github.com/users/aalexand","html_url":"https://github.com/aalexand","followers_url":"https://api.github.com/users/aalexand/followers","following_url":"https://api.github.com/users/aalexand/following{/other_user}","gists_url":"https://api.github.com/users/aalexand/gists{/gist_id}","starred_url":"https://api.github.com/users/aalexand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalexand/subscriptions","organizations_url":"https://api.github.com/users/aalexand/orgs","repos_url":"https://api.github.com/users/aalexand/repos","events_url":"https://api.github.com/users/aalexand/events{/privacy}","received_events_url":"https://api.github.com/users/aalexand/received_events","type":"User","site_admin":false},"body":"I don't think it's a proto message type since you use it for primitive types. Proto message is an aggregate type which contains other messages and fields. This is more like ProtoField. Take a look at the existing C++ proto implementation to align on terminology.","created_at":"2018-03-23T22:32:27Z","updated_at":"2018-03-23T22:38:36Z","html_url":"https://github.com/GoogleCloudPlatform/cloud-profiler-nodejs/pull/164#discussion_r176879398","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/164","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/comments/176879398"},"html":{"href":"https://github.com/GoogleCloudPlatform/cloud-profiler-nodejs/pull/164#discussion_r176879398"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/164"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/164","id":176282647,"html_url":"https://github.com/GoogleCloudPlatform/cloud-profiler-nodejs/pull/164","diff_url":"https://github.com/GoogleCloudPlatform/cloud-profiler-nodejs/pull/164.diff","patch_url":"https://github.com/GoogleCloudPlatform/cloud-profiler-nodejs/pull/164.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/issues/164","number":164,"state":"open","locked":false,"title":"chore: serialize profile in C++ code","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":"DO NOT MERGE \r\n\r\nThis change serialized profiles on the c++ side, rather than in the js code. Profiles produces are valid, and can be uploaded to the API.\r\n\r\nThere may be a memory leak with the CPU profiler enabled. Memory consumption seems to be larger with this change then with existing profiler, and seems to increase slowly over time -- I'll update this with data.\r\n","created_at":"2018-03-20T18:26:31Z","updated_at":"2018-03-23T22:38:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"de25f03fb6a332168acefad5c4bdbb2c882bb620","assignee":null,"assignees":[],"requested_reviewers":[{"login":"ofrobots","id":79017,"avatar_url":"https://avatars1.githubusercontent.com/u/79017?v=4","gravatar_id":"","url":"https://api.github.com/users/ofrobots","html_url":"https://github.com/ofrobots","followers_url":"https://api.github.com/users/ofrobots/followers","following_url":"https://api.github.com/users/ofrobots/following{/other_user}","gists_url":"https://api.github.com/users/ofrobots/gists{/gist_id}","starred_url":"https://api.github.com/users/ofrobots/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ofrobots/subscriptions","organizations_url":"https://api.github.com/users/ofrobots/orgs","repos_url":"https://api.github.com/users/ofrobots/repos","events_url":"https://api.github.com/users/ofrobots/events{/privacy}","received_events_url":"https://api.github.com/users/ofrobots/received_events","type":"User","site_admin":false}],"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/164/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/164/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/164/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/statuses/6526ce6c03f4af8f0bf7d5648a3b8379914452c4","head":{"label":"nolanmar511:serialize","ref":"serialize","sha":"6526ce6c03f4af8f0bf7d5648a3b8379914452c4","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-03-23T16:55:28Z","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":1041,"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":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"1946aefd9f605d1488cbf0aebfe0321e60877c04","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-03-22T20:19:13Z","pushed_at":"2018-03-23T16:55:28Z","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":997,"stargazers_count":12,"watchers_count":12,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":9,"open_issues":17,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/164"},"html":{"href":"https://github.com/GoogleCloudPlatform/cloud-profiler-nodejs/pull/164"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/issues/164"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/issues/164/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/pulls/164/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/164/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/cloud-profiler-nodejs/statuses/6526ce6c03f4af8f0bf7d5648a3b8379914452c4"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"aalexand"}}