v0.0.0-...-87682d9 Latest Latest

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 8 Imported by: 0



Package cpuload implements an i3bar module that shows load averages. Deprecated in favour of SysInfo, which can show more than just load average.



This section is empty.


This section is empty.


This section is empty.


type LoadAvg

type LoadAvg [3]float64

LoadAvg represents the CPU load average for the past 1, 5, and 15 minutes.

func (LoadAvg) Min1

func (l LoadAvg) Min1() float64

Min1 returns the CPU load average for the past 1 minute.

func (LoadAvg) Min15

func (l LoadAvg) Min15() float64

Min15 returns the CPU load average for the past 15 minutes.

func (LoadAvg) Min5

func (l LoadAvg) Min5() float64

Min5 returns the CPU load average for the past 5 minutes.

type Module

type Module struct {
	// contains filtered or unexported fields

Module represents a cpuload bar module. It supports setting the output format, click handler, update frequency, and urgency/colour functions.

func New

func New() *Module

New constructs an instance of the cpuload module.

func (*Module) Output

func (m *Module) Output(outputFunc func(LoadAvg) bar.Output) *Module

Output configures a module to display the output of a user-defined function.

func (*Module) RefreshInterval

func (m *Module) RefreshInterval(interval time.Duration) *Module

RefreshInterval configures the polling frequency for getloadavg.

func (*Module) Stream

func (m *Module) Stream(s bar.Sink)

Stream starts the module.

Jump to

Keyboard shortcuts

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