add tracing for streaming rpc

This commit is contained in:
yangzhouhan
2015-06-17 19:30:57 -07:00
parent 4782e693c2
commit 58dcee7526
3 changed files with 43 additions and 13 deletions

View File

@ -44,6 +44,10 @@ import (
"golang.org/x/net/trace"
)
// EnableTracing controls whether to trace RPCs using the golang.org/x/net/trace package.
// This should only be set before any RPCs are sent or received by this program.
var EnableTracing = true
// methodFamily returns the trace family for the given method.
// It turns "/pkg.Service/GetFoo" into "pkg.Service".
func methodFamily(m string) string {