monitor

package
v2.50.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Byte

type Byte uint64
const (
	KB Byte = 1 << (10 * (iota + 1))
	MB
	GB
)

func (Byte) String

func (b Byte) String() string

func (Byte) Uint64

func (b Byte) Uint64() uint64

type CPU

type CPU struct {
	User   float64
	Kernel float64
	Idle   float64
}

func (CPU) Total

func (c CPU) Total() float64

Total returns the sum of user and kernel CPU time.

type CPUTime

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

func (CPUTime) CPU

func (c CPUTime) CPU() float64

type DiskUsage

type DiskUsage struct {
	Total Byte
	Used  Byte
}

func UsedDiskSpace

func UsedDiskSpace(name string) (DiskUsage, error)

func (*DiskUsage) Percent

func (d *DiskUsage) Percent() float64

type MemStat

type MemStat struct {
	Total Byte
	Avail Byte
}

func SystemMemStats

func SystemMemStats() (MemStat, error)

func SystemPageStats

func SystemPageStats() (MemStat, error)

func (MemStat) Used

func (m MemStat) Used() float64

type Monitor

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

func New

func New(freq time.Duration) (*Monitor, error)

func (*Monitor) CPU

func (m *Monitor) CPU() (cpu CPU, err error)

func (*Monitor) MemStat

func (m *Monitor) MemStat() MemStat

Jump to

Keyboard shortcuts

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