monitor

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SystemRegistry      = metrics.NewPrefixedChildRegistry(metrics.DefaultRegistry, "/system/")
	PerformanceRegistry = metrics.NewPrefixedChildRegistry(metrics.DefaultRegistry, "/performance/")
)

Functions

func CPUInfo

func CPUInfo() ([]cpu.InfoStat, error)

CPUInfo get cpu info

func CaptureRuntimeCPUStats

func CaptureRuntimeCPUStats(ctx context.Context, d time.Duration)

CaptureRuntimeCPUStats Capture cpu status

func CaptureRuntimeCPUStatsOnce

func CaptureRuntimeCPUStatsOnce(r metrics.Registry)

CaptureRuntimeCPUStatsOnce Capture cpu status once

func CaptureRuntimeDiskStats

func CaptureRuntimeDiskStats(ctx context.Context, d time.Duration)

func CaptureRuntimeDiskStatsOnce

func CaptureRuntimeDiskStatsOnce(r metrics.Registry)

func CaptureRuntimeNetStats

func CaptureRuntimeNetStats(ctx context.Context, d time.Duration)

func CaptureRuntimeNetStatsOnce

func CaptureRuntimeNetStatsOnce(r metrics.Registry)

func DiskInfo

func DiskInfo() (*disk.UsageStat, error)

func Duration

func Duration(invocation time.Time, name string)

func Host

func Host() (*host.InfoStat, error)

func Interfaces

func Interfaces() ([]net.IOCountersStat, error)

func RegisterDiskStats

func RegisterDiskStats(r metrics.Registry)

func RegisterRuntimeCPUStats

func RegisterRuntimeCPUStats(r metrics.Registry)

RegisterRuntimeCPUStats register cpu metrics to registry

func RegisterRuntimeNetworkStats

func RegisterRuntimeNetworkStats(r metrics.Registry)

func Users

func Users() ([]host.UserStat, error)

Types

type CPUStat

type CPUStat struct {
	User         metrics.GaugeFloat64
	System       metrics.GaugeFloat64
	Idle         metrics.GaugeFloat64
	Nice         metrics.GaugeFloat64
	Iowait       metrics.GaugeFloat64
	Irq          metrics.GaugeFloat64
	Softirq      metrics.GaugeFloat64
	Steal        metrics.GaugeFloat64
	Guest        metrics.GaugeFloat64
	GuestNice    metrics.GaugeFloat64
	ReadCpuStats metrics.Timer
}

CPUStat cpu metrics holder

type IOCounterStats

type IOCounterStats struct {
	ReadCount        metrics.Gauge
	MergedReadCount  metrics.Gauge
	WriteCount       metrics.Gauge
	MergedWriteCount metrics.Gauge
	ReadBytes        metrics.Gauge
	WriteBytes       metrics.Gauge
	ReadTime         metrics.Gauge
	WriteTime        metrics.Gauge
	IopsInProgress   metrics.Gauge
	IoTime           metrics.Gauge
	WeightedIO       metrics.Gauge
}

type NetStat

type NetStat struct {
	BytesSent   metrics.Gauge
	BytesRecv   metrics.Gauge
	PacketsSent metrics.Gauge
	PacketsRecv metrics.Gauge
	Errin       metrics.Gauge
	Errout      metrics.Gauge
	Dropin      metrics.Gauge
	Dropout     metrics.Gauge
	Fifoin      metrics.Gauge
	Fifoout     metrics.Gauge
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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