grpcstats

package
v15.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldsProducer

func FieldsProducer(ctx context.Context) logrus.Fields

FieldsProducer extracts stats info from the context and returns it as a logging fields.

Types

type PayloadBytes

type PayloadBytes struct{}

PayloadBytes implements stats.Handler and tracks amount of bytes received and send by gRPC service for each method call. The information about statistics is added into the context and can be extracted with payloadBytesStatsFromContext.

func (*PayloadBytes) HandleConn

func (s *PayloadBytes) HandleConn(context.Context, stats.ConnStats)

HandleConn exists to satisfy gRPC stats.Handler.

func (*PayloadBytes) HandleRPC

func (s *PayloadBytes) HandleRPC(ctx context.Context, rs stats.RPCStats)

HandleRPC implements per-RPC tracing and stats instrumentation.

func (*PayloadBytes) TagConn

TagConn exists to satisfy gRPC stats.Handler. We don't gather connection level stats and are thus not currently using it.

func (*PayloadBytes) TagRPC

TagRPC initializes context with an RPC specific stats collector. The returned context will be used in method invocation as is passed into HandleRPC.

type PayloadBytesStats

type PayloadBytesStats struct {
	// InPayloadBytes amount of bytes received.
	InPayloadBytes int64
	// OutPayloadBytes amount of bytes sent.
	OutPayloadBytes int64
}

PayloadBytesStats contains info about bytes received and sent by the gRPC method.

func (*PayloadBytesStats) Fields

func (s *PayloadBytesStats) Fields() logrus.Fields

Fields returns logging info.

Jump to

Keyboard shortcuts

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