Documentation ¶
Overview ¶
Package statshandler is an example pkg to illustrate the use of the stats handler.
Index ¶
- type Handler
- func (st *Handler) HandleConn(ctx context.Context, stat stats.ConnStats)
- func (st *Handler) HandleRPC(ctx context.Context, stat stats.RPCStats)
- func (st *Handler) TagConn(ctx context.Context, stat *stats.ConnTagInfo) context.Context
- func (st *Handler) TagRPC(ctx context.Context, stat *stats.RPCTagInfo) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct{}
Handler implements stats.Handler(https://pkg.go.dev/google.golang.org/grpc/stats#Handler) interface.
func New ¶
func New() *Handler
New returns a new implementation of stats.Handler(https://pkg.go.dev/google.golang.org/grpc/stats#Handler) interface.
func (*Handler) HandleConn ¶
HandleConn processes the Conn stats.
func (*Handler) TagConn ¶
TagConn can attach some information to the given context. The context used in HandleConn for this connection will be derived from the context returned. In the gRPC client: The context used in HandleRPC for RPCs on this connection will be the user's context and NOT derived from the context returned here. In the gRPC server: The context used in HandleRPC for RPCs on this connection will be derived from the context returned here.