{"action":"created","comment":{"url":"https://api.github.com/repos/uber/tchannel-node/pulls/comments/41588438","id":41588438,"diff_hunk":"@@ -372,6 +392,78 @@ function handleFrameLazily(frame) {\n             relayDirection: 'in'\n         }));\n     }\n+\n+    if (frame.type === v2.Types.CallRequest) {\n+        self._observeCallReqFrame(frame, now);\n+    } else if (frame.type === v2.Types.CallRequestCont) {\n+        self._observeCallReqContFrame(frame, now);\n+    // } else { TODO: log\n+    }\n+};\n+\n+LazyRelayInReq.prototype._observeCallReqFrame =\n+function _observeCallReqFrame(frame, now) {\n+    var self = this;\n+\n+    self.channel.emitFastStat(self.channel.buildStat(\n+        'tchannel.inbound.request.size',\n+        'counter',\n+        frame.size,\n+        new stat.InboundRequestSizeTags(\n+            self.callerName,\n+            self.serviceName,\n+            self.endpoint\n+        )\n+    ));\n+\n+    self.channel.emitFastStat(self.channel.buildStat(\n+        'tchannel.outbound.request.size',\n+        'counter',\n+        frame.size,\n+        new stat.OutboundRequestSizeTags(\n+            self.serviceName,\n+            self.callerName,\n+            self.endpoint\n+        )\n+    ));\n+\n+    self.channel.emitFastStat(self.channel.buildStat(\n+        'tchannel.outbound.calls.sent',\n+        'counter',\n+        1,\n+        new stat.OutboundCallsSentTags(\n+            self.serviceName,\n+            self.callerName,\n+            self.endpoint\n+        )\n+    ));\n+};\n+\n+LazyRelayInReq.prototype._observeCallReqContFrame =\n+function _observeCallReqContFrame(frame, now) {\n+    var self = this;\n+\n+    self.channel.emitFastStat(self.channel.buildStat(\n+        'tchannel.inbound.request.size',\n+        'counter',\n+        frame.size,\n+        new stat.InboundRequestSizeTags(\n+            self.callerName,\n+            self.serviceName,\n+            self.endpoint\n+        )\n+    ));\n+\n+    self.channel.emitFastStat(self.channel.buildStat(","path":"relay_handler.js","position":107,"original_position":107,"commit_id":"177fcf0d119c28ebac8f62f9e20821bd7cf4f405","original_commit_id":"177fcf0d119c28ebac8f62f9e20821bd7cf4f405","user":{"login":"Raynos","id":479538,"avatar_url":"https://avatars.githubusercontent.com/u/479538?v=3","gravatar_id":"","url":"https://api.github.com/users/Raynos","html_url":"https://github.com/Raynos","followers_url":"https://api.github.com/users/Raynos/followers","following_url":"https://api.github.com/users/Raynos/following{/other_user}","gists_url":"https://api.github.com/users/Raynos/gists{/gist_id}","starred_url":"https://api.github.com/users/Raynos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Raynos/subscriptions","organizations_url":"https://api.github.com/users/Raynos/orgs","repos_url":"https://api.github.com/users/Raynos/repos","events_url":"https://api.github.com/users/Raynos/events{/privacy}","received_events_url":"https://api.github.com/users/Raynos/received_events","type":"User","site_admin":false},"body":"TODO: No garantuee that we send the frame out succesfully. frame write could fail.","created_at":"2015-10-09T01:02:54Z","updated_at":"2015-10-09T01:02:54Z","html_url":"https://github.com/uber/tchannel-node/pull/58#discussion_r41588438","pull_request_url":"https://api.github.com/repos/uber/tchannel-node/pulls/58","_links":{"self":{"href":"https://api.github.com/repos/uber/tchannel-node/pulls/comments/41588438"},"html":{"href":"https://github.com/uber/tchannel-node/pull/58#discussion_r41588438"},"pull_request":{"href":"https://api.github.com/repos/uber/tchannel-node/pulls/58"}}},"pull_request":{"url":"https://api.github.com/repos/uber/tchannel-node/pulls/58","id":47223569,"html_url":"https://github.com/uber/tchannel-node/pull/58","diff_url":"https://github.com/uber/tchannel-node/pull/58.diff","patch_url":"https://github.com/uber/tchannel-node/pull/58.patch","issue_url":"https://api.github.com/repos/uber/tchannel-node/issues/58","number":58,"state":"open","locked":false,"title":"Add Lazy Relay Stats","user":{"login":"jcorbin","id":49715,"avatar_url":"https://avatars.githubusercontent.com/u/49715?v=3","gravatar_id":"","url":"https://api.github.com/users/jcorbin","html_url":"https://github.com/jcorbin","followers_url":"https://api.github.com/users/jcorbin/followers","following_url":"https://api.github.com/users/jcorbin/following{/other_user}","gists_url":"https://api.github.com/users/jcorbin/gists{/gist_id}","starred_url":"https://api.github.com/users/jcorbin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcorbin/subscriptions","organizations_url":"https://api.github.com/users/jcorbin/orgs","repos_url":"https://api.github.com/users/jcorbin/repos","events_url":"https://api.github.com/users/jcorbin/events{/privacy}","received_events_url":"https://api.github.com/users/jcorbin/received_events","type":"User","site_admin":false},"body":"r @kriskowal @Raynos ","created_at":"2015-10-09T00:42:59Z","updated_at":"2015-10-09T01:02:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"affa4eb14e7a022f376036ae41bc8e28c731a4db","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/uber/tchannel-node/pulls/58/commits","review_comments_url":"https://api.github.com/repos/uber/tchannel-node/pulls/58/comments","review_comment_url":"https://api.github.com/repos/uber/tchannel-node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber/tchannel-node/issues/58/comments","statuses_url":"https://api.github.com/repos/uber/tchannel-node/statuses/177fcf0d119c28ebac8f62f9e20821bd7cf4f405","head":{"label":"uber:lazy_relay_stats","ref":"lazy_relay_stats","sha":"177fcf0d119c28ebac8f62f9e20821bd7cf4f405","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":42619114,"name":"tchannel-node","full_name":"uber/tchannel-node","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/tchannel-node","description":"","fork":false,"url":"https://api.github.com/repos/uber/tchannel-node","forks_url":"https://api.github.com/repos/uber/tchannel-node/forks","keys_url":"https://api.github.com/repos/uber/tchannel-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/tchannel-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/tchannel-node/teams","hooks_url":"https://api.github.com/repos/uber/tchannel-node/hooks","issue_events_url":"https://api.github.com/repos/uber/tchannel-node/issues/events{/number}","events_url":"https://api.github.com/repos/uber/tchannel-node/events","assignees_url":"https://api.github.com/repos/uber/tchannel-node/assignees{/user}","branches_url":"https://api.github.com/repos/uber/tchannel-node/branches{/branch}","tags_url":"https://api.github.com/repos/uber/tchannel-node/tags","blobs_url":"https://api.github.com/repos/uber/tchannel-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/tchannel-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/tchannel-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/tchannel-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/tchannel-node/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/tchannel-node/languages","stargazers_url":"https://api.github.com/repos/uber/tchannel-node/stargazers","contributors_url":"https://api.github.com/repos/uber/tchannel-node/contributors","subscribers_url":"https://api.github.com/repos/uber/tchannel-node/subscribers","subscription_url":"https://api.github.com/repos/uber/tchannel-node/subscription","commits_url":"https://api.github.com/repos/uber/tchannel-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/tchannel-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/tchannel-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/tchannel-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/tchannel-node/contents/{+path}","compare_url":"https://api.github.com/repos/uber/tchannel-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/tchannel-node/merges","archive_url":"https://api.github.com/repos/uber/tchannel-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/tchannel-node/downloads","issues_url":"https://api.github.com/repos/uber/tchannel-node/issues{/number}","pulls_url":"https://api.github.com/repos/uber/tchannel-node/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/tchannel-node/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/tchannel-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/tchannel-node/labels{/name}","releases_url":"https://api.github.com/repos/uber/tchannel-node/releases{/id}","created_at":"2015-09-16T23:37:37Z","updated_at":"2015-10-01T15:39:09Z","pushed_at":"2015-10-09T00:43:00Z","git_url":"git://github.com/uber/tchannel-node.git","ssh_url":"git@github.com:uber/tchannel-node.git","clone_url":"https://github.com/uber/tchannel-node.git","svn_url":"https://github.com/uber/tchannel-node","homepage":null,"size":5060,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":12,"forks":0,"open_issues":12,"watchers":5,"default_branch":"master"}},"base":{"label":"uber:master","ref":"master","sha":"8ff7dc93f77f7aaacd74d2f91cac2d0f3bda3891","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":42619114,"name":"tchannel-node","full_name":"uber/tchannel-node","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/tchannel-node","description":"","fork":false,"url":"https://api.github.com/repos/uber/tchannel-node","forks_url":"https://api.github.com/repos/uber/tchannel-node/forks","keys_url":"https://api.github.com/repos/uber/tchannel-node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/tchannel-node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/tchannel-node/teams","hooks_url":"https://api.github.com/repos/uber/tchannel-node/hooks","issue_events_url":"https://api.github.com/repos/uber/tchannel-node/issues/events{/number}","events_url":"https://api.github.com/repos/uber/tchannel-node/events","assignees_url":"https://api.github.com/repos/uber/tchannel-node/assignees{/user}","branches_url":"https://api.github.com/repos/uber/tchannel-node/branches{/branch}","tags_url":"https://api.github.com/repos/uber/tchannel-node/tags","blobs_url":"https://api.github.com/repos/uber/tchannel-node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/tchannel-node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/tchannel-node/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/tchannel-node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/tchannel-node/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/tchannel-node/languages","stargazers_url":"https://api.github.com/repos/uber/tchannel-node/stargazers","contributors_url":"https://api.github.com/repos/uber/tchannel-node/contributors","subscribers_url":"https://api.github.com/repos/uber/tchannel-node/subscribers","subscription_url":"https://api.github.com/repos/uber/tchannel-node/subscription","commits_url":"https://api.github.com/repos/uber/tchannel-node/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/tchannel-node/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/tchannel-node/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/tchannel-node/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/tchannel-node/contents/{+path}","compare_url":"https://api.github.com/repos/uber/tchannel-node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/tchannel-node/merges","archive_url":"https://api.github.com/repos/uber/tchannel-node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/tchannel-node/downloads","issues_url":"https://api.github.com/repos/uber/tchannel-node/issues{/number}","pulls_url":"https://api.github.com/repos/uber/tchannel-node/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/tchannel-node/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/tchannel-node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/tchannel-node/labels{/name}","releases_url":"https://api.github.com/repos/uber/tchannel-node/releases{/id}","created_at":"2015-09-16T23:37:37Z","updated_at":"2015-10-01T15:39:09Z","pushed_at":"2015-10-09T00:43:00Z","git_url":"git://github.com/uber/tchannel-node.git","ssh_url":"git@github.com:uber/tchannel-node.git","clone_url":"https://github.com/uber/tchannel-node.git","svn_url":"https://github.com/uber/tchannel-node","homepage":null,"size":5060,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":12,"forks":0,"open_issues":12,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uber/tchannel-node/pulls/58"},"html":{"href":"https://github.com/uber/tchannel-node/pull/58"},"issue":{"href":"https://api.github.com/repos/uber/tchannel-node/issues/58"},"comments":{"href":"https://api.github.com/repos/uber/tchannel-node/issues/58/comments"},"review_comments":{"href":"https://api.github.com/repos/uber/tchannel-node/pulls/58/comments"},"review_comment":{"href":"https://api.github.com/repos/uber/tchannel-node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber/tchannel-node/pulls/58/commits"},"statuses":{"href":"https://api.github.com/repos/uber/tchannel-node/statuses/177fcf0d119c28ebac8f62f9e20821bd7cf4f405"}}}}