sysinfo

package module
v0.0.0-...-5909a53 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2013 License: BSD-2-Clause Imports: 4 Imported by: 15

Documentation

Overview

A wrapper around the linux syscall sysinfo(2).

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SI

type SI struct {
	Uptime       time.Duration // time since boot
	Loads        [3]float64    // 1, 5, and 15 minute load averages, see e.g. UPTIME(1)
	Procs        uint64        // number of current processes
	TotalRam     uint64        // total usable main memory size [kB]
	FreeRam      uint64        // available memory size [kB]
	SharedRam    uint64        // amount of shared memory [kB]
	BufferRam    uint64        // memory used by buffers [kB]
	TotalSwap    uint64        // total swap space size [kB]
	FreeSwap     uint64        // swap space still available [kB]
	TotalHighRam uint64        // total high memory size [kB]
	FreeHighRam  uint64        // available high memory size [kB]
	// contains filtered or unexported fields
}

Go-ized http://man7.org/linux/man-pages/man2/sysinfo.2.html

func (SI) String

func (si SI) String() string

Make the "fmt" Stringer interface happy.

func (*SI) ToString

func (si *SI) ToString() string

Convert to string in a thread safe way.

 Output:
	uptime		279h6m21s
	load		0.12 0.04 0.05
	procs		143
	ram  total	383752 kB
	ram  free	254980 kB
	ram  buffer	7640 kB
	swap total	887800 kB
	swap free	879356 kB

Jump to

Keyboard shortcuts

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