collectd

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2015 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDatapoint

func NewDatapoint(point *JSONWriteFormat, index uint, defaultDimensions map[string]string) *datapoint.Datapoint

NewDatapoint creates a new datapoint from collectd's write_http endpoint JSON format defaultDimensions are added to the datapoint created, but will be overridden by any dimension values in the JSON

func SetupHandler

func SetupHandler(ctx context.Context, name string, sink dpsink.Sink) (*web.Handler, stats.Keeper)

SetupHandler is shared between signalfx and here to setup listening for collectd connections. Will do shared basic setup like configuring request counters

Types

type JSONDecoder

type JSONDecoder struct {
	SendTo dpsink.Sink

	TotalErrors    int64
	TotalBlankDims int64
}

JSONDecoder can decode collectd's native JSON datapoint format

func (*JSONDecoder) Read

func (decoder *JSONDecoder) Read(ctx context.Context, req *http.Request) error

func (*JSONDecoder) ServeHTTPC

func (decoder *JSONDecoder) ServeHTTPC(ctx context.Context, rw http.ResponseWriter, req *http.Request)

ServeHTTPC decodes datapoints for the connection and sends them to the decoder's sink

func (*JSONDecoder) Stats

func (decoder *JSONDecoder) Stats(dimensions map[string]string) []*datapoint.Datapoint

Stats about this decoder, including how many datapoints it decoded

type JSONWriteBody

type JSONWriteBody []*JSONWriteFormat

JSONWriteBody is the full POST body of collectd's write_http format

type JSONWriteFormat

type JSONWriteFormat struct {
	Dsnames        []*string  `json:"dsnames"`
	Dstypes        []*string  `json:"dstypes"`
	Host           *string    `json:"host"`
	Interval       *float64   `json:"interval"`
	Plugin         *string    `json:"plugin"`
	PluginInstance *string    `json:"plugin_instance"`
	Time           *float64   `json:"time"`
	TypeS          *string    `json:"type"`
	TypeInstance   *string    `json:"type_instance"`
	Values         []*float64 `json:"values"`
}

JSONWriteFormat is the format for collectd json datapoints

type ListenerServer

type ListenerServer struct {
	stats.Keeper
	// contains filtered or unexported fields
}

ListenerServer will listen for collectd datapoint connections

func ListenerLoader

func ListenerLoader(ctx context.Context, sink dpsink.Sink, listenFrom *config.ListenFrom) (*ListenerServer, error)

ListenerLoader loads a listener for collectd write_http protocol

func StartListeningCollectDHTTPOnPort

func StartListeningCollectDHTTPOnPort(ctx context.Context, sink dpsink.Sink,
	listenAddr string, listenPath string, clientTimeout time.Duration, name string) (*ListenerServer, error)

StartListeningCollectDHTTPOnPort servers http collectd requests

func (*ListenerServer) Close

func (streamer *ListenerServer) Close() error

Close the socket currently open for collectd JSON connections

Jump to

Keyboard shortcuts

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