diskcollector

package
v0.0.0-...-44b04c4 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricsPort = "METRICS_PORT"
	Address     = "METRICS_ADDRESS"
	DefaultPort = 8080
)

Variables

This section is empty.

Functions

func InitPrometheusRegistry

func InitPrometheusRegistry(mountPath string) *prometheus.Registry

func ServeCollector

func ServeCollector()

func ServeHTTP

func ServeHTTP(registry *prometheus.Registry, settings *serverSettings)

func ServeHTTPS

func ServeHTTPS(registry *prometheus.Registry, settings *serverSettings)

func StatDisk

func StatDisk(path string) (*unix.Statfs_t, error)

Types

type CollectHandler

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

func (*CollectHandler) Collect

func (h *CollectHandler) Collect(ch chan<- prometheus.Metric)

func (*CollectHandler) Describe

func (h *CollectHandler) Describe(ch chan<- *prometheus.Desc)

func (*CollectHandler) Register

func (h *CollectHandler) Register(c DiskCollector)

type DiskCollector

type DiskCollector interface {
	Collect() PrometheusDiskInfo
}

type DiskInfo

type DiskInfo struct {
	Path       string
	Bsize      float64
	Bused      float64
	Bfree      float64
	Bavailable float64
}

type PrometheusDiskInfo

type PrometheusDiskInfo struct {
	DiskInfo
	DescSize      *prometheus.Desc
	DescUsed      *prometheus.Desc
	DescFree      *prometheus.Desc
	DescAvailable *prometheus.Desc
}

type UnixDiskStat

type UnixDiskStat struct {
	PrometheusDiskInfo
}

func InitPd

func InitPd(path string) (p *UnixDiskStat)

Init the description for the Prometheus metrics for disks

func (UnixDiskStat) Collect

func (p UnixDiskStat) Collect() PrometheusDiskInfo

func (*UnixDiskStat) InitDp

func (d *UnixDiskStat) InitDp(path string)

Jump to

Keyboard shortcuts

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