collector

package
v0.0.0-...-920cd99 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoData = errors.New("collector returned no data")

Functions

func IsNoDataError

func IsNoDataError(err error) bool

Types

type Collector

type Collector interface {
	Update(ch chan<- prometheus.Metric) error
}

func NewCPUCollector

func NewCPUCollector() (Collector, error)

func NewFilesystemCollector

func NewFilesystemCollector() (Collector, error)

NewFilesystemCollector returns a new Collector exposing filesystems stats.

func NewMeminfoCollector

func NewMeminfoCollector() (Collector, error)

NewMeminfoCollector returns a new Collector exposing memory stats.

func NewNetDevCollector

func NewNetDevCollector() (Collector, error)

NewNetDevCollector returns a new Collector exposing network device stats.

type Instance

type Instance struct {
	R *prometheus.Registry
	C *NodeCollector
	// contains filtered or unexported fields
}

func GetInstance

func GetInstance() *Instance

func (*Instance) GetInstance

func (ins *Instance) GetInstance() string

func (*Instance) GetJob

func (ins *Instance) GetJob() string

func (*Instance) GetMetrics

func (ins *Instance) GetMetrics() string

func (*Instance) PushMetrics

func (ins *Instance) PushMetrics(gateway string, data string) error

func (*Instance) SetInstance

func (ins *Instance) SetInstance(instance string)

func (*Instance) SetJob

func (ins *Instance) SetJob(job string)

type NodeCollector

type NodeCollector struct {
	Collectors map[string]Collector
}

func NewNodeCollector

func NewNodeCollector() *NodeCollector

func (NodeCollector) Collect

func (n NodeCollector) Collect(ch chan<- prometheus.Metric)

func (NodeCollector) Describe

func (n NodeCollector) Describe(ch chan<- *prometheus.Desc)

Jump to

Keyboard shortcuts

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