Help us shape the future of Go! Take the 2026 Go Developer Survey

graphite

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2015 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultBindAddress is the default binding interface if none is specified.
	DefaultBindAddress = ":2003"

	// DefaultDatabase is the default database if none is specified.
	DefaultDatabase = "graphite"

	// DefaultNameSeparator represents the default field separator.
	DefaultNameSeparator = "."

	// DefaultNamePosition represents the default location of the name.
	DefaultNamePosition = "last"

	// DefaultProtocol is the default IP protocol used by the Graphite input.
	DefaultProtocol = "tcp"

	// DefaultConsistencyLevel is the default write consistency for the Graphite input.
	DefaultConsistencyLevel = "one"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BindAddress      string        `toml:"bind-address"`
	Database         string        `toml:"database"`
	Enabled          bool          `toml:"enabled"`
	Protocol         string        `toml:"protocol"`
	NamePosition     string        `toml:"name-position"`
	NameSeparator    string        `toml:"name-separator"`
	BatchSize        int           `toml:"batch-size"`
	BatchTimeout     toml.Duration `toml:"batch-timeout"`
	ConsistencyLevel string        `toml:"consistency-level"`
}

Config represents the configuration for Graphite endpoints.

func NewConfig

func NewConfig() Config

NewConfig returns a new Config with defaults.

func (*Config) LastEnabled

func (c *Config) LastEnabled() bool

LastEnabled returns whether the server should interpret the last field as "name".

func (*Config) WithDefaults

func (c *Config) WithDefaults() *Config

WithDefaults takes the given config and returns a new config with any required default values set.

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) (tsdb.Point, error)

Parse performs Graphite parsing of a single line.

type Service

type Service struct {
	PointsWriter interface {
		WritePoints(p *cluster.WritePointsRequest) error
	}
	MetaStore interface {
		CreateDatabaseIfNotExists(name string) (*meta.DatabaseInfo, error)
	}
	// contains filtered or unexported fields
}

func NewService

func NewService(c Config) (*Service, error)

NewService returns an instance of the Graphite service.

func (*Service) Addr

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

func (*Service) Close

func (s *Service) Close() error

Close stops all data processing on the Graphite input.

func (*Service) Open

func (s *Service) Open() error

Open starts the Graphite input processing data.

func (*Service) SetLogger

func (s *Service) SetLogger(l *log.Logger)

SetLogger sets the internal logger to the logger passed in.

Jump to

Keyboard shortcuts

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