agent

package
v0.0.0-...-3667945 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 telegraf.Metric,
) *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 telegraf.ValueType,
		t time.Time,
	) telegraf.Metric
}

Jump to

Keyboard shortcuts

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