carbon

package
v1.2.23 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TCP = "tcp"
	UDP = "udp"
)

Constants for udp and tcp config

Variables

This section is empty.

Functions

func NativeCarbonLine

func NativeCarbonLine(dp *datapoint.Datapoint) (string, bool)

NativeCarbonLine inspects the datapoints metadata to see if it has information about the carbon source it came from

func NewCarbonDatapoint

func NewCarbonDatapoint(line string, metricDeconstructor metricdeconstructor.MetricDeconstructor) (*datapoint.Datapoint, error)

NewCarbonDatapoint creates a new datapoint from a line in carbon and injects into the datapoint metadata about the original line.

Types

type Forwarder

type Forwarder struct {
	filtering.FilteredForwarder
	// contains filtered or unexported fields
}

Forwarder is a sink that forwards points to a carbon endpoint

func NewForwarder

func NewForwarder(host string, passedConf *ForwarderConfig) (*Forwarder, error)

NewForwarder creates a new unbuffered forwarder for sending points to carbon

func (*Forwarder) AddDatapoints

func (f *Forwarder) AddDatapoints(ctx context.Context, points []*datapoint.Datapoint) (err error)

AddDatapoints sends the points to a carbon endpoint. Tries to reuse open connections

func (*Forwarder) Close

func (f *Forwarder) Close() error

Close empties out the connections' pool of open connections

func (*Forwarder) Datapoints added in v0.9.0

func (f *Forwarder) Datapoints() []*datapoint.Datapoint

Datapoints satisfies the sfxclient.Collector interface

func (*Forwarder) DebugDatapoints added in v1.2.11

func (f *Forwarder) DebugDatapoints() []*datapoint.Datapoint

DebugDatapoints returns connection pool datapoints

func (*Forwarder) DefaultDatapoints added in v1.2.11

func (f *Forwarder) DefaultDatapoints() []*datapoint.Datapoint

DefaultDatapoints does nothing and exists to satisfy the protocol.Forwarder interface

type ForwarderConfig added in v0.9.0

type ForwarderConfig struct {
	Filters                *filtering.FilterObj
	Port                   *uint16
	Timeout                *time.Duration
	DimensionOrder         []string
	IdleConnectionPoolSize *int64
	Timer                  timekeeper.TimeKeeper
}

ForwarderConfig controls optional parameters for a carbon forwarder

type Listener

type Listener struct {
	protocol.CloseableHealthCheck
	// contains filtered or unexported fields
}

Listener once setup will listen for carbon protocol points to forward on

func NewListener

func NewListener(sendTo dpsink.Sink, passedConf *ListenerConfig) (*Listener, error)

NewListener creates a new listener for carbon datapoints

func (*Listener) Addr added in v0.9.0

func (listener *Listener) Addr() net.Addr

Addr returns the listening address of this carbon listener

func (*Listener) Close

func (listener *Listener) Close() error

Close the exposed carbon port

func (*Listener) Datapoints added in v0.9.0

func (listener *Listener) Datapoints() []*datapoint.Datapoint

Datapoints reports information about the total points seen by carbon

func (*Listener) DebugDatapoints added in v1.2.11

func (listener *Listener) DebugDatapoints() []*datapoint.Datapoint

DebugDatapoints returns datapoints that are used for debugging the listener

func (*Listener) DefaultDatapoints added in v1.2.11

func (listener *Listener) DefaultDatapoints() []*datapoint.Datapoint

DefaultDatapoints returns datapoints that should always be reported from the listener

type ListenerConfig added in v0.9.0

type ListenerConfig struct {
	ServerAcceptDeadline *time.Duration
	ConnectionTimeout    *time.Duration
	ListenAddr           *string
	MetricDeconstructor  metricdeconstructor.MetricDeconstructor
	Logger               log.Logger
	Protocol             *string
}

ListenerConfig controls optional parameters for carbon listeners

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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