grpc

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapCode2Status

func MapCode2Status(code codes.Code) uint16

func SetRpcStat

func SetRpcStat(ctx context.Context, s *RpcStat) context.Context

SetRpcStat sets intstance of RpcStat to context.

Types

type HitGrpcFunc

type HitGrpcFunc func(context.Context) error

type RpcStat

type RpcStat struct {
	SentCount uint64
	SentBytes uint64
	RecvCount uint64
	RecvBytes uint64
}

func GetRpcStat

func GetRpcStat(ctx context.Context) *RpcStat

GetRpcStat returns intstance of RpcStat from the context. If there is no RpcStat is set, returns nil.

type RpcStatsHandler

type RpcStatsHandler struct {
}

RpcStatsHandler treats Sent/Recv Count/Bytes

func (*RpcStatsHandler) HandleConn

func (r *RpcStatsHandler) HandleConn(ctx context.Context, cs stats.ConnStats)

HandleConn exists to satisfy gRPC stats.Handler.

func (*RpcStatsHandler) HandleRPC

func (r *RpcStatsHandler) HandleRPC(ctx context.Context, rs stats.RPCStats)

HandleRPC implements per-RPC tracing and stats instrumentation.

func (*RpcStatsHandler) TagConn

TagConn exists to satisfy gRPC stats.Handler.

func (*RpcStatsHandler) TagRPC

TagRPC implements per-RPC context management.

Jump to

Keyboard shortcuts

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