mets

package module
v0.0.0-...-504bf06 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: MIT Imports: 7 Imported by: 0

README

mets

collect metrics and post them to mackerel.

License

MIT

Author

https://github.com/handlename

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MkrMetricValueString

func MkrMetricValueString(v *mackerel.MetricValue) string

Types

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

func NewAgent

func NewAgent(config AgentConfig) Agent

func (*Agent) RegisterMetricSource

func (app *Agent) RegisterMetricSource(target MetricsSource) error

func (Agent) Run

func (app Agent) Run(ctx context.Context) error

func (Agent) ThrowMetricValues

func (app Agent) ThrowMetricValues(ctx context.Context, values []*MetricValue) error

type AgentConfig

type AgentConfig struct {
	Dryrun bool

	MackerelAPIKey       string
	MackerelService      string
	MackerelMetricPrefix string
}

type MetricValue

type MetricValue struct {
	Label string
	Time  int64
	Value interface{}
}

type MetricsSource

type MetricsSource interface {
	String() string
	FetchMetrics(context.Context) ([]*MetricValue, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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