monitor

package
v0.0.58 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2017 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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