pprof/pprof.go
func Register(registrar tchannel.Registrar) {
	handler := func(ctx context.Context, call *tchannel.InboundCall) {
		req, err := thttp.ReadRequest(call)
		if err != nil {
			registrar.Logger().WithFields(
				tchannel.LogField{Key: "err", Value: err.Error()},
			).Warn("Failed to read HTTP request.")
			return
		}

		serveHTTP(req, call.Response())
	}
	registrar.Register(tchannel.HandlerFunc(handler), "_pprof")
}
func Register(registrar tchannel.Registrar) {
	handler := func(ctx context.Context, call *tchannel.InboundCall) {
		req, err := thttp.ReadRequest(call)
		if err != nil {
			registrar.Logger().WithFields(
				tchannel.LogField{Key: "err", Value: err.Error()},
			).Warn("Failed to read HTTP request.")
			return
		}

		serveHTTP(req, call.Response())
	}
	registrar.Register(tchannel.HandlerFunc(handler), "_pprof")
}
// Register registers pprof endpoints on the given registrar under _pprof.
// The _pprof endpoint uses as-http and is a tunnel to the default serve mux.