opentsdb

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: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPort represents the default OpenTSDB port.
	DefaultPort = 4242

	// DefaultDatabaseName is the default OpenTSDB database if none is specified.
	DefaultDatabaseName = "opentsdb"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled         bool   `toml:"enabled"`
	BindAddress     string `toml:"bind-address"`
	Database        string `toml:"database"`
	RetentionPolicy string `toml:"retention-policy"`
}

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 {
	// contains filtered or unexported fields
}

Server is an InfluxDB input class to implement OpenTSDB's input protocols.

func NewServer

func NewServer(w SeriesWriter, retpol string, db string) *Server

func (*Server) Addr

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

func (*Server) Close

func (s *Server) Close() error

func (*Server) HandleConnection

func (s *Server) HandleConnection(conn net.Conn)

HandleConnection takes each new connection and attempts to determine if it should be handled by the HTTP handler, if parsing as a HTTP request fails, we'll pass it to the telnet handler

func (*Server) HandleTelnet

func (s *Server) HandleTelnet(conn net.Conn)

HandleTelnet accepts OpenTSDB's telnet protocol Each telnet command consists of a line of the form:

put sys.cpu.user 1356998400 42.5 host=webserver01 cpu=0

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(listenAddress string)

ListenAndServe start the OpenTSDB compatible server on the given ip and port.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements OpenTSDB's HTTP /api/put endpoint

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