clientpool

package
v0.0.0-...-75496a6 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StatsHandler

type StatsHandler struct {
	// contains filtered or unexported fields
}

StatsHandler implements the stats.Handler interface. It is passed to each dialer in an agent to calculate how much data is being egressed. It knows how to calculate both v1 and v2 envelopes. It only implements HandleRPC for OutPayload messages. It should be constructed with NewStatsHandler.

func NewStatsHandler

func NewStatsHandler(tracker Tracker) *StatsHandler

NewStatsHandler constructs a new StatsHandler.

func (*StatsHandler) HandleConn

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

HandleConn implements stats.Handler. It is a NOP.

func (*StatsHandler) HandleRPC

func (s *StatsHandler) HandleRPC(ctx context.Context, stat stats.RPCStats)

HandleRPC only looks for OutPayload messages. It is a NOP for any other type. It either calculates the total bytes from v1.EnvelopeData or the average envelope size across a batch from v2.EnvelopeBatch.

func (*StatsHandler) TagConn

func (s *StatsHandler) TagConn(ctx context.Context, stat *stats.ConnTagInfo) context.Context

TagConn implements stats.Handler. It is a NOP.

func (*StatsHandler) TagRPC

func (s *StatsHandler) TagRPC(ctx context.Context, stat *stats.RPCTagInfo) context.Context

TagRPC implements stats.Handler. It is a NOP.

type Tracker

type Tracker interface {
	// Track is invoked each time HandleRPC is invoked with egress information
	// about an envelope.
	Track(count, size int)
}

Tracker is used to aggregate each envelope's size in bytes.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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