receiver

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2017 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BufferPool = sync.Pool{
	New: func() interface{} {
		return &Buffer{}
	},
}

Functions

func HasDoubleDot

func HasDoubleDot(p []byte) bool

func PickeParseBytes added in v0.6.1

func PickeParseBytes(exit chan struct{}, b []byte, now uint32, out chan *RowBinary.WriteBuffer, days *days1970.Days, metricsReceived *uint32, errors *uint32)

func PickleParser added in v0.6.1

func PickleParser(exit chan struct{}, in chan []byte, out chan *RowBinary.WriteBuffer, metricsReceived *uint32, errors *uint32)

func PlainParseBuffer

func PlainParseBuffer(exit chan struct{}, b *Buffer, out chan *RowBinary.WriteBuffer, days *days1970.Days, metricsReceived *uint32, errors *uint32)

func PlainParseLine

func PlainParseLine(p []byte) ([]byte, float64, uint32, error)

func PlainParser

func PlainParser(exit chan struct{}, in chan *Buffer, out chan *RowBinary.WriteBuffer, metricsReceived *uint32, errors *uint32)

func RemoveDoubleDot

func RemoveDoubleDot(p []byte) []byte

Types

type Buffer

type Buffer struct {
	Time uint32
	Used int
	Body [262144]byte
}

func GetBuffer

func GetBuffer() *Buffer

func (*Buffer) Release

func (b *Buffer) Release()

func (*Buffer) Reset

func (b *Buffer) Reset() *Buffer

func (*Buffer) Write

func (b *Buffer) Write(p []byte)

type GRPC added in v0.6.1

type GRPC struct {
	stop.Struct
	// contains filtered or unexported fields
}

GRPC receive metrics from GRPC connections

func (*GRPC) Addr added in v0.6.1

func (g *GRPC) Addr() net.Addr

Addr returns binded socket address. For bind port 0 in tests

func (*GRPC) Listen added in v0.6.1

func (g *GRPC) Listen(addr *net.TCPAddr) error

Listen bind port. Receive messages and send to out channel

func (*GRPC) Stat added in v0.6.1

func (g *GRPC) Stat(send func(metric string, value float64))

func (*GRPC) Store added in v0.6.1

func (g *GRPC) Store(ctx context.Context, in *pb.Payload) (*empty.Empty, error)

func (*GRPC) StoreSync added in v0.6.1

func (g *GRPC) StoreSync(ctx context.Context, in *pb.Payload) (*empty.Empty, error)

type Option

type Option func(Receiver) error

func ParseThreads

func ParseThreads(threads int) Option

ParseThreads creates option for New contructor

func WriteChan

func WriteChan(ch chan *RowBinary.WriteBuffer) Option

WriteChan creates option for New contructor

type Pickle added in v0.6.1

type Pickle struct {
	stop.Struct
	// contains filtered or unexported fields
}

Pickle receive metrics from TCP connections

func (*Pickle) Addr added in v0.6.1

func (rcv *Pickle) Addr() net.Addr

Addr returns binded socket address. For bind port 0 in tests

func (*Pickle) HandleConnection added in v0.6.1

func (rcv *Pickle) HandleConnection(conn net.Conn)

func (*Pickle) Listen added in v0.6.1

func (rcv *Pickle) Listen(addr *net.TCPAddr) error

Listen bind port. Receive messages and send to out channel

func (*Pickle) Stat added in v0.6.1

func (rcv *Pickle) Stat(send func(metric string, value float64))

type Receiver

type Receiver interface {
	Stat(func(metric string, value float64))
	Stop()
}

func New

func New(dsn string, opts ...Option) (Receiver, error)

New creates udp, tcp, pickle receiver

type TCP

type TCP struct {
	stop.Struct
	// contains filtered or unexported fields
}

TCP receive metrics from TCP connections

func (*TCP) Addr

func (rcv *TCP) Addr() net.Addr

Addr returns binded socket address. For bind port 0 in tests

func (*TCP) HandleConnection

func (rcv *TCP) HandleConnection(conn net.Conn)

func (*TCP) Listen

func (rcv *TCP) Listen(addr *net.TCPAddr) error

Listen bind port. Receive messages and send to out channel

func (*TCP) Stat

func (rcv *TCP) Stat(send func(metric string, value float64))

type UDP

type UDP struct {
	stop.Struct
	// contains filtered or unexported fields
}

UDP receive metrics from UDP messages

func (*UDP) Addr

func (rcv *UDP) Addr() net.Addr

Addr returns binded socket address. For bind port 0 in tests

func (*UDP) Listen

func (rcv *UDP) Listen(addr *net.UDPAddr) error

Listen bind port. Receive messages and send to out channel

func (*UDP) Stat

func (rcv *UDP) Stat(send func(metric string, value float64))

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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