receiver

package
v1.0.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConnBufSize = 16 * 1024 * 1024
)

Variables

This section is empty.

Functions

func ControlReusePort

func ControlReusePort(network string, address string, conn syscall.RawConn) error

Types

type CallbackHandler

type CallbackHandler struct {
	Metrics    func(*tlstatshouse.MetricBytes, mapping.MapCallbackFunc) (h data_model.MappedMetricHeader, done bool)
	ParseError func([]byte, error)
}

func (CallbackHandler) HandleMetrics

func (CallbackHandler) HandleParseError

func (c CallbackHandler) HandleParseError(pkt []byte, err error)

type Handler

type Handler interface {
	HandleMetrics(*tlstatshouse.MetricBytes, mapping.MapCallbackFunc) (h data_model.MappedMetricHeader, done bool) // if cannot process immediately, and needs to own data, should swap another metric from the pool
	HandleParseError([]byte, error)
}

type RPCReceiver

type RPCReceiver struct {
	Handler Handler

	StatCallsTotalOK  atomic.Uint64
	StatCallsTotalErr atomic.Uint64
	// contains filtered or unexported fields
}

func MakeRPCReceiver

func MakeRPCReceiver(ag *agent.Agent, h Handler) *RPCReceiver

func (*RPCReceiver) RawAddMetricsBatch

func (r *RPCReceiver) RawAddMetricsBatch(ctx context.Context, hctx *rpc.HandlerContext) error

type UDP

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

func ListenUDP

func ListenUDP(address string, bufferSize int, reusePort bool, bm *agent.Agent, logPacket func(format string, args ...interface{})) (*UDP, error)

func (*UDP) Addr

func (u *UDP) Addr() string

func (*UDP) Close

func (u *UDP) Close() error

func (*UDP) Serve

func (u *UDP) Serve(h Handler) error

func (*UDP) StatBatchesTotalErr

func (u *UDP) StatBatchesTotalErr() uint64

func (*UDP) StatBatchesTotalOK

func (u *UDP) StatBatchesTotalOK() uint64

func (*UDP) StatBytesTotal

func (u *UDP) StatBytesTotal() uint64

func (*UDP) StatPacketsTotal

func (u *UDP) StatPacketsTotal() uint64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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