graphite

package
v0.9.0-rc9 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2015 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultGraphitePort represents the default Graphite (Carbon) plaintext port.
	DefaultGraphitePort = 2003

	// DefaultGraphiteNameSeparator represents the default Graphite field separator.
	DefaultGraphiteNameSeparator = "."
)

Variables

View Source
var (
	// ErrBindAddressRequired is returned when starting the Server
	// without a TCP or UDP listening address.
	ErrBindAddressRequired = errors.New("bind address required")

	// ErrServerClosed return when closing an already closed graphite server.
	ErrServerClosed = errors.New("server already closed")

	// ErrDatabaseNotSpecified retuned when no database was specified in the config file
	ErrDatabaseNotSpecified = errors.New("database was not specified in config")

	// ErrServerNotSpecified returned when Server is not specified.
	ErrServerNotSpecified = errors.New("server not present")
)

Functions

This section is empty.

Types

type Parser

type Parser struct {
	Separator   string
	LastEnabled bool
}

Parser encapulates a Graphite Parser.

func NewParser

func NewParser() *Parser

NewParser returns a GraphiteParser instance.

func (*Parser) DecodeNameAndTags

func (p *Parser) DecodeNameAndTags(field string) (string, map[string]string, error)

DecodeNameAndTags parses the name and tags of a single field of a Graphite datum.

func (*Parser) Parse

func (p *Parser) Parse(line string) (influxdb.Point, error)

Parse performs Graphite parsing of a single line.

type SeriesWriter

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

SeriesWriter defines the interface for the destination of the data.

type TCPServer

type TCPServer struct {
	Database string
	// contains filtered or unexported fields
}

TCPServer processes Graphite data received over TCP connections.

func NewTCPServer

func NewTCPServer(p *Parser, w SeriesWriter) *TCPServer

NewTCPServer returns a new instance of a TCPServer.

func (*TCPServer) ListenAndServe

func (t *TCPServer) ListenAndServe(iface string) error

ListenAndServe instructs the TCPServer to start processing Graphite data on the given interface. iface must be in the form host:port

type UDPServer

type UDPServer struct {
	Database string
	// contains filtered or unexported fields
}

UDPerver processes Graphite data received via UDP.

func NewUDPServer

func NewUDPServer(p *Parser, w SeriesWriter) *UDPServer

NewUDPServer returns a new instance of a UDPServer

func (*UDPServer) ListenAndServe

func (u *UDPServer) ListenAndServe(iface string) error

ListenAndServer instructs the UDPServer to start processing Graphite data on the given interface. iface must be in the form host:port.

Jump to

Keyboard shortcuts

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