loadavg

package
v0.0.0-...-df36a95 Latest Latest
Warning

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

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

Documentation

Overview

Package loadAvg gets loadavg information from the /proc/loadavg file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTicker

func NewTicker(d time.Duration) (joe.Tocker, error)

NewTicker returns a new Ticker containing a Data channel that delivers the data at intervals and an error channel that delivers any errors encountered. Stop the ticker to signal the ticker to stop running. Stopping the ticker does not close the Data channel; call Close to close both the ticker and the data channel.

Types

type LoadAvg

type LoadAvg struct {
	Timestamp int64
	Minute    float32
	Five      float32
	Fifteen   float32
	Running   int32
	Total     int32
	PID       int32
}

LoadAvg holds loadavg information

func Get

func Get() (la LoadAvg, err error)

Get gets the loadavg information using the package's global Profiler.

type Profiler

type Profiler struct {
	joe.Procer
	*joe.Buffer
}

Profiler processes the loadavg information.

func NewProfiler

func NewProfiler() (prof *Profiler, err error)

Returns an initialized Profiler; ready to use.

func (*Profiler) Get

func (prof *Profiler) Get() (la LoadAvg, err error)

Get populates LoadAvg with /proc/loadavg information.

func (*Profiler) Reset

func (prof *Profiler) Reset() error

Reset resources: after reset, the profiler is ready to be used again.

type Ticker

type Ticker struct {
	*joe.Ticker
	Data chan LoadAvg
	*Profiler
}

Ticker delivers the system's loadavg information at intervals.

func (*Ticker) Close

func (t *Ticker) Close()

Close closes the ticker resources.

func (*Ticker) Run

func (t *Ticker) Run()

Run runs the ticker.

Directories

Path Synopsis
Package loadAvg gets loadavg information from the /proc/loadavg file.
Package loadAvg gets loadavg information from the /proc/loadavg file.
Package loadAvg gets loadavg information from the /proc/loadavg file.
Package loadAvg gets loadavg information from the /proc/loadavg file.

Jump to

Keyboard shortcuts

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