stats

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: Apache-2.0, MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Begin

type Begin struct {
	// Client is true if this Begin is from client side.
	Client bool
	// BeginTime is the time when the RPC begins.
	BeginTime time.Time
}

Begin contains stats when an RPC begins. FailFast is only valid if this Begin is from client side.

func (*Begin) IsClient

func (s *Begin) IsClient() bool

IsClient indicates if the stats information is from client side.

type End

type End struct {
	// Client is true if this End is from client side.
	Client bool
	// BeginTime is the time when the RPC began.
	BeginTime time.Time
	// EndTime is the time when the RPC ends.
	EndTime time.Time
	// Error is the error the RPC ended with. It is an error generated from
	// status.Status and can be converted back to status.Status using
	// status.FromError if non-nil.
	Error error
}

End contains stats when an RPC ends.

func (*End) IsClient

func (s *End) IsClient() bool

IsClient indicates if this is from client side.

type Handler

type Handler interface {
	// 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.
	TagRPC(context.Context, *RPCTagInfo) context.Context
	// HandleRPC processes the RPC stats.
	HandleRPC(context.Context, RPCStats)
}

Handler defines the interface for the related stats handling (e.g., RPCs, connections).

type InPayload

type InPayload struct {
	// Client is true if this InPayload is from client side.
	Client bool
	// Payload is the payload with original type.
	Payload interface{}
	// Data is the serialized message payload.
	Data []byte
	// Length is the length of uncompressed data.
	Length int
	// WireLength is the length of data on wire (compressed, signed, encrypted).
	WireLength int
	// RecvTime is the time when the payload is received.
	RecvTime time.Time
}

InPayload contains the information for an incoming payload.

func (*InPayload) IsClient

func (s *InPayload) IsClient() bool

IsClient indicates if the stats information is from client side.

type OutPayload

type OutPayload struct {
	// Client is true if this OutPayload is from client side.
	Client bool
	// Payload is the payload with original type.
	Payload interface{}
	// Data is the serialized message payload.
	Data []byte
	// Length is the length of uncompressed data.
	Length int
	// WireLength is the length of data on wire (compressed, signed, encrypted).
	WireLength int
	// SentTime is the time when the payload is sent.
	SentTime time.Time
}

OutPayload contains the information for an outgoing payload.

func (*OutPayload) IsClient

func (s *OutPayload) IsClient() bool

IsClient indicates if this stats information is from client side.

type RPCStats

type RPCStats interface {

	// IsClient returns true if this RPCStats is from client side.
	IsClient() bool
	// contains filtered or unexported methods
}

RPCStats contains stats information about RPCs.

type RPCTagInfo

type RPCTagInfo struct {
	// FullMethodName is the RPC method in the format of /package.service/method.
	FullMethodName string
}

RPCTagInfo defines the relevant information needed by RPC context tagger.

Jump to

Keyboard shortcuts

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