loadavg

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package loadavg provides the system's loadavg information using a syscall. Instead of returning a Go struct, it returns Flatbuffer serialized bytes. A function to deserialize the Flatbuffer serialized bytes into a loadavg.Info struct is provided.

Note: the package name is loadavg and not the final element of the import path (flat).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deserialize

func Deserialize(p []byte) *load.LoadAvg

Deserialize takes some Flatbuffer serialized bytes and deserialize's them as loadavg.LoadAvg.

func Get

func Get() (p []byte, err error)

Get returns the current LoadAvg as Flatbuffer serialized bytes.

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.

func Serialize

func Serialize(l *load.LoadAvg) []byte

Serialize loadAvg.LoadAvg using Flatbuffers.

Types

type Ticker

type Ticker struct {
	*joe.Ticker
	Data chan []byte
}

Ticker delivers loadavg.LoadAvg as Flatbuffers serialized bytes 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

Jump to

Keyboard shortcuts

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