agent

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package agent contains code for pushing metric indicators to reliably entity api

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(l Logger)

Logger - set Logger for the agent

Types

type Error

type Error struct {
	Objective *entities.Objective
	// contains filtered or unexported fields
}

Error - agent error type used to associate failed objectives with its given error

func (*Error) Error

func (e *Error) Error() string

Error - impl error interface

type ErrorHandler

type ErrorHandler func(*Error)

ErrorHandler - type used to handle errors in Job

type ExitSignal

type ExitSignal struct{}

ExitSignal - empty struct type used to trigger agent Job close

type IndicatorHandler

type IndicatorHandler func(*entities.Indicator) error

IndicatorHandler - type used to handle indicators after they are generated

type Job

type Job struct {
	// The number of seconds between indicator calculations and pushing
	Interval int64

	// Objectives - The objectives to create indicators from
	Objectives []*entities.Objective
	// contains filtered or unexported fields
}

Job - an Agent job defines the objectives and handlers for generating indicators.

func NewJob

func NewJob(interval int64, objectives []*entities.Objective) *Job

NewJob - creates a new agent job

func (*Job) Do

func (j *Job) Do()

Do - run job

func (*Job) ErrorFunc

func (j *Job) ErrorFunc(f ErrorHandler) *Job

ErrorFunc - set the job ErrorHandler value

func (*Job) IndicatorFunc

func (j *Job) IndicatorFunc(f IndicatorHandler) *Job

IndicatorFunc - set the job IndicatorHandler value

type Labels added in v0.21.0

type Labels entities.Labels

func (Labels) String added in v0.21.0

func (l Labels) String() string

type Logger

type Logger interface {
	Infof(format string, args ...interface{})
	Info(args ...interface{})

	Debugf(format string, args ...interface{})
	Debug(args ...interface{})

	Warnf(format string, args ...interface{})
	Warn(args ...interface{})

	Errorf(format string, args ...interface{})
	Error(args ...interface{})
}

Logger - interface used to fascilitate logging within the agent

Jump to

Keyboard shortcuts

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