{"action":"created","comment":{"url":"https://api.github.com/repos/grpc/grpc-go/pulls/comments/31859380","id":31859380,"diff_hunk":"@@ -166,3 +204,52 @@ func Invoke(ctx context.Context, method string, args, reply interface{}, cc *Cli\n \t\treturn Errorf(stream.StatusCode(), stream.StatusDesc())\n \t}\n }\n+\n+// traceInfo contains tracing information for an RPC.\n+type traceInfo struct {\n+\ttr        trace.Trace\n+\tfirstLine firstLine\n+}\n+\n+// firstLine is the first line of an RPC trace.\n+type firstLine struct {\n+\tclient     bool // whether this is a client (outgoing) RPC\n+\tremoteAddr net.Addr\n+\tdeadline   time.Duration // may be zero\n+}\n+\n+func (f *firstLine) String() string {\n+\tvar line bytes.Buffer\n+\tio.WriteString(&line, \"RPC: \")\n+\tif f.client {\n+\t\tio.WriteString(&line, \"to\")\n+\t} else {\n+\t\tio.WriteString(&line, \"from\")\n+\t}\n+\tfmt.Fprintf(&line, \" %v deadline:\", f.remoteAddr)\n+\tif f.deadline != 0 {\n+\t\tfmt.Fprint(&line, f.deadline)\n+\t} else {\n+\t\tio.WriteString(&line, \"none\")\n+\t}\n+\treturn line.String()\n+}\n+\n+// payload represents an RPC request or response payload.\n+type payload struct {\n+\tm interface{} // e.g. a proto.Message\n+\t// TODO(dsymonds): add stringifying info to codec, and limit how much we hold here?\n+}\n+\n+func (p payload) String() string {\n+\treturn fmt.Sprint(p.m)\n+}\n+\n+type lazySprintf struct {\n+\tformat string\n+\ta      []interface{}\n+}\n+\n+func (l *lazySprintf) String() string {\n+\treturn fmt.Sprintf(l.format, l.a...)\n+}","path":"call.go","position":139,"original_position":139,"commit_id":"1e0ab88e47ffcb94b413b4afa85ea1b6280c4b16","original_commit_id":"1e0ab88e47ffcb94b413b4afa85ea1b6280c4b16","user":{"login":"dsymonds","id":31506,"avatar_url":"https://avatars.githubusercontent.com/u/31506?v=3","gravatar_id":"","url":"https://api.github.com/users/dsymonds","html_url":"https://github.com/dsymonds","followers_url":"https://api.github.com/users/dsymonds/followers","following_url":"https://api.github.com/users/dsymonds/following{/other_user}","gists_url":"https://api.github.com/users/dsymonds/gists{/gist_id}","starred_url":"https://api.github.com/users/dsymonds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsymonds/subscriptions","organizations_url":"https://api.github.com/users/dsymonds/orgs","repos_url":"https://api.github.com/users/dsymonds/repos","events_url":"https://api.github.com/users/dsymonds/events{/privacy}","received_events_url":"https://api.github.com/users/dsymonds/received_events","type":"User","site_admin":false},"body":"Moved these bits to trace.go, but not sure what there is to unit test that isn't trivial.","created_at":"2015-06-05T23:19:11Z","updated_at":"2015-06-05T23:19:11Z","html_url":"https://github.com/grpc/grpc-go/pull/210#discussion_r31859380","pull_request_url":"https://api.github.com/repos/grpc/grpc-go/pulls/210","_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc-go/pulls/comments/31859380"},"html":{"href":"https://github.com/grpc/grpc-go/pull/210#discussion_r31859380"},"pull_request":{"href":"https://api.github.com/repos/grpc/grpc-go/pulls/210"}}},"pull_request":{"url":"https://api.github.com/repos/grpc/grpc-go/pulls/210","id":37002833,"html_url":"https://github.com/grpc/grpc-go/pull/210","diff_url":"https://github.com/grpc/grpc-go/pull/210.diff","patch_url":"https://github.com/grpc/grpc-go/pull/210.patch","issue_url":"https://api.github.com/repos/grpc/grpc-go/issues/210","number":210,"state":"open","locked":false,"title":"Add gRPC client-side integration with golang.org/x/net/trace.","user":{"login":"dsymonds","id":31506,"avatar_url":"https://avatars.githubusercontent.com/u/31506?v=3","gravatar_id":"","url":"https://api.github.com/users/dsymonds","html_url":"https://github.com/dsymonds","followers_url":"https://api.github.com/users/dsymonds/followers","following_url":"https://api.github.com/users/dsymonds/following{/other_user}","gists_url":"https://api.github.com/users/dsymonds/gists{/gist_id}","starred_url":"https://api.github.com/users/dsymonds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsymonds/subscriptions","organizations_url":"https://api.github.com/users/dsymonds/orgs","repos_url":"https://api.github.com/users/dsymonds/repos","events_url":"https://api.github.com/users/dsymonds/events{/privacy}","received_events_url":"https://api.github.com/users/dsymonds/received_events","type":"User","site_admin":false},"body":"This will make client (outgoing) traces appear on /debug/requests.\r\nThere's some information lacking, but it's enough for now.","created_at":"2015-06-05T05:51:56Z","updated_at":"2015-06-05T23:19:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1c87c250b91fbbe85b9d8f21bd74dc4545774ed1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/grpc/grpc-go/pulls/210/commits","review_comments_url":"https://api.github.com/repos/grpc/grpc-go/pulls/210/comments","review_comment_url":"https://api.github.com/repos/grpc/grpc-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/grpc/grpc-go/issues/210/comments","statuses_url":"https://api.github.com/repos/grpc/grpc-go/statuses/1e0ab88e47ffcb94b413b4afa85ea1b6280c4b16","head":{"label":"dsymonds:master","ref":"master","sha":"1e0ab88e47ffcb94b413b4afa85ea1b6280c4b16","user":{"login":"dsymonds","id":31506,"avatar_url":"https://avatars.githubusercontent.com/u/31506?v=3","gravatar_id":"","url":"https://api.github.com/users/dsymonds","html_url":"https://github.com/dsymonds","followers_url":"https://api.github.com/users/dsymonds/followers","following_url":"https://api.github.com/users/dsymonds/following{/other_user}","gists_url":"https://api.github.com/users/dsymonds/gists{/gist_id}","starred_url":"https://api.github.com/users/dsymonds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsymonds/subscriptions","organizations_url":"https://api.github.com/users/dsymonds/orgs","repos_url":"https://api.github.com/users/dsymonds/repos","events_url":"https://api.github.com/users/dsymonds/events{/privacy}","received_events_url":"https://api.github.com/users/dsymonds/received_events","type":"User","site_admin":false},"repo":{"id":33576664,"name":"grpc-go","full_name":"dsymonds/grpc-go","owner":{"login":"dsymonds","id":31506,"avatar_url":"https://avatars.githubusercontent.com/u/31506?v=3","gravatar_id":"","url":"https://api.github.com/users/dsymonds","html_url":"https://github.com/dsymonds","followers_url":"https://api.github.com/users/dsymonds/followers","following_url":"https://api.github.com/users/dsymonds/following{/other_user}","gists_url":"https://api.github.com/users/dsymonds/gists{/gist_id}","starred_url":"https://api.github.com/users/dsymonds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsymonds/subscriptions","organizations_url":"https://api.github.com/users/dsymonds/orgs","repos_url":"https://api.github.com/users/dsymonds/repos","events_url":"https://api.github.com/users/dsymonds/events{/privacy}","received_events_url":"https://api.github.com/users/dsymonds/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dsymonds/grpc-go","description":"The Go language implementation of gRPC. HTTP/2 based RPC","fork":true,"url":"https://api.github.com/repos/dsymonds/grpc-go","forks_url":"https://api.github.com/repos/dsymonds/grpc-go/forks","keys_url":"https://api.github.com/repos/dsymonds/grpc-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dsymonds/grpc-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dsymonds/grpc-go/teams","hooks_url":"https://api.github.com/repos/dsymonds/grpc-go/hooks","issue_events_url":"https://api.github.com/repos/dsymonds/grpc-go/issues/events{/number}","events_url":"https://api.github.com/repos/dsymonds/grpc-go/events","assignees_url":"https://api.github.com/repos/dsymonds/grpc-go/assignees{/user}","branches_url":"https://api.github.com/repos/dsymonds/grpc-go/branches{/branch}","tags_url":"https://api.github.com/repos/dsymonds/grpc-go/tags","blobs_url":"https://api.github.com/repos/dsymonds/grpc-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dsymonds/grpc-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dsymonds/grpc-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/dsymonds/grpc-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dsymonds/grpc-go/statuses/{sha}","languages_url":"https://api.github.com/repos/dsymonds/grpc-go/languages","stargazers_url":"https://api.github.com/repos/dsymonds/grpc-go/stargazers","contributors_url":"https://api.github.com/repos/dsymonds/grpc-go/contributors","subscribers_url":"https://api.github.com/repos/dsymonds/grpc-go/subscribers","subscription_url":"https://api.github.com/repos/dsymonds/grpc-go/subscription","commits_url":"https://api.github.com/repos/dsymonds/grpc-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/dsymonds/grpc-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/dsymonds/grpc-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/dsymonds/grpc-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/dsymonds/grpc-go/contents/{+path}","compare_url":"https://api.github.com/repos/dsymonds/grpc-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dsymonds/grpc-go/merges","archive_url":"https://api.github.com/repos/dsymonds/grpc-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dsymonds/grpc-go/downloads","issues_url":"https://api.github.com/repos/dsymonds/grpc-go/issues{/number}","pulls_url":"https://api.github.com/repos/dsymonds/grpc-go/pulls{/number}","milestones_url":"https://api.github.com/repos/dsymonds/grpc-go/milestones{/number}","notifications_url":"https://api.github.com/repos/dsymonds/grpc-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dsymonds/grpc-go/labels{/name}","releases_url":"https://api.github.com/repos/dsymonds/grpc-go/releases{/id}","created_at":"2015-04-08T01:02:23Z","updated_at":"2015-04-28T00:34:16Z","pushed_at":"2015-06-05T05:51:33Z","git_url":"git://github.com/dsymonds/grpc-go.git","ssh_url":"git@github.com:dsymonds/grpc-go.git","clone_url":"https://github.com/dsymonds/grpc-go.git","svn_url":"https://github.com/dsymonds/grpc-go","homepage":"","size":796,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"grpc:master","ref":"master","sha":"7168ca6c61131f5286e9637a5d2c2082ddce543f","user":{"login":"grpc","id":7802525,"avatar_url":"https://avatars.githubusercontent.com/u/7802525?v=3","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"repo":{"id":27729907,"name":"grpc-go","full_name":"grpc/grpc-go","owner":{"login":"grpc","id":7802525,"avatar_url":"https://avatars.githubusercontent.com/u/7802525?v=3","gravatar_id":"","url":"https://api.github.com/users/grpc","html_url":"https://github.com/grpc","followers_url":"https://api.github.com/users/grpc/followers","following_url":"https://api.github.com/users/grpc/following{/other_user}","gists_url":"https://api.github.com/users/grpc/gists{/gist_id}","starred_url":"https://api.github.com/users/grpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grpc/subscriptions","organizations_url":"https://api.github.com/users/grpc/orgs","repos_url":"https://api.github.com/users/grpc/repos","events_url":"https://api.github.com/users/grpc/events{/privacy}","received_events_url":"https://api.github.com/users/grpc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/grpc/grpc-go","description":"The Go language implementation of gRPC. HTTP/2 based RPC","fork":false,"url":"https://api.github.com/repos/grpc/grpc-go","forks_url":"https://api.github.com/repos/grpc/grpc-go/forks","keys_url":"https://api.github.com/repos/grpc/grpc-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grpc/grpc-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grpc/grpc-go/teams","hooks_url":"https://api.github.com/repos/grpc/grpc-go/hooks","issue_events_url":"https://api.github.com/repos/grpc/grpc-go/issues/events{/number}","events_url":"https://api.github.com/repos/grpc/grpc-go/events","assignees_url":"https://api.github.com/repos/grpc/grpc-go/assignees{/user}","branches_url":"https://api.github.com/repos/grpc/grpc-go/branches{/branch}","tags_url":"https://api.github.com/repos/grpc/grpc-go/tags","blobs_url":"https://api.github.com/repos/grpc/grpc-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grpc/grpc-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grpc/grpc-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/grpc/grpc-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grpc/grpc-go/statuses/{sha}","languages_url":"https://api.github.com/repos/grpc/grpc-go/languages","stargazers_url":"https://api.github.com/repos/grpc/grpc-go/stargazers","contributors_url":"https://api.github.com/repos/grpc/grpc-go/contributors","subscribers_url":"https://api.github.com/repos/grpc/grpc-go/subscribers","subscription_url":"https://api.github.com/repos/grpc/grpc-go/subscription","commits_url":"https://api.github.com/repos/grpc/grpc-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/grpc/grpc-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/grpc/grpc-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/grpc/grpc-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/grpc/grpc-go/contents/{+path}","compare_url":"https://api.github.com/repos/grpc/grpc-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grpc/grpc-go/merges","archive_url":"https://api.github.com/repos/grpc/grpc-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grpc/grpc-go/downloads","issues_url":"https://api.github.com/repos/grpc/grpc-go/issues{/number}","pulls_url":"https://api.github.com/repos/grpc/grpc-go/pulls{/number}","milestones_url":"https://api.github.com/repos/grpc/grpc-go/milestones{/number}","notifications_url":"https://api.github.com/repos/grpc/grpc-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grpc/grpc-go/labels{/name}","releases_url":"https://api.github.com/repos/grpc/grpc-go/releases{/id}","created_at":"2014-12-08T18:59:34Z","updated_at":"2015-06-05T07:40:25Z","pushed_at":"2015-06-05T22:26:00Z","git_url":"git://github.com/grpc/grpc-go.git","ssh_url":"git@github.com:grpc/grpc-go.git","clone_url":"https://github.com/grpc/grpc-go.git","svn_url":"https://github.com/grpc/grpc-go","homepage":"","size":3100,"stargazers_count":917,"watchers_count":917,"language":"Go","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":82,"mirror_url":null,"open_issues_count":16,"forks":82,"open_issues":16,"watchers":917,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/grpc/grpc-go/pulls/210"},"html":{"href":"https://github.com/grpc/grpc-go/pull/210"},"issue":{"href":"https://api.github.com/repos/grpc/grpc-go/issues/210"},"comments":{"href":"https://api.github.com/repos/grpc/grpc-go/issues/210/comments"},"review_comments":{"href":"https://api.github.com/repos/grpc/grpc-go/pulls/210/comments"},"review_comment":{"href":"https://api.github.com/repos/grpc/grpc-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/grpc/grpc-go/pulls/210/commits"},"statuses":{"href":"https://api.github.com/repos/grpc/grpc-go/statuses/1e0ab88e47ffcb94b413b4afa85ea1b6280c4b16"}}}}