cpu

package
v0.0.0-...-efff542 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Load

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

Load represents a CPU load.

func NewLoad

func NewLoad(cores int, l *log.Logger) *Load

NewLoad returns a configured CPU load.

func (*Load) Start

func (l *Load) Start()

Start starts up the load goroutines.

func (*Load) Stop

func (l *Load) Stop()

Stop signals all goroutines to stop and waits for them to return.

func (*Load) Update

func (l *Load) Update(pct int64)

Update updates the load percentage of all goroutines.

type Monitor

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

Monitor represents a CPU load monitor.

func NewMonitor

func NewMonitor(cores int, l *log.Logger) *Monitor

NewMonitor returns a configured CPU load monitor.

func (*Monitor) Start

func (m *Monitor) Start()

Start starts up the monitoring goroutine.

func (*Monitor) Stop

func (m *Monitor) Stop()

Stop signals the monitoring goroutine to stop and waits for it to return.

func (*Monitor) Usage

func (m *Monitor) Usage() interface{}

Usage returns the latest set of CPU utilisation levels.

Jump to

Keyboard shortcuts

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