agent

package
v0.0.0-...-bdb06d8 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NErrors = selfstat.Register("agent", "gather_errors", map[string]string{})
)

Functions

func NewAccumulator

func NewAccumulator(
	maker MetricMaker,
	metrics chan tinymonitor.Metric,
) tinymonitor.Accumulator

Types

type Agent

type Agent struct {
	Config *config.Config
}

Agent runs telegraf and collects data based on the given config

func NewAgent

func NewAgent(config *config.Config) (*Agent, error)

NewAgent returns an Agent struct based off the given Config

func (*Agent) Close

func (a *Agent) Close() error

Close closes the connection to all configured outputs

func (*Agent) Connect

func (a *Agent) Connect() error

Connect connects to all configured outputs

func (*Agent) Run

func (a *Agent) Run(shutdown chan struct{}) error

Run runs the agent daemon, gathering every Interval

func (*Agent) Test

func (a *Agent) Test() error

Test verifies that we can 'Gather' from all inputs with their configured Config struct

type MetricMaker

type MetricMaker interface {
	Name() string
	MakeMetric(
		measurement string,
		fields map[string]interface{},
		tags map[string]string,
		mType tinymonitor.ValueType,
		t time.Time,
	) tinymonitor.Metric
}

Jump to

Keyboard shortcuts

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