func Start() {
	if rpcHandler == nil && connHandler == nil {
		grpclog.Println("rpcHandler and connHandler are both nil when starting stats. Stats is not started")
		return
	}
	atomic.StoreInt32(on, 1)
}
Start starts the stats collection and processing if there is a registered stats handle.
package stats
import (
	"net"
	"sync/atomic"
	"golang.org/x/net/context"
	"google.golang.org/grpc/grpclog"
)
type ConnTagInfo struct {
	RemoteAddr net.Addr
	LocalAddr net.Addr
}
type RPCTagInfo struct {
	FullMethodName string
}
var (
	on          = new(int32)
	rpcHandler  func(context.Context, RPCStats)
	connHandler func(context.Context, ConnStats)
	connTagger  func(context.Context, *ConnTagInfo) context.Context
	rpcTagger   func(context.Context, *RPCTagInfo) context.Context
)
func HandleRPC(ctx context.Context, s RPCStats) {
	if rpcHandler == nil {
		return
	}
	rpcHandler(ctx, s)
}
func RegisterRPCHandler(f func(context.Context, RPCStats)) {
	rpcHandler = f
}
func HandleConn(ctx context.Context, s ConnStats) {
	if connHandler == nil {
		return
	}
	connHandler(ctx, s)
}
func RegisterConnHandler(f func(context.Context, ConnStats)) {
	connHandler = f
}
func TagConn(ctx context.Context, info *ConnTagInfo) context.Context {
	if connTagger == nil {
		return ctx
	}
	return connTagger(ctx, info)
}
func RegisterConnTagger(t func(context.Context, *ConnTagInfo) context.Context) {
	connTagger = t
}
func TagRPC(ctx context.Context, info *RPCTagInfo) context.Context {
	if rpcTagger == nil {
		return ctx
	}
	return rpcTagger(ctx, info)
}
func RegisterRPCTagger(t func(context.Context, *RPCTagInfo) context.Context) {
	rpcTagger = t
}