collectd

package
v0.9.0-rc32 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPort = 25826

DefaultPort for collectd is 25826

Variables

This section is empty.

Functions

func ListenAndServe

func ListenAndServe(s *Server, iface string) error

ListenAndServe starts starts receiving collectd metrics via UDP and writes the received data points into the server's SeriesWriter. The serving goroutine is only stopped when s.Close() is called, but ListenAndServe returns immediately.

func Unmarshal

func Unmarshal(packet *gollectd.Packet) []tsdb.Point

Unmarshal translates a collectd packet into InfluxDB data points.

Types

type Config

type Config struct {
	Enabled     bool   `toml:"enabled"`
	BindAddress string `toml:"bind-address"`
	Database    string `toml:"database"`
	TypesDB     string `toml:"typesdb"`
}

func NewConfig

func NewConfig() Config

type SeriesWriter

type SeriesWriter interface {
	WriteSeries(database, retentionPolicy string, points []tsdb.Point) (uint64, error)
}

SeriesWriter defines the interface for the destination of the data.

type Server

type Server struct {
	Database string

	BatchSize    int
	BatchTimeout time.Duration
	// contains filtered or unexported fields
}

Server represents a UDP server which receives metrics in collectd's binary protocol and stores them in InfluxDB.

func NewServer

func NewServer(w SeriesWriter, typesDBPath string) *Server

NewServer constructs a new Server.

func (*Server) Close

func (s *Server) Close() error

Close shuts down the server's listeners.

type Service

type Service struct{}

func NewService

func NewService(c Config) *Service

func (*Service) Addr

func (s *Service) Addr() net.Addr

func (*Service) Close

func (s *Service) Close() error

func (*Service) Open

func (s *Service) Open() error

Jump to

Keyboard shortcuts

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