command

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAgent added in v0.16.0

func NewAgent(conf *config.Config) *agent.Agent

NewAgent creates a new instance of agent.Agent from its configuration conf.

func NewMackerelClient added in v0.43.2

func NewMackerelClient(apibase, apikey, ver, rev string, verbose bool) (*mackerel.API, error)

NewMackerelClient returns Mackerel API client for mackerel-agent

func Run

func Run(app *App, termCh chan struct{}) error

Run starts the main metric collecting logic and this function will never return.

func RunOnce added in v0.15.0

func RunOnce(conf *config.Config, ameta *AgentMeta) error

RunOnce collects specs and metrics, then output them to stdout.

Types

type AgentMeta added in v0.43.2

type AgentMeta struct {
	Version  string
	Revision string
}

AgentMeta contains meta information about mackerel-agent

type App added in v0.43.1

type App struct {
	Agent                 *agent.Agent
	Config                *config.Config
	Host                  *mackerel.Host
	API                   *mackerel.API
	CustomIdentifierHosts map[string]*mackerel.Host
	AgentMeta             *AgentMeta
}

App contains objects for running main loop of mackerel-agent

func Prepare added in v0.8.0

func Prepare(conf *config.Config, ameta *AgentMeta) (*App, error)

Prepare sets up API and registers the host data to the Mackerel server. Use returned values to call Run().

func (*App) UpdateHostSpecs added in v0.43.1

func (app *App) UpdateHostSpecs()

UpdateHostSpecs updates the host information that is already registered on Mackerel.

Jump to

Keyboard shortcuts

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