statshandler

package
v0.0.0-...-3eb0145 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Overview

Package statshandler is an example pkg to illustrate the use of the stats handler.

Index

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

func (st *Handler) HandleConn(ctx context.Context, stat stats.ConnStats)

HandleConn processes the Conn stats.

func (*Handler) HandleRPC

func (st *Handler) HandleRPC(ctx context.Context, stat stats.RPCStats)

HandleRPC processes the RPC stats. Note: All stat fields are read-only.

func (*Handler) TagConn

func (st *Handler) TagConn(ctx context.Context, stat *stats.ConnTagInfo) context.Context

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.

func (*Handler) TagRPC

func (st *Handler) TagRPC(ctx context.Context, stat *stats.RPCTagInfo) context.Context

TagRPC can attach some information to the given context. The context used for the rest lifetime of the RPC will be derived from the returned context.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL