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: 3 Imported by: 0

Documentation

Overview

Package loadavg provides the system's loadavg information using a syscall.

Index

Constants

View Source
const LoadsScale = 65536

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
	One       float64
	Five      float64
	Fifteen   float64
}

LoadAvg holds loadavg information and the timestamp of the data.

func Get

func Get() (LoadAvg, error)

Get returns LoadAvg populated with the 1, 5, and 15 minute values.

func (*LoadAvg) Get

func (l *LoadAvg) Get() error

Get the load average for the last 1, 5, and 15 minutes.

type Ticker

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

Ticker delivers the LoadAvg 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 provides the system's loadavg information using a syscall.
Package loadavg provides the system's loadavg information using a syscall.
Package loadavg provides the system's loadavg information using a syscall.
Package loadavg provides the system's loadavg information using a syscall.

Jump to

Keyboard shortcuts

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