membasic

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

Documentation

Overview

Package membasic processes a subset of the /proc/meminfo file. For more detailed information about a system's memory, use the meminfo 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 Info

type Info struct {
	Timestamp    int64  `json:"timestamp"`
	Active       uint64 `json:"active"`
	Inactive     uint64 `json:"inactive"`
	Mapped       uint64 `json:"mapped"`
	MemAvailable uint64 `json:"mem_available"`
	MemFree      uint64 `json:"mem_free"`
	MemTotal     uint64 `json:"mem_total"`
	SwapCached   uint64 `json:"swap_cached"`
	SwapFree     uint64 `json:"swap_free"`
	SwapTotal    uint64 `json:"swap_total"`
}

Info holds the basic meminfo information.

func Get

func Get() (inf *Info, err error)

Get returns the current basic memory information using the package's global Profiler.

type Profiler

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

Profiler is used to get the basic memory information by processing the /proc/meminfo file.

func NewProfiler

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

Returns an initialized Profiler; ready to use.

func (*Profiler) Get

func (prof *Profiler) Get() (inf *Info, err error)

Get returns the current basic memory 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 Info
	*Profiler
}

Ticker delivers the system's basic 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 membasic processes a subset of the /proc/meminfo file.
Package membasic processes a subset of the /proc/meminfo file.
Package membasic processes a subset of the /proc/meminfo file.
Package membasic processes a subset of the /proc/meminfo file.

Jump to

Keyboard shortcuts

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