mem

package
v0.0.0-...-2d83fc9 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2017 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package mem returns memory information using syscalls. Only basic memory information is provided by this package.

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 MemInfo

type MemInfo struct {
	Timestamp int64
	TotalRAM  uint64
	FreeRAM   uint64
	SharedRAM uint64
	BufferRAM uint64
	TotalSwap uint64
	FreeSwap  uint64
}

MemInfo holds information about system memory.

func Get

func Get() (m MemInfo, err error)

Get gets the system's memory information.

func (*MemInfo) Get

func (m *MemInfo) Get() error

Get gets the system's memory information.

type Ticker

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

Ticker delivers the system's memory 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 mem returns memory information using syscalls.
Package mem returns memory information using syscalls.
Package mem returns memory information using syscalls.
Package mem returns memory information using syscalls.

Jump to

Keyboard shortcuts

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