Documentation ¶
Index ¶
- type StatsHandler
- func (s *StatsHandler) HandleConn(context.Context, stats.ConnStats)
- func (s *StatsHandler) HandleRPC(ctx context.Context, stat stats.RPCStats)
- func (s *StatsHandler) TagConn(ctx context.Context, stat *stats.ConnTagInfo) context.Context
- func (s *StatsHandler) TagRPC(ctx context.Context, stat *stats.RPCTagInfo) context.Context
- type Tracker
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.