metric

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AvairableMetrics

func AvairableMetrics() map[MetricKey]Metric

func ClkTck

func ClkTck() float64

ClkTck return clocks per sec (CLK_TCK)

func DefaultEnabledMetrics added in v0.1.1

func DefaultEnabledMetrics() map[MetricKey]bool

Types

type Metric

type Metric interface {
	Describe() map[string]*prometheus.Desc
	String() string
	Collect(k string) error
	CollectFromProc(proc procfs.Proc) error
	PushCollected(ch chan<- prometheus.Metric, descs map[string]*prometheus.Desc, grouper string, group string) error
	RequiredWeight() int64
}

type MetricKey

type MetricKey string
var (
	ProcProcs   MetricKey = "proc_procs"
	ProcGrouped MetricKey = "proc_grouped"
	ProcStat    MetricKey = "proc_stat"
	ProcIO      MetricKey = "proc_io"
	ProcStatus  MetricKey = "proc_status"
)

type ProcGroupedMetric added in v0.8.0

type ProcGroupedMetric struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ProcGroupedMetric is metric

func NewProcGroupedMetric added in v0.8.0

func NewProcGroupedMetric() *ProcGroupedMetric

func (*ProcGroupedMetric) Collect added in v0.8.0

func (m *ProcGroupedMetric) Collect(k string) error

func (*ProcGroupedMetric) CollectFromProc added in v0.8.0

func (m *ProcGroupedMetric) CollectFromProc(proc procfs.Proc) error

func (*ProcGroupedMetric) Describe added in v0.8.0

func (m *ProcGroupedMetric) Describe() map[string]*prometheus.Desc

func (*ProcGroupedMetric) PushCollected added in v0.8.0

func (m *ProcGroupedMetric) PushCollected(ch chan<- prometheus.Metric, descs map[string]*prometheus.Desc, grouper string, group string) error

func (*ProcGroupedMetric) RequiredWeight added in v0.8.0

func (m *ProcGroupedMetric) RequiredWeight() int64

func (*ProcGroupedMetric) String added in v0.8.0

func (m *ProcGroupedMetric) String() string

type ProcIOMetric

type ProcIOMetric struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ProcIOMetric is metric

func NewProcIOMetric

func NewProcIOMetric() *ProcIOMetric

func (*ProcIOMetric) Collect added in v0.8.0

func (m *ProcIOMetric) Collect(k string) error

func (*ProcIOMetric) CollectFromProc

func (m *ProcIOMetric) CollectFromProc(proc procfs.Proc) error

func (*ProcIOMetric) Describe

func (m *ProcIOMetric) Describe() map[string]*prometheus.Desc

func (*ProcIOMetric) PushCollected

func (m *ProcIOMetric) PushCollected(ch chan<- prometheus.Metric, descs map[string]*prometheus.Desc, grouper string, group string) error

func (*ProcIOMetric) RequiredWeight added in v0.5.0

func (m *ProcIOMetric) RequiredWeight() int64

func (*ProcIOMetric) String

func (m *ProcIOMetric) String() string

type ProcProcsMetric

type ProcProcsMetric struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ProcProcsMetric is metric

func NewProcProcsMetric

func NewProcProcsMetric() *ProcProcsMetric

func (*ProcProcsMetric) Collect added in v0.8.0

func (m *ProcProcsMetric) Collect(k string) error

func (*ProcProcsMetric) CollectFromProc

func (m *ProcProcsMetric) CollectFromProc(proc procfs.Proc) error

func (*ProcProcsMetric) Describe

func (m *ProcProcsMetric) Describe() map[string]*prometheus.Desc

func (*ProcProcsMetric) PushCollected

func (m *ProcProcsMetric) PushCollected(ch chan<- prometheus.Metric, descs map[string]*prometheus.Desc, grouper string, group string) error

func (*ProcProcsMetric) RequiredWeight added in v0.5.0

func (m *ProcProcsMetric) RequiredWeight() int64

func (*ProcProcsMetric) String

func (m *ProcProcsMetric) String() string

type ProcStatMetric

type ProcStatMetric struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ProcStatMetric is metric

func NewProcStatMetric

func NewProcStatMetric() *ProcStatMetric

NewProcStatMetric

func (*ProcStatMetric) Collect added in v0.8.0

func (m *ProcStatMetric) Collect(k string) error

func (*ProcStatMetric) CollectFromProc

func (m *ProcStatMetric) CollectFromProc(proc procfs.Proc) error

func (*ProcStatMetric) Describe

func (m *ProcStatMetric) Describe() map[string]*prometheus.Desc

func (*ProcStatMetric) PushCollected

func (m *ProcStatMetric) PushCollected(ch chan<- prometheus.Metric, descs map[string]*prometheus.Desc, grouper string, group string) error

func (*ProcStatMetric) RequiredWeight added in v0.5.0

func (m *ProcStatMetric) RequiredWeight() int64

func (*ProcStatMetric) String

func (m *ProcStatMetric) String() string

type ProcStatusMetric added in v0.7.0

type ProcStatusMetric struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ProcStatusMetric is metric

func NewProcStatusMetric added in v0.7.0

func NewProcStatusMetric() *ProcStatusMetric

NewProcStatusMetric

func (*ProcStatusMetric) Collect added in v0.8.0

func (m *ProcStatusMetric) Collect(k string) error

func (*ProcStatusMetric) CollectFromProc added in v0.7.0

func (m *ProcStatusMetric) CollectFromProc(proc procfs.Proc) error

func (*ProcStatusMetric) Describe added in v0.7.0

func (m *ProcStatusMetric) Describe() map[string]*prometheus.Desc

func (*ProcStatusMetric) PushCollected added in v0.7.0

func (m *ProcStatusMetric) PushCollected(ch chan<- prometheus.Metric, descs map[string]*prometheus.Desc, grouper string, group string) error

func (*ProcStatusMetric) RequiredWeight added in v0.7.0

func (m *ProcStatusMetric) RequiredWeight() int64

func (*ProcStatusMetric) String added in v0.7.0

func (m *ProcStatusMetric) String() string

Jump to

Keyboard shortcuts

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